@framers/agentos 0.10.22 → 0.10.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api/AgentOS.d.ts.map +1 -1
- package/dist/api/AgentOS.js +3 -2
- package/dist/api/AgentOS.js.map +1 -1
- package/dist/api/agent.d.ts.map +1 -1
- package/dist/api/agent.js +25 -10
- package/dist/api/agent.js.map +1 -1
- package/dist/api/embedText.d.ts.map +1 -1
- package/dist/api/embedText.js +53 -17
- package/dist/api/embedText.js.map +1 -1
- package/dist/api/generateImage.d.ts.map +1 -1
- package/dist/api/generateImage.js +51 -7
- package/dist/api/generateImage.js.map +1 -1
- package/dist/api/generateText.d.ts +50 -7
- package/dist/api/generateText.d.ts.map +1 -1
- package/dist/api/generateText.js +265 -35
- package/dist/api/generateText.js.map +1 -1
- package/dist/api/model.d.ts +25 -1
- package/dist/api/model.d.ts.map +1 -1
- package/dist/api/model.js +108 -3
- package/dist/api/model.js.map +1 -1
- package/dist/api/runtime/SelfImprovementSessionManager.d.ts +34 -2
- package/dist/api/runtime/SelfImprovementSessionManager.d.ts.map +1 -1
- package/dist/api/runtime/SelfImprovementSessionManager.js +119 -33
- package/dist/api/runtime/SelfImprovementSessionManager.js.map +1 -1
- package/dist/api/runtime/global-default.d.ts +9 -1
- package/dist/api/runtime/global-default.d.ts.map +1 -1
- package/dist/api/runtime/global-default.js.map +1 -1
- package/dist/api/runtime/provider-defaults.d.ts.map +1 -1
- package/dist/api/runtime/provider-defaults.js +10 -4
- package/dist/api/runtime/provider-defaults.js.map +1 -1
- package/dist/api/runtime/tool-emulation/history.d.ts +16 -0
- package/dist/api/runtime/tool-emulation/history.d.ts.map +1 -0
- package/dist/api/runtime/tool-emulation/history.js +89 -0
- package/dist/api/runtime/tool-emulation/history.js.map +1 -0
- package/dist/api/runtime/tool-emulation/index.d.ts +1 -0
- package/dist/api/runtime/tool-emulation/index.d.ts.map +1 -1
- package/dist/api/runtime/tool-emulation/index.js +1 -0
- package/dist/api/runtime/tool-emulation/index.js.map +1 -1
- package/dist/api/runtime/tool-emulation/loop.d.ts +6 -0
- package/dist/api/runtime/tool-emulation/loop.d.ts.map +1 -1
- package/dist/api/runtime/tool-emulation/loop.js +1 -0
- package/dist/api/runtime/tool-emulation/loop.js.map +1 -1
- package/dist/api/sessionTranscript.d.ts +34 -0
- package/dist/api/sessionTranscript.d.ts.map +1 -1
- package/dist/api/sessionTranscript.js +61 -1
- package/dist/api/sessionTranscript.js.map +1 -1
- package/dist/api/streamText.d.ts.map +1 -1
- package/dist/api/streamText.js +120 -24
- package/dist/api/streamText.js.map +1 -1
- package/dist/api/types/AgentOSInput.d.ts +11 -0
- package/dist/api/types/AgentOSInput.d.ts.map +1 -1
- package/dist/api/types.d.ts +14 -6
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/cognition/emergent/AdaptPersonalityTool.d.ts +13 -4
- package/dist/cognition/emergent/AdaptPersonalityTool.d.ts.map +1 -1
- package/dist/cognition/emergent/AdaptPersonalityTool.js +32 -23
- package/dist/cognition/emergent/AdaptPersonalityTool.js.map +1 -1
- package/dist/cognition/emergent/EmergentCapabilityEngine.d.ts +18 -6
- package/dist/cognition/emergent/EmergentCapabilityEngine.d.ts.map +1 -1
- package/dist/cognition/emergent/EmergentCapabilityEngine.js.map +1 -1
- package/dist/cognition/emergent/SelfEvaluateTool.d.ts +10 -3
- package/dist/cognition/emergent/SelfEvaluateTool.d.ts.map +1 -1
- package/dist/cognition/emergent/SelfEvaluateTool.js +3 -2
- package/dist/cognition/emergent/SelfEvaluateTool.js.map +1 -1
- package/dist/cognition/substrate/CognitiveMemoryBridge.d.ts +51 -2
- package/dist/cognition/substrate/CognitiveMemoryBridge.d.ts.map +1 -1
- package/dist/cognition/substrate/CognitiveMemoryBridge.js +84 -2
- package/dist/cognition/substrate/CognitiveMemoryBridge.js.map +1 -1
- package/dist/cognition/substrate/ConversationHistoryManager.d.ts +8 -4
- package/dist/cognition/substrate/ConversationHistoryManager.d.ts.map +1 -1
- package/dist/cognition/substrate/ConversationHistoryManager.js +17 -5
- package/dist/cognition/substrate/ConversationHistoryManager.js.map +1 -1
- package/dist/cognition/substrate/GMI.d.ts +92 -5
- package/dist/cognition/substrate/GMI.d.ts.map +1 -1
- package/dist/cognition/substrate/GMI.js +291 -65
- package/dist/cognition/substrate/GMI.js.map +1 -1
- package/dist/cognition/substrate/GMIManager.d.ts +12 -0
- package/dist/cognition/substrate/GMIManager.d.ts.map +1 -1
- package/dist/cognition/substrate/GMIManager.js +22 -16
- package/dist/cognition/substrate/GMIManager.js.map +1 -1
- package/dist/cognition/substrate/IGMI.d.ts +23 -0
- package/dist/cognition/substrate/IGMI.d.ts.map +1 -1
- package/dist/cognition/substrate/IGMI.js.map +1 -1
- package/dist/cognition/substrate/MetapromptExecutor.d.ts +183 -28
- package/dist/cognition/substrate/MetapromptExecutor.d.ts.map +1 -1
- package/dist/cognition/substrate/MetapromptExecutor.js +431 -108
- package/dist/cognition/substrate/MetapromptExecutor.js.map +1 -1
- package/dist/cognition/substrate/personas/IPersonaDefinition.d.ts +5 -0
- package/dist/cognition/substrate/personas/IPersonaDefinition.d.ts.map +1 -1
- package/dist/cognition/substrate/personas/PersonaValidation.d.ts.map +1 -1
- package/dist/cognition/substrate/personas/PersonaValidation.js +30 -0
- package/dist/cognition/substrate/personas/PersonaValidation.js.map +1 -1
- package/dist/cognition/substrate/personas/SoulLoader.d.ts +14 -1
- package/dist/cognition/substrate/personas/SoulLoader.d.ts.map +1 -1
- package/dist/cognition/substrate/personas/SoulLoader.js +45 -12
- package/dist/cognition/substrate/personas/SoulLoader.js.map +1 -1
- package/dist/cognition/substrate/personas/definitions/default_assistant_persona.json +3 -35
- package/dist/cognition/substrate/personas/hexaco.d.ts +34 -0
- package/dist/cognition/substrate/personas/hexaco.d.ts.map +1 -0
- package/dist/cognition/substrate/personas/hexaco.js +66 -0
- package/dist/cognition/substrate/personas/hexaco.js.map +1 -0
- package/dist/cognition/substrate/userFeedback.d.ts +69 -0
- package/dist/cognition/substrate/userFeedback.d.ts.map +1 -0
- package/dist/cognition/substrate/userFeedback.js +107 -0
- package/dist/cognition/substrate/userFeedback.js.map +1 -0
- package/dist/core/conversation/ConversationMessage.d.ts +9 -0
- package/dist/core/conversation/ConversationMessage.d.ts.map +1 -1
- package/dist/core/conversation/ConversationMessage.js.map +1 -1
- package/dist/core/llm/IPromptEngine.d.ts +9 -0
- package/dist/core/llm/IPromptEngine.d.ts.map +1 -1
- package/dist/core/llm/IPromptEngine.js.map +1 -1
- package/dist/core/llm/PromptEngine.d.ts +30 -1
- package/dist/core/llm/PromptEngine.d.ts.map +1 -1
- package/dist/core/llm/PromptEngine.js +229 -92
- package/dist/core/llm/PromptEngine.js.map +1 -1
- package/dist/core/llm/providers/AIModelProviderManager.d.ts +20 -0
- package/dist/core/llm/providers/AIModelProviderManager.d.ts.map +1 -1
- package/dist/core/llm/providers/AIModelProviderManager.js +35 -5
- package/dist/core/llm/providers/AIModelProviderManager.js.map +1 -1
- package/dist/core/llm/providers/IProvider.d.ts +28 -8
- package/dist/core/llm/providers/IProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts +135 -49
- package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/AnthropicProvider.js +323 -114
- package/dist/core/llm/providers/implementations/AnthropicProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js +15 -1
- package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts +1 -1
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.js +51 -24
- package/dist/core/llm/providers/implementations/GeminiCLIProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/GeminiProvider.d.ts +25 -6
- package/dist/core/llm/providers/implementations/GeminiProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/GeminiProvider.js +108 -90
- package/dist/core/llm/providers/implementations/GeminiProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/MistralProvider.d.ts +11 -0
- package/dist/core/llm/providers/implementations/MistralProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/MistralProvider.js +32 -2
- package/dist/core/llm/providers/implementations/MistralProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/OllamaProvider.js +7 -7
- package/dist/core/llm/providers/implementations/OllamaProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/OpenAIProvider.d.ts +53 -2
- package/dist/core/llm/providers/implementations/OpenAIProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/OpenAIProvider.js +84 -17
- package/dist/core/llm/providers/implementations/OpenAIProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/OpenRouterProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/OpenRouterProvider.js +8 -3
- package/dist/core/llm/providers/implementations/OpenRouterProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/TogetherProvider.d.ts +3 -3
- package/dist/core/llm/providers/implementations/TogetherProvider.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/TogetherProvider.js +25 -13
- package/dist/core/llm/providers/implementations/TogetherProvider.js.map +1 -1
- package/dist/core/llm/providers/implementations/cacheLeakDetector.d.ts +15 -7
- package/dist/core/llm/providers/implementations/cacheLeakDetector.d.ts.map +1 -1
- package/dist/core/llm/providers/implementations/cacheLeakDetector.js +12 -7
- package/dist/core/llm/providers/implementations/cacheLeakDetector.js.map +1 -1
- package/dist/core/llm/providers/model-cache-capabilities.d.ts +24 -9
- package/dist/core/llm/providers/model-cache-capabilities.d.ts.map +1 -1
- package/dist/core/llm/providers/model-cache-capabilities.js +59 -44
- package/dist/core/llm/providers/model-cache-capabilities.js.map +1 -1
- package/dist/core/llm/providers/model-effort.d.ts +14 -0
- package/dist/core/llm/providers/model-effort.d.ts.map +1 -1
- package/dist/core/llm/providers/model-effort.js +22 -0
- package/dist/core/llm/providers/model-effort.js.map +1 -1
- package/dist/core/llm/providers/model-forced-tool-choice.d.ts +13 -6
- package/dist/core/llm/providers/model-forced-tool-choice.d.ts.map +1 -1
- package/dist/core/llm/providers/model-forced-tool-choice.js +14 -7
- package/dist/core/llm/providers/model-forced-tool-choice.js.map +1 -1
- package/dist/core/llm/providers/model-thinking.d.ts +64 -13
- package/dist/core/llm/providers/model-thinking.d.ts.map +1 -1
- package/dist/core/llm/providers/model-thinking.js +52 -12
- package/dist/core/llm/providers/model-thinking.js.map +1 -1
- package/dist/core/llm/providers/openrouter-only-params.d.ts +26 -7
- package/dist/core/llm/providers/openrouter-only-params.d.ts.map +1 -1
- package/dist/core/llm/providers/openrouter-only-params.js +58 -9
- package/dist/core/llm/providers/openrouter-only-params.js.map +1 -1
- package/dist/core/llm/providers/url-secrets.d.ts +42 -0
- package/dist/core/llm/providers/url-secrets.d.ts.map +1 -0
- package/dist/core/llm/providers/url-secrets.js +64 -0
- package/dist/core/llm/providers/url-secrets.js.map +1 -0
- package/dist/core/llm/streaming/StreamingBatcher.d.ts +4 -3
- package/dist/core/llm/streaming/StreamingBatcher.d.ts.map +1 -1
- package/dist/core/llm/streaming/StreamingBatcher.js +8 -3
- package/dist/core/llm/streaming/StreamingBatcher.js.map +1 -1
- package/dist/core/safety/LLMProviderHealthRegistry.d.ts +4 -0
- package/dist/core/safety/LLMProviderHealthRegistry.d.ts.map +1 -1
- package/dist/core/safety/LLMProviderHealthRegistry.js +26 -0
- package/dist/core/safety/LLMProviderHealthRegistry.js.map +1 -1
- package/dist/core/utils/sha256.d.ts +19 -0
- package/dist/core/utils/sha256.d.ts.map +1 -0
- package/dist/core/utils/sha256.js +101 -0
- package/dist/core/utils/sha256.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/orchestration/pipeline/query/types.js +3 -3
- package/dist/orchestration/pipeline/query/types.js.map +1 -1
- package/dist/orchestration/planning/ProviderAssignmentEngine.js +2 -2
- package/dist/orchestration/planning/ProviderAssignmentEngine.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ import { IProvider, ChatMessage, ModelCompletionOptions, ModelCompletionResponse
|
|
|
16
16
|
* @example
|
|
17
17
|
* const config: TogetherProviderConfig = {
|
|
18
18
|
* apiKey: process.env.TOGETHER_API_KEY!,
|
|
19
|
-
* defaultModelId: 'meta-llama/
|
|
19
|
+
* defaultModelId: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
|
|
20
20
|
* };
|
|
21
21
|
*/
|
|
22
22
|
export interface TogetherProviderConfig {
|
|
@@ -29,7 +29,7 @@ export interface TogetherProviderConfig {
|
|
|
29
29
|
baseURL?: string;
|
|
30
30
|
/**
|
|
31
31
|
* Default model to use when none is specified.
|
|
32
|
-
* @default "meta-llama/
|
|
32
|
+
* @default "meta-llama/Llama-3.3-70B-Instruct-Turbo"
|
|
33
33
|
*/
|
|
34
34
|
defaultModelId?: string;
|
|
35
35
|
/** Request timeout in milliseconds. @default 60000 */
|
|
@@ -47,7 +47,7 @@ export interface TogetherProviderConfig {
|
|
|
47
47
|
* const together = new TogetherProvider();
|
|
48
48
|
* await together.initialize({ apiKey: process.env.TOGETHER_API_KEY! });
|
|
49
49
|
* const res = await together.generateCompletion(
|
|
50
|
-
* 'meta-llama/
|
|
50
|
+
* 'meta-llama/Llama-3.3-70B-Instruct-Turbo', messages, {},
|
|
51
51
|
* );
|
|
52
52
|
*/
|
|
53
53
|
export declare class TogetherProvider implements IProvider {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TogetherProvider.d.ts","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/TogetherProvider.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,uBAAuB,EACvB,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAOtB;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"TogetherProvider.d.ts","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/TogetherProvider.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,uBAAuB,EACvB,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAOtB;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAwDD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAiB,YAAW,SAAS;IAChD,kBAAkB;IAClB,SAAgB,UAAU,EAAE,MAAM,CAAc;IAChD,kBAAkB;IACX,aAAa,EAAE,OAAO,CAAS;IACtC,kBAAkB;IACX,cAAc,CAAC,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAwB;;IAIxC;;;;;;;OAOG;IACU,UAAU,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBtE,kBAAkB;IACL,kBAAkB,CAC7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,uBAAuB,CAAC;IAInC,kBAAkB;IACJ,wBAAwB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,EAAE,sBAAsB,GAC9B,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,SAAS,CAAC;IAI3D;;;;;;;OAOG;IACU,kBAAkB,CAC7B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,yBAAyB,CAAC;IAIrC;;;;;OAKG;IACU,mBAAmB,CAAC,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAOxF,kBAAkB;IACL,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAI1E,kBAAkB;IACL,WAAW,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAI9E,kBAAkB;IACL,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAKvC"}
|
|
@@ -3,35 +3,47 @@ import { OpenAIProvider } from './OpenAIProvider.js';
|
|
|
3
3
|
// ---------------------------------------------------------------------------
|
|
4
4
|
// Known model catalog
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Static catalog of Together AI serverless chat models (served per Together's
|
|
8
|
+
* model list, checked 2026-09-30). The Llama 3.1 Turbo and Mixtral 8x7B ids
|
|
9
|
+
* were removed from serverless in February to April 2026. Llama 3.3 70B is
|
|
10
|
+
* the only served chat model that neither reasons by default nor lacks
|
|
11
|
+
* function calling or structured outputs, so it is the default.
|
|
12
|
+
*/
|
|
7
13
|
const TOGETHER_MODELS = [
|
|
8
14
|
{
|
|
9
|
-
modelId: 'meta-llama/
|
|
15
|
+
modelId: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
|
|
10
16
|
providerId: 'together',
|
|
11
|
-
displayName: 'Llama 3.
|
|
12
|
-
description: 'Meta Llama 3.
|
|
17
|
+
displayName: 'Llama 3.3 70B Instruct Turbo',
|
|
18
|
+
description: 'Meta Llama 3.3 70B on Together serverless; function calling and structured outputs.',
|
|
13
19
|
capabilities: ['chat', 'tool_use'],
|
|
14
20
|
contextWindowSize: 131072,
|
|
21
|
+
pricePer1MTokensInput: 1.04,
|
|
22
|
+
pricePer1MTokensOutput: 1.04,
|
|
15
23
|
supportsStreaming: true,
|
|
16
24
|
status: 'active',
|
|
17
25
|
},
|
|
18
26
|
{
|
|
19
|
-
modelId: '
|
|
27
|
+
modelId: 'openai/gpt-oss-120b',
|
|
20
28
|
providerId: 'together',
|
|
21
|
-
displayName: '
|
|
22
|
-
description: '
|
|
29
|
+
displayName: 'GPT-OSS 120B',
|
|
30
|
+
description: 'OpenAI open-weight reasoning model on Together serverless (always reasons).',
|
|
23
31
|
capabilities: ['chat', 'tool_use'],
|
|
24
32
|
contextWindowSize: 131072,
|
|
33
|
+
pricePer1MTokensInput: 0.15,
|
|
34
|
+
pricePer1MTokensOutput: 0.6,
|
|
25
35
|
supportsStreaming: true,
|
|
26
36
|
status: 'active',
|
|
27
37
|
},
|
|
28
38
|
{
|
|
29
|
-
modelId: '
|
|
39
|
+
modelId: 'zai-org/GLM-5.3-Flash',
|
|
30
40
|
providerId: 'together',
|
|
31
|
-
displayName: '
|
|
32
|
-
description: '
|
|
41
|
+
displayName: 'GLM-5.3 Flash',
|
|
42
|
+
description: 'Z.ai GLM-5.3 Flash on Together serverless (thinking on by default).',
|
|
33
43
|
capabilities: ['chat', 'tool_use'],
|
|
34
|
-
contextWindowSize:
|
|
44
|
+
contextWindowSize: 1048575,
|
|
45
|
+
pricePer1MTokensInput: 0.15,
|
|
46
|
+
pricePer1MTokensOutput: 0.5,
|
|
35
47
|
supportsStreaming: true,
|
|
36
48
|
status: 'active',
|
|
37
49
|
},
|
|
@@ -51,7 +63,7 @@ const TOGETHER_MODELS = [
|
|
|
51
63
|
* const together = new TogetherProvider();
|
|
52
64
|
* await together.initialize({ apiKey: process.env.TOGETHER_API_KEY! });
|
|
53
65
|
* const res = await together.generateCompletion(
|
|
54
|
-
* 'meta-llama/
|
|
66
|
+
* 'meta-llama/Llama-3.3-70B-Instruct-Turbo', messages, {},
|
|
55
67
|
* );
|
|
56
68
|
*/
|
|
57
69
|
export class TogetherProvider {
|
|
@@ -78,7 +90,7 @@ export class TogetherProvider {
|
|
|
78
90
|
if (!config.apiKey) {
|
|
79
91
|
throw new Error('API key is required for TogetherProvider. Set TOGETHER_API_KEY.');
|
|
80
92
|
}
|
|
81
|
-
this.defaultModelId = config.defaultModelId ?? 'meta-llama/
|
|
93
|
+
this.defaultModelId = config.defaultModelId ?? 'meta-llama/Llama-3.3-70B-Instruct-Turbo';
|
|
82
94
|
// Delegate to OpenAI provider with Together's endpoint
|
|
83
95
|
await this.delegate.initialize({
|
|
84
96
|
apiKey: config.apiKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TogetherProvider.js","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/TogetherProvider.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAuB/E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgClD,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E
|
|
1
|
+
{"version":3,"file":"TogetherProvider.js","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/TogetherProvider.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAuB/E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgClD,8E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CAAC,mBAAmB,CAAC,MAAgC;QAC/D,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC;YACvB,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAW,CAAC,CAAC,CAAC;QAClF,CAAC;QACD,OAAO,CAAC,GAAG,eAAe,CAAC,CAAC;IAC9B,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,YAAY,CAAC,OAAe;QACvC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,WAAW;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;IAED,kBAAkB;IACX,KAAK,CAAC,QAAQ;QACnB,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
* activity at all. Breakpoints are missing, dropped in
|
|
21
21
|
* conversion, or stood down; the caller re-pays full
|
|
22
22
|
* input price on every call. Only fires when the
|
|
23
|
-
* average uncached size clears the
|
|
24
|
-
* cacheable minimum (4096 tokens
|
|
25
|
-
*
|
|
23
|
+
* average uncached size clears the model's own
|
|
24
|
+
* cacheable minimum (512 to 4096 tokens, see
|
|
25
|
+
* model-cache-capabilities.ts), so legitimately
|
|
26
|
+
* sub-minimum prompts never flag, and never for a
|
|
27
|
+
* request that turned caching off (`cacheOptOut`).
|
|
26
28
|
*
|
|
27
29
|
* A callsite is identified as `model | hash(first 256 chars of the
|
|
28
30
|
* system prompt)` — stable across calls from the same prompt-assembly
|
|
@@ -43,6 +45,12 @@ export interface CacheUsageSample {
|
|
|
43
45
|
cacheReadTokens: number;
|
|
44
46
|
/** `usage.cache_creation_input_tokens` (1.25-2x price). */
|
|
45
47
|
cacheCreationTokens: number;
|
|
48
|
+
/**
|
|
49
|
+
* True when the caller turned caching off for this request (the provider
|
|
50
|
+
* option `cache: false`), such as a one-shot fallback leg. Its uncached
|
|
51
|
+
* input is deliberate, so the sample is not recorded.
|
|
52
|
+
*/
|
|
53
|
+
cacheOptOut?: boolean;
|
|
46
54
|
}
|
|
47
55
|
/** Tuning constants, exported for tests (not part of the public API). */
|
|
48
56
|
export declare const __cacheLeakThresholds: {
|
|
@@ -53,10 +61,10 @@ export declare const __cacheLeakThresholds: {
|
|
|
53
61
|
/**
|
|
54
62
|
* FALLBACK average uncached tokens/call before "nothing cached" is
|
|
55
63
|
* suspicious, used when the model id resolves no capabilities. The live
|
|
56
|
-
* threshold is the MODEL's own cacheable-prefix floor (
|
|
57
|
-
* see model-cache-capabilities.ts), so e.g. a Sonnet 4.6 callsite
|
|
58
|
-
* 3K uncached tokens/call with zero cache activity flags even
|
|
59
|
-
* sits under the Opus floor.
|
|
64
|
+
* threshold is the MODEL's own cacheable-prefix floor (512, 1024, 2048 or
|
|
65
|
+
* 4096; see model-cache-capabilities.ts), so e.g. a Sonnet 4.6 callsite
|
|
66
|
+
* paying 3K uncached tokens/call with zero cache activity flags even
|
|
67
|
+
* though it sits under the Opus 4.5 floor.
|
|
60
68
|
*/
|
|
61
69
|
readonly uncachedAvgFloor: 4096;
|
|
62
70
|
/** Bucket-map size cap; the map clears past it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheLeakDetector.d.ts","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/cacheLeakDetector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cacheLeakDetector.d.ts","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/cacheLeakDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,eAAe,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAWD,yEAAyE;AACzE,eAAO,MAAM,qBAAqB;IAChC,yEAAyE;;IAEzE,0EAA0E;;IAE1E;;;;;;;OAOG;;IAEH,mDAAmD;;CAE3C,CAAC;AAeX;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,EACxB,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAmB,GAC7C,IAAI,CAwDN;AAED,oCAAoC;AACpC,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
|
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
* activity at all. Breakpoints are missing, dropped in
|
|
21
21
|
* conversion, or stood down; the caller re-pays full
|
|
22
22
|
* input price on every call. Only fires when the
|
|
23
|
-
* average uncached size clears the
|
|
24
|
-
* cacheable minimum (4096 tokens
|
|
25
|
-
*
|
|
23
|
+
* average uncached size clears the model's own
|
|
24
|
+
* cacheable minimum (512 to 4096 tokens, see
|
|
25
|
+
* model-cache-capabilities.ts), so legitimately
|
|
26
|
+
* sub-minimum prompts never flag, and never for a
|
|
27
|
+
* request that turned caching off (`cacheOptOut`).
|
|
26
28
|
*
|
|
27
29
|
* A callsite is identified as `model | hash(first 256 chars of the
|
|
28
30
|
* system prompt)` — stable across calls from the same prompt-assembly
|
|
@@ -42,10 +44,10 @@ export const __cacheLeakThresholds = {
|
|
|
42
44
|
/**
|
|
43
45
|
* FALLBACK average uncached tokens/call before "nothing cached" is
|
|
44
46
|
* suspicious, used when the model id resolves no capabilities. The live
|
|
45
|
-
* threshold is the MODEL's own cacheable-prefix floor (
|
|
46
|
-
* see model-cache-capabilities.ts), so e.g. a Sonnet 4.6 callsite
|
|
47
|
-
* 3K uncached tokens/call with zero cache activity flags even
|
|
48
|
-
* sits under the Opus floor.
|
|
47
|
+
* threshold is the MODEL's own cacheable-prefix floor (512, 1024, 2048 or
|
|
48
|
+
* 4096; see model-cache-capabilities.ts), so e.g. a Sonnet 4.6 callsite
|
|
49
|
+
* paying 3K uncached tokens/call with zero cache activity flags even
|
|
50
|
+
* though it sits under the Opus 4.5 floor.
|
|
49
51
|
*/
|
|
50
52
|
uncachedAvgFloor: 4096,
|
|
51
53
|
/** Bucket-map size cap; the map clears past it. */
|
|
@@ -74,6 +76,9 @@ export function recordCacheUsage(sample, warn = console.warn) {
|
|
|
74
76
|
const env = process.env.AGENTOS_CACHE_LEAK_DETECTOR;
|
|
75
77
|
if (env === '0' || env === 'false')
|
|
76
78
|
return;
|
|
79
|
+
// A deliberate opt-out carries no markers, so it would read as `unmarked`.
|
|
80
|
+
if (sample.cacheOptOut)
|
|
81
|
+
return;
|
|
77
82
|
try {
|
|
78
83
|
const T = __cacheLeakThresholds;
|
|
79
84
|
if (buckets.size > T.maxBuckets)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheLeakDetector.js","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/cacheLeakDetector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cacheLeakDetector.js","sourceRoot":"","sources":["../../../../../src/core/llm/providers/implementations/cacheLeakDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AA8B1E,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IAC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,CAAC;QAED,IACE,CAAC,MAAM,CAAC,cAAc;eACnB,MAAM,CAAC,OAAO,KAAK,CAAC;eACpB,MAAM,CAAC,KAAK,KAAK,CAAC;eAClB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK,IAAI,aAAa,EAClD,CAAC;YACD,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;YAC7B,IAAI,CACF,2CAA2C,GAAG,UAAU,MAAM,CAAC,KAAK,GAAG;kBACrE,qBAAqB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,mBAAmB;kBAClF,kFAAkF;kBAClF,SAAS,MAAM,CAAC,KAAK,EAAE,CAC1B,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,wCAAwC;IAC1C,CAAC;AACH,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,sBAAsB;IACpC,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -5,12 +5,23 @@
|
|
|
5
5
|
* 4-breakpoint cap) but MODEL-DEPENDENT in two behaviors that matter for
|
|
6
6
|
* correct cache economics:
|
|
7
7
|
*
|
|
8
|
-
* 1. **Minimum cacheable prefix
|
|
9
|
-
* silently never caches (create=0, no error). Floors per
|
|
10
|
-
* docs
|
|
11
|
-
* Sonnet 4.6, Haiku 3.x), 1024 (Sonnet 3.7-4.5).
|
|
8
|
+
* 1. **Minimum cacheable prefix**: a marked prefix below the model's floor
|
|
9
|
+
* silently never caches (create=0, no error). Floors per Anthropic's
|
|
10
|
+
* prompt-caching docs (2026-09-30):
|
|
12
11
|
*
|
|
13
|
-
*
|
|
12
|
+
* | Floor | Models |
|
|
13
|
+
* | --- | --- |
|
|
14
|
+
* | 512 | Fable 5 / 5.1, Mythos 5 / 5.1, Opus 5 / 5.5, Sonnet 5.5 |
|
|
15
|
+
* | 1024 | Opus 4.8, Sonnet 5, Sonnet 4.6, Sonnet 4.5 and older Sonnet, Opus 4.0 / 4.1, Opus 3 |
|
|
16
|
+
* | 2048 | Opus 4.7, Mythos Preview, Haiku 3.x |
|
|
17
|
+
* | 4096 | Opus 4.5 / 4.6, Haiku 4.5 |
|
|
18
|
+
*
|
|
19
|
+
* The floors are not monotonic across generations, so each model gets
|
|
20
|
+
* its own row. Probes agree: nothing cached at about 820 tokens on the
|
|
21
|
+
* 1024-floor models, Sonnet 5 did not cache at 830 tokens, and Opus 4.5
|
|
22
|
+
* did not cache at 561.
|
|
23
|
+
*
|
|
24
|
+
* 2. **Prior-turn thinking retention**: on Opus 4.5+ and Sonnet 4.6+ (and
|
|
14
25
|
* Fable/Mythos), thinking blocks from previous assistant turns are KEPT
|
|
15
26
|
* in context by default, participate in prompt caching, and are billed
|
|
16
27
|
* only when shown; on earlier Opus/Sonnet models and ALL Haiku models
|
|
@@ -20,13 +31,17 @@
|
|
|
20
31
|
* may strip on non-retaining models (pure wire savings; cache-neutral
|
|
21
32
|
* because the server discards them pre-cache either way).
|
|
22
33
|
*
|
|
34
|
+
* The floor's one consumer is the cache-leak detector's `unmarked` threshold
|
|
35
|
+
* (cacheLeakDetector.ts); retention also drives the prior-thinking strip in
|
|
36
|
+
* AnthropicProvider.
|
|
37
|
+
*
|
|
23
38
|
* Kept pure (no provider/SDK imports) like `model-thinking.ts` /
|
|
24
39
|
* `model-effort.ts` so unit tests import no provider code. Matching is
|
|
25
40
|
* prefix-tolerant (`anthropic/`, `anthropic:`, `anthropic.` and dated or
|
|
26
|
-
* suffixed ids) with no `^` anchor
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
41
|
+
* suffixed ids) with no `^` anchor. An UNKNOWN (future) claude model gets
|
|
42
|
+
* modern semantics (retains thinking) and a 4096 floor, the highest of the
|
|
43
|
+
* table, so heuristics built on the floor stay quiet-biased rather than
|
|
44
|
+
* noisy.
|
|
30
45
|
*/
|
|
31
46
|
/** Cache-relevant capabilities for one Anthropic model id. */
|
|
32
47
|
export interface AnthropicCacheCapabilities {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-cache-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-cache-capabilities.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"model-cache-capabilities.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-cache-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,0BAA0B;IACzC,+DAA+D;IAC/D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,mEAAmE;IACnE,wBAAwB,EAAE,MAAM,CAAC;IACjC;;;;OAIG;IACH,6BAA6B,EAAE,OAAO,CAAC;CACxC;AAcD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,0BAA0B,CAuCpF"}
|
|
@@ -5,12 +5,23 @@
|
|
|
5
5
|
* 4-breakpoint cap) but MODEL-DEPENDENT in two behaviors that matter for
|
|
6
6
|
* correct cache economics:
|
|
7
7
|
*
|
|
8
|
-
* 1. **Minimum cacheable prefix
|
|
9
|
-
* silently never caches (create=0, no error). Floors per
|
|
10
|
-
* docs
|
|
11
|
-
* Sonnet 4.6, Haiku 3.x), 1024 (Sonnet 3.7-4.5).
|
|
8
|
+
* 1. **Minimum cacheable prefix**: a marked prefix below the model's floor
|
|
9
|
+
* silently never caches (create=0, no error). Floors per Anthropic's
|
|
10
|
+
* prompt-caching docs (2026-09-30):
|
|
12
11
|
*
|
|
13
|
-
*
|
|
12
|
+
* | Floor | Models |
|
|
13
|
+
* | --- | --- |
|
|
14
|
+
* | 512 | Fable 5 / 5.1, Mythos 5 / 5.1, Opus 5 / 5.5, Sonnet 5.5 |
|
|
15
|
+
* | 1024 | Opus 4.8, Sonnet 5, Sonnet 4.6, Sonnet 4.5 and older Sonnet, Opus 4.0 / 4.1, Opus 3 |
|
|
16
|
+
* | 2048 | Opus 4.7, Mythos Preview, Haiku 3.x |
|
|
17
|
+
* | 4096 | Opus 4.5 / 4.6, Haiku 4.5 |
|
|
18
|
+
*
|
|
19
|
+
* The floors are not monotonic across generations, so each model gets
|
|
20
|
+
* its own row. Probes agree: nothing cached at about 820 tokens on the
|
|
21
|
+
* 1024-floor models, Sonnet 5 did not cache at 830 tokens, and Opus 4.5
|
|
22
|
+
* did not cache at 561.
|
|
23
|
+
*
|
|
24
|
+
* 2. **Prior-turn thinking retention**: on Opus 4.5+ and Sonnet 4.6+ (and
|
|
14
25
|
* Fable/Mythos), thinking blocks from previous assistant turns are KEPT
|
|
15
26
|
* in context by default, participate in prompt caching, and are billed
|
|
16
27
|
* only when shown; on earlier Opus/Sonnet models and ALL Haiku models
|
|
@@ -20,15 +31,28 @@
|
|
|
20
31
|
* may strip on non-retaining models (pure wire savings; cache-neutral
|
|
21
32
|
* because the server discards them pre-cache either way).
|
|
22
33
|
*
|
|
34
|
+
* The floor's one consumer is the cache-leak detector's `unmarked` threshold
|
|
35
|
+
* (cacheLeakDetector.ts); retention also drives the prior-thinking strip in
|
|
36
|
+
* AnthropicProvider.
|
|
37
|
+
*
|
|
23
38
|
* Kept pure (no provider/SDK imports) like `model-thinking.ts` /
|
|
24
39
|
* `model-effort.ts` so unit tests import no provider code. Matching is
|
|
25
40
|
* prefix-tolerant (`anthropic/`, `anthropic:`, `anthropic.` and dated or
|
|
26
|
-
* suffixed ids) with no `^` anchor
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
41
|
+
* suffixed ids) with no `^` anchor. An UNKNOWN (future) claude model gets
|
|
42
|
+
* modern semantics (retains thinking) and a 4096 floor, the highest of the
|
|
43
|
+
* table, so heuristics built on the floor stay quiet-biased rather than
|
|
44
|
+
* noisy.
|
|
30
45
|
*/
|
|
46
|
+
/** Floor for unknown claude ids: the highest in the table, so quiet-biased. */
|
|
31
47
|
const MODERN_FLOOR = 4096;
|
|
48
|
+
/** Capabilities of a claude model that supports prompt caching. */
|
|
49
|
+
function caps(floor, retainsPriorThinking) {
|
|
50
|
+
return {
|
|
51
|
+
supportsPromptCaching: true,
|
|
52
|
+
minCacheablePrefixTokens: floor,
|
|
53
|
+
retainsPriorThinkingInContext: retainsPriorThinking,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
32
56
|
/**
|
|
33
57
|
* Resolve the cache capabilities for an Anthropic model id.
|
|
34
58
|
*
|
|
@@ -48,44 +72,35 @@ export function resolveCacheCapabilities(modelId) {
|
|
|
48
72
|
};
|
|
49
73
|
}
|
|
50
74
|
// --- Haiku: never retains prior thinking, floors per generation ---
|
|
51
|
-
if (/claude-haiku-4-5|claude-4-5-haiku/.test(id))
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// Documented minimum cacheable prefix is 512; keep the same conservative
|
|
63
|
-
// floor as the Fable/Mythos row so floor-based heuristics stay quiet-biased.
|
|
64
|
-
if (/claude-opus-5/.test(id)) {
|
|
65
|
-
return { supportsPromptCaching: true, minCacheablePrefixTokens: 2048, retainsPriorThinkingInContext: true };
|
|
66
|
-
}
|
|
75
|
+
if (/claude-haiku-4-5|claude-4-5-haiku/.test(id))
|
|
76
|
+
return caps(4096, false);
|
|
77
|
+
if (/claude-3-5-haiku|claude-3-haiku/.test(id))
|
|
78
|
+
return caps(2048, false);
|
|
79
|
+
// --- Fable, Mythos, Opus 5.x and Sonnet 5.5: modern semantics ---
|
|
80
|
+
// Mythos Preview runs before the Mythos 5.x match, which it does not share.
|
|
81
|
+
if (/claude-mythos-preview/.test(id))
|
|
82
|
+
return caps(2048, true);
|
|
83
|
+
// `sonnet-5-5\b` keeps Sonnet 5 (1024, below) out of this row.
|
|
84
|
+
if (/claude-(fable|mythos)-5|claude-opus-5|claude-sonnet-5-5\b/.test(id))
|
|
85
|
+
return caps(512, true);
|
|
67
86
|
// --- Opus 4.x ---
|
|
68
|
-
if (/claude-opus-4-
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
87
|
+
if (/claude-opus-4-8/.test(id))
|
|
88
|
+
return caps(1024, true);
|
|
89
|
+
if (/claude-opus-4-7/.test(id))
|
|
90
|
+
return caps(2048, true);
|
|
91
|
+
if (/claude-opus-4-(5|6)/.test(id))
|
|
92
|
+
return caps(4096, true);
|
|
93
|
+
// Opus 4.0 / 4.1 and Opus 3: pre-retention era.
|
|
94
|
+
if (/claude-opus-4|claude-3-opus/.test(id))
|
|
95
|
+
return caps(1024, false);
|
|
76
96
|
// --- Sonnet ---
|
|
77
|
-
if (/claude-sonnet-4-6|claude-sonnet-5/.test(id))
|
|
78
|
-
return
|
|
79
|
-
}
|
|
97
|
+
if (/claude-sonnet-4-6|claude-sonnet-5/.test(id))
|
|
98
|
+
return caps(1024, true);
|
|
80
99
|
if (/claude-sonnet-4|claude-3-7-sonnet|claude-3-5-sonnet|claude-3-sonnet/.test(id)) {
|
|
81
|
-
return
|
|
100
|
+
return caps(1024, false);
|
|
82
101
|
}
|
|
83
|
-
// Unknown / future claude model:
|
|
84
|
-
//
|
|
85
|
-
return
|
|
86
|
-
supportsPromptCaching: true,
|
|
87
|
-
minCacheablePrefixTokens: MODERN_FLOOR,
|
|
88
|
-
retainsPriorThinkingInContext: true,
|
|
89
|
-
};
|
|
102
|
+
// Unknown / future claude model: modern semantics with the highest floor,
|
|
103
|
+
// so floor-based heuristics stay quiet-biased.
|
|
104
|
+
return caps(MODERN_FLOOR, true);
|
|
90
105
|
}
|
|
91
106
|
//# sourceMappingURL=model-cache-capabilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-cache-capabilities.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-cache-capabilities.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"model-cache-capabilities.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-cache-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAgBH,+EAA+E;AAC/E,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B,mEAAmE;AACnE,SAAS,IAAI,CAAC,KAAa,EAAE,oBAA6B;IACxD,OAAO;QACL,qBAAqB,EAAE,IAAI;QAC3B,wBAAwB,EAAE,KAAK;QAC/B,6BAA6B,EAAE,oBAAoB;KACpD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAEjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACvB,iEAAiE;QACjE,mEAAmE;QACnE,OAAO;YACL,qBAAqB,EAAE,KAAK;YAC5B,wBAAwB,EAAE,YAAY;YACtC,6BAA6B,EAAE,KAAK;SACrC,CAAC;IACJ,CAAC;IAED,qEAAqE;IACrE,IAAI,mCAAmC,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3E,IAAI,iCAAiC,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEzE,mEAAmE;IACnE,4EAA4E;IAC5E,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9D,+DAA+D;IAC/D,IAAI,2DAA2D,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEjG,mBAAmB;IACnB,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,gDAAgD;IAChD,IAAI,6BAA6B,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAErE,iBAAiB;IACjB,IAAI,mCAAmC,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1E,IAAI,qEAAqE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACnF,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,0EAA0E;IAC1E,+CAA+C;IAC/C,OAAO,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -25,6 +25,20 @@ export type EffortLevel = (typeof EFFORT_LEVELS)[number];
|
|
|
25
25
|
export declare function modelSupportsEffort(modelId: string): boolean;
|
|
26
26
|
/** Whether a value is a valid effort level. */
|
|
27
27
|
export declare function isEffortLevel(v: unknown): v is EffortLevel;
|
|
28
|
+
/**
|
|
29
|
+
* The `output_config.effort` to send to a Claude model, or undefined to omit
|
|
30
|
+
* it. Each model accepts its own ladder (Anthropic's model docs): Opus 4.5
|
|
31
|
+
* takes low, medium and high; Opus 4.6 and Sonnet 4.6 add max but not xhigh,
|
|
32
|
+
* which arrived with Opus 4.7; Opus 4.7 and later, Sonnet 5 and later, Fable
|
|
33
|
+
* and Mythos take all five. A level the model does not take is sent as
|
|
34
|
+
* `high` instead of returning 400. Matches bare and provider-prefixed ids,
|
|
35
|
+
* like {@link modelSupportsEffort}.
|
|
36
|
+
*
|
|
37
|
+
* @param modelId Anthropic-side model id.
|
|
38
|
+
* @param effort Caller-supplied effort value.
|
|
39
|
+
* @returns The level to send, or undefined for an unsupported model or value.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveAnthropicEffort(modelId: string, effort: unknown): EffortLevel | undefined;
|
|
28
42
|
export declare function mapEffortToOpenAiReasoningEffort(effort: unknown): string | undefined;
|
|
29
43
|
/**
|
|
30
44
|
* Whether an OpenAI model accepts `reasoning.effort: 'xhigh'` on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-effort.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,uFAAuF;AACvF,eAAO,MAAM,aAAa,oDAAqD,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,WAAW,CAE1D;AAmBD,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzE;AA6BD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,GACd,MAAM,GAAG,SAAS,CAKpB;AA8BD;;;;GAIG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAUpB"}
|
|
1
|
+
{"version":3,"file":"model-effort.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,uFAAuF;AACvF,eAAO,MAAM,aAAa,oDAAqD,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,WAAW,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAKhG;AAmBD,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzE;AA6BD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,GACd,MAAM,GAAG,SAAS,CAKpB;AA8BD;;;;GAIG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAUpB"}
|
|
@@ -28,6 +28,28 @@ export function modelSupportsEffort(modelId) {
|
|
|
28
28
|
export function isEffortLevel(v) {
|
|
29
29
|
return typeof v === 'string' && EFFORT_LEVELS.includes(v);
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* The `output_config.effort` to send to a Claude model, or undefined to omit
|
|
33
|
+
* it. Each model accepts its own ladder (Anthropic's model docs): Opus 4.5
|
|
34
|
+
* takes low, medium and high; Opus 4.6 and Sonnet 4.6 add max but not xhigh,
|
|
35
|
+
* which arrived with Opus 4.7; Opus 4.7 and later, Sonnet 5 and later, Fable
|
|
36
|
+
* and Mythos take all five. A level the model does not take is sent as
|
|
37
|
+
* `high` instead of returning 400. Matches bare and provider-prefixed ids,
|
|
38
|
+
* like {@link modelSupportsEffort}.
|
|
39
|
+
*
|
|
40
|
+
* @param modelId Anthropic-side model id.
|
|
41
|
+
* @param effort Caller-supplied effort value.
|
|
42
|
+
* @returns The level to send, or undefined for an unsupported model or value.
|
|
43
|
+
*/
|
|
44
|
+
export function resolveAnthropicEffort(modelId, effort) {
|
|
45
|
+
if (!isEffortLevel(effort) || !modelSupportsEffort(modelId))
|
|
46
|
+
return undefined;
|
|
47
|
+
if (/claude-opus-4-5/i.test(modelId) && (effort === 'xhigh' || effort === 'max'))
|
|
48
|
+
return 'high';
|
|
49
|
+
if (/claude-(opus|sonnet)-4-6/i.test(modelId) && effort === 'xhigh')
|
|
50
|
+
return 'high';
|
|
51
|
+
return effort;
|
|
52
|
+
}
|
|
31
53
|
/**
|
|
32
54
|
* OpenAI reasoning models (o-series, GPT-5 and GPT-6 families) take
|
|
33
55
|
* `reasoning_effort` (none|low|medium|high|xhigh) — the OpenAI analogue of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-effort.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,uFAAuF;AACvF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAGhF;;;;;;;;G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EACf,MAAe;IAEf,IAAI,MAAM,KAAK,KAAK,IAAI,8BAA8B,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9E,MAAM,IAAI,GAAG,gCAAgC,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,OAAO,IAAI,KAAK,OAAO,IAAI,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,sBAAsB,GAAsB,EAAE,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,wCAAwC,CACtD,MAAe,EACf,OAAe;IAEf,MAAM,IAAI,GAAG,gCAAgC,CAAC,MAAM,CAAC,CAAC;IACtD,IACE,MAAM,KAAK,KAAK;WACb,IAAI,KAAK,OAAO;WAChB,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAC1E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* Anthropic structured output and `toolChoice: 'required'` both resolve to a
|
|
6
6
|
* FORCED `tool_choice` on the Messages API (`{ type: 'tool', name }` or
|
|
7
7
|
* `{ type: 'any' }`). Most Claude models accept this, and it is the most
|
|
8
|
-
* reliable way to constrain output. Claude Fable 5 / 5.1
|
|
9
|
-
* reject a forced `tool_choice` at the
|
|
10
|
-
*
|
|
8
|
+
* reliable way to constrain output. Claude Fable 5 / 5.1, Claude Mythos 5.1,
|
|
9
|
+
* Claude Opus 5.5 and Claude Sonnet 5.5 reject a forced `tool_choice` at the
|
|
10
|
+
* API level with a 400. Those models can still call tools under
|
|
11
|
+
* `{ type: 'auto' }`; they only refuse to be forced.
|
|
11
12
|
*
|
|
12
13
|
* Two consumers read this:
|
|
13
14
|
* - {@link AnthropicProvider} clamps any resolved forced `tool_choice` to
|
|
@@ -26,22 +27,28 @@
|
|
|
26
27
|
* Whether Anthropic will accept a forced `tool_choice` (`{ type: 'tool' }` or
|
|
27
28
|
* `{ type: 'any' }`) for the given Claude model id.
|
|
28
29
|
*
|
|
29
|
-
* Deny-by-explicit-model.
|
|
30
|
-
* current Claude model (Sonnet, Opus 5 and earlier,
|
|
30
|
+
* Deny-by-explicit-model. These models reject forced tool use, and every
|
|
31
|
+
* other current Claude model (Sonnet 5 and earlier, Opus 5 and earlier,
|
|
32
|
+
* Haiku) accepts it:
|
|
31
33
|
*
|
|
32
34
|
* - Claude Fable 5 and 5.1, including dated variants such as
|
|
33
35
|
* `claude-fable-5-20260601`. The `fable-5` alternative also matches
|
|
34
36
|
* `claude-fable-5-1` because `\b` matches at the hyphen, which is intended
|
|
35
37
|
* since 5.1 is the same family under the same constraint.
|
|
38
|
+
* - Claude Mythos 5.1 (`claude-mythos-5-1`), per Anthropic's model docs.
|
|
36
39
|
* - Claude Opus 5.5 (`claude-opus-5-5`). Claude Opus 5 accepts forced tool
|
|
37
40
|
* use, so the pattern names the full `opus-5-5` id. A bare `opus-5` prefix
|
|
38
41
|
* would deny Opus 5 as well.
|
|
42
|
+
* - Claude Sonnet 5.5 (`claude-sonnet-5-5`). Claude Sonnet 5 accepts forced
|
|
43
|
+
* tool use, so the pattern names the full `sonnet-5-5` id for the same
|
|
44
|
+
* reason.
|
|
39
45
|
*
|
|
40
46
|
* Live-probed 2026-09-29 on the Messages API. `{type:'tool'}` and
|
|
41
47
|
* `{type:'any'}` both return HTTP 400 on `claude-opus-5-5` and
|
|
42
48
|
* `claude-fable-5-1`, with the message `tool_choice: type "tool" and "any" are
|
|
43
49
|
* not supported for this model.` The same two requests return 200 on
|
|
44
|
-
* `claude-opus-5`.
|
|
50
|
+
* `claude-opus-5`. Both return HTTP 400 on `claude-sonnet-5-5` (probed
|
|
51
|
+
* 2026-09-30).
|
|
45
52
|
*
|
|
46
53
|
* `AnthropicProvider` clamps an unsupported forced choice to `{ type: 'auto' }`
|
|
47
54
|
* and logs a warning. An extra entry here therefore costs guaranteed tool
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-forced-tool-choice.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-forced-tool-choice.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"model-forced-tool-choice.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-forced-tool-choice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE"}
|