@mastra/core 0.20.2 → 0.21.0-alpha.1
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/CHANGELOG.md +93 -0
- package/README.md +30 -121
- package/dist/agent/agent.d.ts +5 -10
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.types.d.ts +12 -14
- package/dist/agent/agent.types.d.ts.map +1 -1
- package/dist/agent/index.cjs +19 -11
- package/dist/agent/index.d.ts +2 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/input-processor/index.cjs +6 -6
- package/dist/agent/input-processor/index.js +1 -1
- package/dist/agent/message-list/index.d.ts +4 -4
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts +1 -1
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
- package/dist/agent/message-list/prompt/convert-file.d.ts +2 -2
- package/dist/agent/message-list/prompt/convert-file.d.ts.map +1 -1
- package/dist/agent/message-list/types.d.ts +2 -2
- package/dist/agent/message-list/types.d.ts.map +1 -1
- package/dist/agent/message-list/utils/convert-messages.d.ts +2 -2
- package/dist/agent/types.d.ts +13 -5
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/utils.d.ts +110 -0
- package/dist/agent/utils.d.ts.map +1 -0
- package/dist/agent/workflows/prepare-stream/index.d.ts +2 -2
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +2 -2
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +1 -2
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/schema.d.ts +2 -2
- package/dist/ai-tracing/index.cjs +32 -32
- package/dist/ai-tracing/index.js +1 -1
- package/dist/ai-tracing/spans/base.d.ts +2 -0
- package/dist/ai-tracing/spans/base.d.ts.map +1 -1
- package/dist/ai-tracing/types.d.ts +24 -0
- package/dist/ai-tracing/types.d.ts.map +1 -1
- package/dist/{chunk-BWC4WQTS.js → chunk-24L3LVID.js} +21 -14
- package/dist/chunk-24L3LVID.js.map +1 -0
- package/dist/{chunk-7ZXDZXGD.cjs → chunk-2BTTHMDJ.cjs} +14 -2
- package/dist/chunk-2BTTHMDJ.cjs.map +1 -0
- package/dist/{chunk-KK5LUATU.js → chunk-2VSJYKJF.js} +4 -4
- package/dist/{chunk-KK5LUATU.js.map → chunk-2VSJYKJF.js.map} +1 -1
- package/dist/chunk-33JJWAVI.js +2077 -0
- package/dist/chunk-33JJWAVI.js.map +1 -0
- package/dist/chunk-3ZEJSGTJ.cjs +9289 -0
- package/dist/chunk-3ZEJSGTJ.cjs.map +1 -0
- package/dist/{chunk-6ZSVXXMJ.js → chunk-624FF2ZG.js} +14 -2
- package/dist/chunk-624FF2ZG.js.map +1 -0
- package/dist/{chunk-2QV245Q5.cjs → chunk-6OJROHMC.cjs} +25 -18
- package/dist/chunk-6OJROHMC.cjs.map +1 -0
- package/dist/{chunk-T5SM2HLV.cjs → chunk-74P72XBM.cjs} +4 -4
- package/dist/chunk-74P72XBM.cjs.map +1 -0
- package/dist/chunk-75CDUY5G.js +158 -0
- package/dist/chunk-75CDUY5G.js.map +1 -0
- package/dist/chunk-BLPOOPRL.js +3164 -0
- package/dist/chunk-BLPOOPRL.js.map +1 -0
- package/dist/{chunk-JZ5MQXUL.cjs → chunk-DUMAWQ7I.cjs} +4 -4
- package/dist/{chunk-JZ5MQXUL.cjs.map → chunk-DUMAWQ7I.cjs.map} +1 -1
- package/dist/chunk-EQV7XSTY.cjs +2090 -0
- package/dist/chunk-EQV7XSTY.cjs.map +1 -0
- package/dist/chunk-ILZI4MEU.js +9263 -0
- package/dist/chunk-ILZI4MEU.js.map +1 -0
- package/dist/{chunk-4PRV2Y55.cjs → chunk-LOUJSR3F.cjs} +5 -5
- package/dist/{chunk-4PRV2Y55.cjs.map → chunk-LOUJSR3F.cjs.map} +1 -1
- package/dist/{chunk-M2MHQQGJ.js → chunk-ONHTH5RH.js} +4 -4
- package/dist/chunk-ONHTH5RH.js.map +1 -0
- package/dist/{chunk-YBC4V5GE.js → chunk-PPW3SAWO.js} +5 -9
- package/dist/{chunk-YBC4V5GE.js.map → chunk-PPW3SAWO.js.map} +1 -1
- package/dist/{chunk-DBYLVMIV.js → chunk-Q4YVANA4.js} +25 -7
- package/dist/chunk-Q4YVANA4.js.map +1 -0
- package/dist/chunk-QMKBXESK.cjs +3186 -0
- package/dist/chunk-QMKBXESK.cjs.map +1 -0
- package/dist/{chunk-EB2KTBHB.js → chunk-R3W5CNKP.js} +100 -82
- package/dist/chunk-R3W5CNKP.js.map +1 -0
- package/dist/{chunk-ECMIW6W2.cjs → chunk-RXGL66T6.cjs} +134 -111
- package/dist/chunk-RXGL66T6.cjs.map +1 -0
- package/dist/{chunk-PPCSJI73.cjs → chunk-SL534RIL.cjs} +33 -14
- package/dist/chunk-SL534RIL.cjs.map +1 -0
- package/dist/{chunk-YICS4NNU.cjs → chunk-SQXKJWFX.cjs} +12 -12
- package/dist/{chunk-YICS4NNU.cjs.map → chunk-SQXKJWFX.cjs.map} +1 -1
- package/dist/{chunk-X5SB7NR3.cjs → chunk-SSDFGDFJ.cjs} +9 -10
- package/dist/chunk-SSDFGDFJ.cjs.map +1 -0
- package/dist/{chunk-OC7MSESV.cjs → chunk-TTJM3STK.cjs} +7 -11
- package/dist/{chunk-OC7MSESV.cjs.map → chunk-TTJM3STK.cjs.map} +1 -1
- package/dist/{chunk-RE7SRMBE.cjs → chunk-UPRLKS2E.cjs} +16 -16
- package/dist/chunk-UPRLKS2E.cjs.map +1 -0
- package/dist/{chunk-7H72OAZ3.js → chunk-UQCUAYWV.js} +3 -3
- package/dist/{chunk-7H72OAZ3.js.map → chunk-UQCUAYWV.js.map} +1 -1
- package/dist/{chunk-SWNIMD7I.js → chunk-XL5MZTLP.js} +3 -3
- package/dist/chunk-XL5MZTLP.js.map +1 -0
- package/dist/{chunk-HTX7EHW5.js → chunk-XQ5A3ISB.js} +3 -3
- package/dist/{chunk-HTX7EHW5.js.map → chunk-XQ5A3ISB.js.map} +1 -1
- package/dist/chunk-Y2PKC5BX.cjs +160 -0
- package/dist/chunk-Y2PKC5BX.cjs.map +1 -0
- package/dist/{chunk-VSTMNPZJ.js → chunk-YUV3LZMY.js} +7 -8
- package/dist/chunk-YUV3LZMY.js.map +1 -0
- package/dist/index.cjs +53 -49
- package/dist/index.js +10 -10
- package/dist/llm/index.cjs +9 -5
- package/dist/llm/index.d.ts +4 -3
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +1 -1
- package/dist/llm/model/base.types.d.ts +2 -2
- package/dist/llm/model/base.types.d.ts.map +1 -1
- package/dist/llm/model/gateways/base.d.ts +1 -1
- package/dist/llm/model/gateways/base.d.ts.map +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts +1 -1
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/llm/model/gateways/netlify.d.ts +1 -1
- package/dist/llm/model/gateways/netlify.d.ts.map +1 -1
- package/dist/llm/model/index.d.ts +2 -1
- package/dist/llm/model/index.d.ts.map +1 -1
- package/dist/llm/model/model.d.ts +2 -2
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +3 -3
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/model.loop.types.d.ts +2 -3
- package/dist/llm/model/model.loop.types.d.ts.map +1 -1
- package/dist/llm/model/provider-registry.d.ts +98 -0
- package/dist/llm/model/provider-registry.d.ts.map +1 -0
- package/dist/llm/model/provider-types.generated.d.ts +679 -0
- package/dist/llm/model/registry-generator.d.ts +29 -0
- package/dist/llm/model/registry-generator.d.ts.map +1 -0
- package/dist/llm/model/resolve-model.d.ts +46 -0
- package/dist/llm/model/resolve-model.d.ts.map +1 -0
- package/dist/llm/model/router.d.ts +2 -2
- package/dist/llm/model/router.d.ts.map +1 -1
- package/dist/llm/model/shared.types.d.ts +10 -4
- package/dist/llm/model/shared.types.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/loop.d.ts +1 -1
- package/dist/loop/loop.d.ts.map +1 -1
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/telemetry/index.d.ts +1 -1
- package/dist/loop/telemetry/index.d.ts.map +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/test-utils/streamObject.d.ts +1 -1
- package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
- package/dist/loop/test-utils/utils.d.ts +2 -2
- package/dist/loop/test-utils/utils.d.ts.map +1 -1
- package/dist/loop/types.d.ts +4 -3
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +73 -73
- package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +50 -50
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +25 -25
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +73 -73
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
- package/dist/loop/workflows/run-state.d.ts +1 -1
- package/dist/loop/workflows/run-state.d.ts.map +1 -1
- package/dist/loop/workflows/schema.d.ts +33 -33
- package/dist/loop/workflows/schema.d.ts.map +1 -1
- package/dist/loop/workflows/stream.d.ts +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/hooks.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +3 -3
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/types.d.ts +3 -3
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/models-dev-A334FF64.js +3 -0
- package/dist/models-dev-A334FF64.js.map +1 -0
- package/dist/models-dev-ECOIQLLK.cjs +12 -0
- package/dist/models-dev-ECOIQLLK.cjs.map +1 -0
- package/dist/netlify-CEYZ5O54.js +3 -0
- package/dist/netlify-CEYZ5O54.js.map +1 -0
- package/dist/netlify-WFAL2AA4.cjs +12 -0
- package/dist/netlify-WFAL2AA4.cjs.map +1 -0
- package/dist/processors/index.cjs +11 -11
- package/dist/processors/index.js +1 -1
- package/dist/processors/processors/language-detector.d.ts +2 -0
- package/dist/processors/processors/language-detector.d.ts.map +1 -1
- package/dist/processors/processors/moderation.d.ts +6 -3
- package/dist/processors/processors/moderation.d.ts.map +1 -1
- package/dist/processors/processors/pii-detector.d.ts +8 -4
- package/dist/processors/processors/pii-detector.d.ts.map +1 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
- package/dist/processors/processors/structured-output.d.ts +4 -2
- package/dist/processors/processors/structured-output.d.ts.map +1 -1
- package/dist/processors/processors/system-prompt-scrubber.d.ts +2 -1
- package/dist/processors/processors/system-prompt-scrubber.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +8 -2
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/provider-registry.json +1625 -0
- package/dist/registry-generator-7XDUEFUT.cjs +111 -0
- package/dist/registry-generator-7XDUEFUT.cjs.map +1 -0
- package/dist/registry-generator-ZKIT6I3E.js +103 -0
- package/dist/registry-generator-ZKIT6I3E.js.map +1 -0
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.js +1 -1
- package/dist/relevance/mastra-agent/index.d.ts +2 -2
- package/dist/relevance/mastra-agent/index.d.ts.map +1 -1
- package/dist/scores/base.d.ts +6 -6
- package/dist/scores/base.d.ts.map +1 -1
- package/dist/scores/index.cjs +9 -9
- package/dist/scores/index.js +2 -2
- package/dist/scores/run-experiment/index.d.ts +1 -1
- package/dist/scores/run-experiment/index.d.ts.map +1 -1
- package/dist/scores/scoreTraces/index.cjs +10 -10
- package/dist/scores/scoreTraces/index.cjs.map +1 -1
- package/dist/scores/scoreTraces/index.js +5 -5
- package/dist/scores/scoreTraces/index.js.map +1 -1
- package/dist/scores/types.d.ts +1 -1
- package/dist/scores/types.d.ts.map +1 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/stream/aisdk/v4/input.d.ts +1 -1
- package/dist/stream/aisdk/v4/input.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/compat/content.d.ts +2 -2
- package/dist/stream/aisdk/v5/compat/content.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts +2 -2
- package/dist/stream/aisdk/v5/compat/prepare-tools.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/compat/ui-message.d.ts +1 -1
- package/dist/stream/aisdk/v5/compat/ui-message.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/compat/validation.d.ts +1 -1
- package/dist/stream/aisdk/v5/compat/validation.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +5 -4
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/input.d.ts +1 -1
- package/dist/stream/aisdk/v5/input.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output-helpers.d.ts +9 -9
- package/dist/stream/aisdk/v5/output-helpers.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output.d.ts +40 -39
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/test-utils.d.ts +1 -1
- package/dist/stream/aisdk/v5/test-utils.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts +2 -2
- package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
- package/dist/stream/base/input.d.ts +1 -1
- package/dist/stream/base/input.d.ts.map +1 -1
- package/dist/stream/base/output-format-handlers.d.ts +5 -2
- package/dist/stream/base/output-format-handlers.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts +31 -25
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/base/schema.d.ts +1 -1
- package/dist/stream/base/schema.d.ts.map +1 -1
- package/dist/stream/index.cjs +13 -9
- package/dist/stream/index.d.ts +1 -0
- package/dist/stream/index.d.ts.map +1 -1
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +19 -6
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +6 -6
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.d.ts +1 -1
- package/dist/test-utils/llm-mock.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.js +3 -3
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/tools/types.d.ts +2 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/utils.cjs +17 -17
- package/dist/utils.d.ts +3 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vector/embed.d.ts +2 -2
- package/dist/vector/embed.d.ts.map +1 -1
- package/dist/vector/index.cjs +4 -4
- package/dist/vector/index.js +1 -1
- package/dist/vector/vector.d.ts +2 -2
- package/dist/vector/vector.d.ts.map +1 -1
- package/dist/workflows/default.d.ts +2 -2
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +1 -1
- package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/execution-engine.d.ts +1 -1
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/index.cjs +12 -12
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/legacy/index.cjs +22 -22
- package/dist/workflows/legacy/index.js +1 -1
- package/dist/workflows/legacy/machine.d.ts +1 -1
- package/dist/workflows/legacy/workflow.d.ts +1 -1
- package/dist/workflows/step.d.ts +1 -1
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +1 -1
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +25 -8
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +24 -19
- package/src/llm/model/provider-types.generated.d.ts +679 -0
- package/dist/chunk-2QV245Q5.cjs.map +0 -1
- package/dist/chunk-6ZSVXXMJ.js.map +0 -1
- package/dist/chunk-7ZXDZXGD.cjs.map +0 -1
- package/dist/chunk-BWC4WQTS.js.map +0 -1
- package/dist/chunk-BZ6BIHLE.js +0 -1418
- package/dist/chunk-BZ6BIHLE.js.map +0 -1
- package/dist/chunk-DBYLVMIV.js.map +0 -1
- package/dist/chunk-EB2KTBHB.js.map +0 -1
- package/dist/chunk-ECMIW6W2.cjs.map +0 -1
- package/dist/chunk-M2MHQQGJ.js.map +0 -1
- package/dist/chunk-PPCSJI73.cjs.map +0 -1
- package/dist/chunk-RE7SRMBE.cjs.map +0 -1
- package/dist/chunk-REVAU76X.cjs +0 -1423
- package/dist/chunk-REVAU76X.cjs.map +0 -1
- package/dist/chunk-SWNIMD7I.js.map +0 -1
- package/dist/chunk-T5SM2HLV.cjs.map +0 -1
- package/dist/chunk-VSTMNPZJ.js.map +0 -1
- package/dist/chunk-X5SB7NR3.cjs.map +0 -1
- package/dist/llm/model/provider-registry.generated.d.ts +0 -99
- package/dist/llm/model/provider-registry.generated.d.ts.map +0 -1
- package/dist/stream/aisdk/v5/model-supports.d.ts +0 -25
- package/dist/stream/aisdk/v5/model-supports.d.ts.map +0 -1
package/dist/chunk-BZ6BIHLE.js
DELETED
|
@@ -1,1418 +0,0 @@
|
|
|
1
|
-
import { InMemoryServerCache } from './chunk-EQV2PPN2.js';
|
|
2
|
-
import { MastraError } from './chunk-T3JFFQH2.js';
|
|
3
|
-
import { createHash } from 'crypto';
|
|
4
|
-
import { createAnthropic } from '@ai-sdk/anthropic-v5';
|
|
5
|
-
import { createGoogleGenerativeAI } from '@ai-sdk/google-v5';
|
|
6
|
-
import { createOpenAICompatible } from '@ai-sdk/openai-compatible-v5';
|
|
7
|
-
import { createOpenAI } from '@ai-sdk/openai-v5';
|
|
8
|
-
import { createXai } from '@ai-sdk/xai-v5';
|
|
9
|
-
import { createOpenRouter } from '@openrouter/ai-sdk-provider-v5';
|
|
10
|
-
|
|
11
|
-
// src/llm/model/gateway-resolver.ts
|
|
12
|
-
function parseModelRouterId(routerId, gatewayPrefix) {
|
|
13
|
-
if (gatewayPrefix && !routerId.startsWith(`${gatewayPrefix}/`)) {
|
|
14
|
-
throw new Error(`Expected ${gatewayPrefix}/ in model router ID ${routerId}`);
|
|
15
|
-
}
|
|
16
|
-
const idParts = routerId.split("/");
|
|
17
|
-
if (gatewayPrefix && idParts.length < 3) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
`Expected atleast 3 id parts ${gatewayPrefix}/provider/model, but only saw ${idParts.length} in ${routerId}`
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
const providerId = idParts.at(gatewayPrefix ? 1 : 0);
|
|
23
|
-
const modelId = idParts.slice(gatewayPrefix ? 2 : 1).join(`/`);
|
|
24
|
-
if (!routerId.includes(`/`) || !providerId || !modelId) {
|
|
25
|
-
throw new Error(
|
|
26
|
-
`Attempted to parse provider/model from ${routerId} but this ID doesn't appear to contain a provider`
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
providerId,
|
|
31
|
-
modelId
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// src/llm/model/gateways/base.ts
|
|
36
|
-
var MastraModelGateway = class {
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// src/llm/model/gateways/constants.ts
|
|
40
|
-
var PROVIDERS_WITH_INSTALLED_PACKAGES = ["anthropic", "google", "openai", "openrouter", "xai"];
|
|
41
|
-
var EXCLUDED_PROVIDERS = ["github-copilot"];
|
|
42
|
-
|
|
43
|
-
// src/llm/model/gateways/models-dev.ts
|
|
44
|
-
var OPENAI_COMPATIBLE_OVERRIDES = {
|
|
45
|
-
cerebras: {
|
|
46
|
-
url: "https://api.cerebras.ai/v1"
|
|
47
|
-
},
|
|
48
|
-
mistral: {
|
|
49
|
-
url: "https://api.mistral.ai/v1"
|
|
50
|
-
},
|
|
51
|
-
groq: {
|
|
52
|
-
url: "https://api.groq.com/openai/v1"
|
|
53
|
-
},
|
|
54
|
-
togetherai: {
|
|
55
|
-
url: "https://api.together.xyz/v1"
|
|
56
|
-
},
|
|
57
|
-
deepinfra: {
|
|
58
|
-
url: "https://api.deepinfra.com/v1/openai"
|
|
59
|
-
},
|
|
60
|
-
perplexity: {
|
|
61
|
-
url: "https://api.perplexity.ai"
|
|
62
|
-
},
|
|
63
|
-
vercel: {
|
|
64
|
-
url: "https://ai-gateway.vercel.sh/v1",
|
|
65
|
-
apiKeyEnvVar: "AI_GATEWAY_API_KEY"
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var ModelsDevGateway = class extends MastraModelGateway {
|
|
69
|
-
name = "models.dev";
|
|
70
|
-
prefix = void 0;
|
|
71
|
-
// No prefix for registry gateway
|
|
72
|
-
providerConfigs = {};
|
|
73
|
-
constructor(providerConfigs) {
|
|
74
|
-
super();
|
|
75
|
-
if (providerConfigs) this.providerConfigs = providerConfigs;
|
|
76
|
-
}
|
|
77
|
-
async fetchProviders() {
|
|
78
|
-
console.info("Fetching providers from models.dev API...");
|
|
79
|
-
const response = await fetch("https://models.dev/api.json");
|
|
80
|
-
if (!response.ok) {
|
|
81
|
-
throw new Error(`Failed to fetch from models.dev: ${response.statusText}`);
|
|
82
|
-
}
|
|
83
|
-
const data = await response.json();
|
|
84
|
-
const providerConfigs = {};
|
|
85
|
-
for (const [providerId, providerInfo] of Object.entries(data)) {
|
|
86
|
-
if (EXCLUDED_PROVIDERS.includes(providerId)) continue;
|
|
87
|
-
if (!providerInfo || typeof providerInfo !== "object" || !providerInfo.models) continue;
|
|
88
|
-
const normalizedId = providerId;
|
|
89
|
-
const isOpenAICompatible = providerInfo.npm === "@ai-sdk/openai-compatible" || providerInfo.npm === "@ai-sdk/gateway" || // Vercel AI Gateway is OpenAI-compatible
|
|
90
|
-
normalizedId in OPENAI_COMPATIBLE_OVERRIDES;
|
|
91
|
-
const hasInstalledPackage = PROVIDERS_WITH_INSTALLED_PACKAGES.includes(providerId);
|
|
92
|
-
const hasApiAndEnv = providerInfo.api && providerInfo.env && providerInfo.env.length > 0;
|
|
93
|
-
if (isOpenAICompatible || hasInstalledPackage || hasApiAndEnv) {
|
|
94
|
-
const modelIds = Object.keys(providerInfo.models).sort();
|
|
95
|
-
const url = providerInfo.api || OPENAI_COMPATIBLE_OVERRIDES[normalizedId]?.url;
|
|
96
|
-
if (!hasInstalledPackage && !url) {
|
|
97
|
-
console.info(`Skipping ${normalizedId}: No API URL available`);
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
const apiKeyEnvVar = providerInfo.env?.[0] || `${normalizedId.toUpperCase().replace(/-/g, "_")}_API_KEY`;
|
|
101
|
-
const apiKeyHeader = !hasInstalledPackage ? OPENAI_COMPATIBLE_OVERRIDES[normalizedId]?.apiKeyHeader || "Authorization" : void 0;
|
|
102
|
-
providerConfigs[normalizedId] = {
|
|
103
|
-
url,
|
|
104
|
-
apiKeyEnvVar,
|
|
105
|
-
apiKeyHeader,
|
|
106
|
-
name: providerInfo.name || providerId.charAt(0).toUpperCase() + providerId.slice(1),
|
|
107
|
-
models: modelIds,
|
|
108
|
-
docUrl: providerInfo.doc,
|
|
109
|
-
// Include documentation URL if available
|
|
110
|
-
gateway: `models.dev`
|
|
111
|
-
};
|
|
112
|
-
} else {
|
|
113
|
-
console.info(`Skipped provider ${providerInfo.name}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
this.providerConfigs = providerConfigs;
|
|
117
|
-
console.info(`Found ${Object.keys(providerConfigs).length} OpenAI-compatible providers`);
|
|
118
|
-
console.info("Providers:", Object.keys(providerConfigs).sort());
|
|
119
|
-
return providerConfigs;
|
|
120
|
-
}
|
|
121
|
-
buildUrl(routerId, envVars) {
|
|
122
|
-
const { providerId } = parseModelRouterId(routerId);
|
|
123
|
-
const config = this.providerConfigs[providerId];
|
|
124
|
-
if (!config?.url) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
const baseUrlEnvVar = `${providerId.toUpperCase().replace(/-/g, "_")}_BASE_URL`;
|
|
128
|
-
const customBaseUrl = envVars?.[baseUrlEnvVar] || process.env[baseUrlEnvVar];
|
|
129
|
-
return customBaseUrl || config.url;
|
|
130
|
-
}
|
|
131
|
-
getApiKey(modelId) {
|
|
132
|
-
const [provider, model] = modelId.split("/");
|
|
133
|
-
if (!provider || !model) {
|
|
134
|
-
throw new Error(`Could not identify provider from model id ${modelId}`);
|
|
135
|
-
}
|
|
136
|
-
const config = this.providerConfigs[provider];
|
|
137
|
-
if (!config) {
|
|
138
|
-
throw new Error(`Could not find config for provider ${provider} with model id ${modelId}`);
|
|
139
|
-
}
|
|
140
|
-
const apiKey = typeof config.apiKeyEnvVar === `string` ? process.env[config.apiKeyEnvVar] : void 0;
|
|
141
|
-
if (!apiKey) {
|
|
142
|
-
throw new Error(`Could not find API key process.env.${config.apiKeyEnvVar} for model id ${modelId}`);
|
|
143
|
-
}
|
|
144
|
-
return Promise.resolve(apiKey);
|
|
145
|
-
}
|
|
146
|
-
async resolveLanguageModel({
|
|
147
|
-
modelId,
|
|
148
|
-
providerId,
|
|
149
|
-
apiKey
|
|
150
|
-
}) {
|
|
151
|
-
const baseURL = this.buildUrl(`${providerId}/${modelId}`);
|
|
152
|
-
switch (providerId) {
|
|
153
|
-
case "openai":
|
|
154
|
-
return createOpenAI({ apiKey }).responses(modelId);
|
|
155
|
-
case "gemini":
|
|
156
|
-
case "google":
|
|
157
|
-
return createGoogleGenerativeAI({
|
|
158
|
-
apiKey
|
|
159
|
-
}).chat(modelId);
|
|
160
|
-
case "anthropic":
|
|
161
|
-
return createAnthropic({ apiKey })(modelId);
|
|
162
|
-
case "openrouter":
|
|
163
|
-
return createOpenRouter({ apiKey })(modelId);
|
|
164
|
-
case "xai":
|
|
165
|
-
return createXai({
|
|
166
|
-
apiKey
|
|
167
|
-
})(modelId);
|
|
168
|
-
default:
|
|
169
|
-
if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);
|
|
170
|
-
return createOpenAICompatible({ name: providerId, apiKey, baseURL }).chatModel(modelId);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
var NetlifyGateway = class extends MastraModelGateway {
|
|
175
|
-
name = "netlify";
|
|
176
|
-
prefix = "netlify";
|
|
177
|
-
// All providers will be prefixed with "netlify/"
|
|
178
|
-
tokenCache = new InMemoryServerCache();
|
|
179
|
-
async fetchProviders() {
|
|
180
|
-
console.info("Fetching providers from Netlify AI Gateway...");
|
|
181
|
-
const response = await fetch("https://api.netlify.com/api/v1/ai-gateway/providers");
|
|
182
|
-
if (!response.ok) {
|
|
183
|
-
throw new Error(`Failed to fetch from Netlify: ${response.statusText}`);
|
|
184
|
-
}
|
|
185
|
-
const data = await response.json();
|
|
186
|
-
const netlify = {
|
|
187
|
-
apiKeyEnvVar: ["NETLIFY_TOKEN", "NETLIFY_SITE_ID"],
|
|
188
|
-
apiKeyHeader: "Authorization",
|
|
189
|
-
// Netlify uses standard Bearer auth
|
|
190
|
-
name: `Netlify`,
|
|
191
|
-
gateway: `netlify`,
|
|
192
|
-
models: [],
|
|
193
|
-
docUrl: "https://docs.netlify.com/build/ai-gateway/overview/"
|
|
194
|
-
};
|
|
195
|
-
for (const [providerId, provider] of Object.entries(data.providers)) {
|
|
196
|
-
for (const model of provider.models) {
|
|
197
|
-
netlify.models.push(`${providerId}/${model}`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
console.info(`Found ${Object.keys(data.providers).length} models via Netlify Gateway`);
|
|
201
|
-
return { netlify };
|
|
202
|
-
}
|
|
203
|
-
async buildUrl(routerId, envVars) {
|
|
204
|
-
const siteId = envVars?.["NETLIFY_SITE_ID"] || process.env["NETLIFY_SITE_ID"];
|
|
205
|
-
const netlifyToken = envVars?.["NETLIFY_TOKEN"] || process.env["NETLIFY_TOKEN"];
|
|
206
|
-
if (!netlifyToken) {
|
|
207
|
-
throw new MastraError({
|
|
208
|
-
id: "NETLIFY_GATEWAY_NO_TOKEN",
|
|
209
|
-
domain: "LLM",
|
|
210
|
-
category: "UNKNOWN",
|
|
211
|
-
text: `Missing NETLIFY_TOKEN environment variable required for model: ${routerId}`
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
if (!siteId) {
|
|
215
|
-
throw new MastraError({
|
|
216
|
-
id: "NETLIFY_GATEWAY_NO_SITE_ID",
|
|
217
|
-
domain: "LLM",
|
|
218
|
-
category: "UNKNOWN",
|
|
219
|
-
text: `Missing NETLIFY_SITE_ID environment variable required for model: ${routerId}`
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
try {
|
|
223
|
-
const tokenData = await this.getOrFetchToken(siteId, netlifyToken);
|
|
224
|
-
return tokenData.url.endsWith(`/`) ? tokenData.url.substring(0, tokenData.url.length - 1) : tokenData.url;
|
|
225
|
-
} catch (error) {
|
|
226
|
-
throw new MastraError({
|
|
227
|
-
id: "NETLIFY_GATEWAY_TOKEN_ERROR",
|
|
228
|
-
domain: "LLM",
|
|
229
|
-
category: "UNKNOWN",
|
|
230
|
-
text: `Failed to get Netlify AI Gateway token for model ${routerId}: ${error instanceof Error ? error.message : String(error)}`
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Get cached token or fetch a new site-specific AI Gateway token from Netlify
|
|
236
|
-
*/
|
|
237
|
-
async getOrFetchToken(siteId, netlifyToken) {
|
|
238
|
-
const cacheKey = `netlify-token:${siteId}:${netlifyToken}`;
|
|
239
|
-
const cached = await this.tokenCache.get(cacheKey);
|
|
240
|
-
if (cached && cached.expiresAt > Date.now() / 1e3 + 60) {
|
|
241
|
-
return { token: cached.token, url: cached.url };
|
|
242
|
-
}
|
|
243
|
-
const response = await fetch(`https://api.netlify.com/api/v1/sites/${siteId}/ai-gateway/token`, {
|
|
244
|
-
method: "GET",
|
|
245
|
-
headers: {
|
|
246
|
-
Authorization: `Bearer ${netlifyToken}`
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
if (!response.ok) {
|
|
250
|
-
const error = await response.text();
|
|
251
|
-
throw new Error(`Failed to get Netlify AI Gateway token: ${response.status} ${error}`);
|
|
252
|
-
}
|
|
253
|
-
const tokenResponse = await response.json();
|
|
254
|
-
await this.tokenCache.set(cacheKey, {
|
|
255
|
-
token: tokenResponse.token,
|
|
256
|
-
url: tokenResponse.url,
|
|
257
|
-
expiresAt: tokenResponse.expires_at
|
|
258
|
-
});
|
|
259
|
-
return { token: tokenResponse.token, url: tokenResponse.url };
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Get cached token or fetch a new site-specific AI Gateway token from Netlify
|
|
263
|
-
*/
|
|
264
|
-
async getApiKey(modelId) {
|
|
265
|
-
const siteId = process.env["NETLIFY_SITE_ID"];
|
|
266
|
-
const netlifyToken = process.env["NETLIFY_TOKEN"];
|
|
267
|
-
if (!netlifyToken) {
|
|
268
|
-
throw new MastraError({
|
|
269
|
-
id: "NETLIFY_GATEWAY_NO_TOKEN",
|
|
270
|
-
domain: "LLM",
|
|
271
|
-
category: "UNKNOWN",
|
|
272
|
-
text: `Missing NETLIFY_TOKEN environment variable required for model: ${modelId}`
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
if (!siteId) {
|
|
276
|
-
throw new MastraError({
|
|
277
|
-
id: "NETLIFY_GATEWAY_NO_SITE_ID",
|
|
278
|
-
domain: "LLM",
|
|
279
|
-
category: "UNKNOWN",
|
|
280
|
-
text: `Missing NETLIFY_SITE_ID environment variable required for model: ${modelId}`
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
try {
|
|
284
|
-
return (await this.getOrFetchToken(siteId, netlifyToken)).token;
|
|
285
|
-
} catch (error) {
|
|
286
|
-
throw new MastraError({
|
|
287
|
-
id: "NETLIFY_GATEWAY_TOKEN_ERROR",
|
|
288
|
-
domain: "LLM",
|
|
289
|
-
category: "UNKNOWN",
|
|
290
|
-
text: `Failed to get Netlify AI Gateway token for model ${modelId}: ${error instanceof Error ? error.message : String(error)}`
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
async resolveLanguageModel({
|
|
295
|
-
modelId,
|
|
296
|
-
providerId,
|
|
297
|
-
apiKey
|
|
298
|
-
}) {
|
|
299
|
-
const baseURL = await this.buildUrl(`${providerId}/${modelId}`);
|
|
300
|
-
switch (providerId) {
|
|
301
|
-
case "openai":
|
|
302
|
-
return createOpenAI({ apiKey, baseURL }).responses(modelId);
|
|
303
|
-
case "gemini":
|
|
304
|
-
return createGoogleGenerativeAI({
|
|
305
|
-
baseURL: `${baseURL}/v1beta/`,
|
|
306
|
-
apiKey,
|
|
307
|
-
headers: {
|
|
308
|
-
"user-agent": "google-genai-sdk/"
|
|
309
|
-
}
|
|
310
|
-
}).chat(modelId);
|
|
311
|
-
case "anthropic":
|
|
312
|
-
return createAnthropic({
|
|
313
|
-
apiKey,
|
|
314
|
-
baseURL: `${baseURL}/v1/`,
|
|
315
|
-
headers: {
|
|
316
|
-
"anthropic-version": "2023-06-01",
|
|
317
|
-
"user-agent": "anthropic/"
|
|
318
|
-
}
|
|
319
|
-
})(modelId);
|
|
320
|
-
default:
|
|
321
|
-
return createOpenAICompatible({ name: providerId, apiKey, baseURL }).chatModel(modelId);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
// src/llm/model/gateways/index.ts
|
|
327
|
-
function findGatewayForModel(gatewayId, gateways2) {
|
|
328
|
-
const prefixedGateway = gateways2.find((g) => g.prefix && gatewayId.startsWith(`${g.prefix}/`));
|
|
329
|
-
if (prefixedGateway) {
|
|
330
|
-
return prefixedGateway;
|
|
331
|
-
}
|
|
332
|
-
const unprefixedGateways = gateways2.filter((g) => !g.prefix);
|
|
333
|
-
for (const gateway of unprefixedGateways) {
|
|
334
|
-
return gateway;
|
|
335
|
-
}
|
|
336
|
-
throw new MastraError({
|
|
337
|
-
id: "MODEL_ROUTER_NO_GATEWAY_FOUND",
|
|
338
|
-
category: "USER",
|
|
339
|
-
domain: "MODEL_ROUTER",
|
|
340
|
-
text: `No Mastra model router gateway found for model id ${gatewayId}`
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// src/llm/model/provider-registry.generated.ts
|
|
345
|
-
var PROVIDER_REGISTRY = {
|
|
346
|
-
"moonshotai-cn": {
|
|
347
|
-
url: "https://api.moonshot.cn/v1",
|
|
348
|
-
apiKeyEnvVar: "MOONSHOT_API_KEY",
|
|
349
|
-
apiKeyHeader: "Authorization",
|
|
350
|
-
name: "Moonshot AI (China)",
|
|
351
|
-
models: ["kimi-k2-0711-preview", "kimi-k2-0905-preview", "kimi-k2-turbo-preview"],
|
|
352
|
-
docUrl: "https://platform.moonshot.cn/docs/api/chat",
|
|
353
|
-
gateway: "models.dev"
|
|
354
|
-
},
|
|
355
|
-
lucidquery: {
|
|
356
|
-
url: "https://lucidquery.com/api/v1",
|
|
357
|
-
apiKeyEnvVar: "LUCIDQUERY_API_KEY",
|
|
358
|
-
apiKeyHeader: "Authorization",
|
|
359
|
-
name: "LucidQuery AI",
|
|
360
|
-
models: ["lucidnova-rf1-100b", "lucidquery-nexus-coder"],
|
|
361
|
-
docUrl: "https://lucidquery.com/api/docs",
|
|
362
|
-
gateway: "models.dev"
|
|
363
|
-
},
|
|
364
|
-
moonshotai: {
|
|
365
|
-
url: "https://api.moonshot.ai/v1",
|
|
366
|
-
apiKeyEnvVar: "MOONSHOT_API_KEY",
|
|
367
|
-
apiKeyHeader: "Authorization",
|
|
368
|
-
name: "Moonshot AI",
|
|
369
|
-
models: ["kimi-k2-0711-preview", "kimi-k2-0905-preview", "kimi-k2-turbo-preview"],
|
|
370
|
-
docUrl: "https://platform.moonshot.ai/docs/api/chat",
|
|
371
|
-
gateway: "models.dev"
|
|
372
|
-
},
|
|
373
|
-
"zai-coding-plan": {
|
|
374
|
-
url: "https://api.z.ai/api/coding/paas/v4",
|
|
375
|
-
apiKeyEnvVar: "ZHIPU_API_KEY",
|
|
376
|
-
apiKeyHeader: "Authorization",
|
|
377
|
-
name: "Z.AI Coding Plan",
|
|
378
|
-
models: ["glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v", "glm-4.6"],
|
|
379
|
-
docUrl: "https://docs.z.ai/devpack/overview",
|
|
380
|
-
gateway: "models.dev"
|
|
381
|
-
},
|
|
382
|
-
alibaba: {
|
|
383
|
-
url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
384
|
-
apiKeyEnvVar: "DASHSCOPE_API_KEY",
|
|
385
|
-
apiKeyHeader: "Authorization",
|
|
386
|
-
name: "Alibaba",
|
|
387
|
-
models: ["qwen3-coder-plus"],
|
|
388
|
-
docUrl: "https://www.alibabacloud.com/help/en/model-studio/models",
|
|
389
|
-
gateway: "models.dev"
|
|
390
|
-
},
|
|
391
|
-
xai: {
|
|
392
|
-
apiKeyEnvVar: "XAI_API_KEY",
|
|
393
|
-
name: "xAI",
|
|
394
|
-
models: [
|
|
395
|
-
"grok-2",
|
|
396
|
-
"grok-2-1212",
|
|
397
|
-
"grok-2-latest",
|
|
398
|
-
"grok-2-vision",
|
|
399
|
-
"grok-2-vision-1212",
|
|
400
|
-
"grok-2-vision-latest",
|
|
401
|
-
"grok-3",
|
|
402
|
-
"grok-3-fast",
|
|
403
|
-
"grok-3-fast-latest",
|
|
404
|
-
"grok-3-latest",
|
|
405
|
-
"grok-3-mini",
|
|
406
|
-
"grok-3-mini-fast",
|
|
407
|
-
"grok-3-mini-fast-latest",
|
|
408
|
-
"grok-3-mini-latest",
|
|
409
|
-
"grok-4",
|
|
410
|
-
"grok-4-fast",
|
|
411
|
-
"grok-4-fast-non-reasoning",
|
|
412
|
-
"grok-beta",
|
|
413
|
-
"grok-code-fast-1",
|
|
414
|
-
"grok-vision-beta"
|
|
415
|
-
],
|
|
416
|
-
docUrl: "https://docs.x.ai/docs/models",
|
|
417
|
-
gateway: "models.dev"
|
|
418
|
-
},
|
|
419
|
-
nvidia: {
|
|
420
|
-
url: "https://integrate.api.nvidia.com/v1",
|
|
421
|
-
apiKeyEnvVar: "NVIDIA_API_KEY",
|
|
422
|
-
apiKeyHeader: "Authorization",
|
|
423
|
-
name: "Nvidia",
|
|
424
|
-
models: [
|
|
425
|
-
"black-forest-labs/flux.1-dev",
|
|
426
|
-
"deepseek-ai/deepseek-v3.1",
|
|
427
|
-
"google/gemma-3-27b-it",
|
|
428
|
-
"microsoft/phi-4-mini-instruct",
|
|
429
|
-
"moonshotai/kimi-k2-instruct",
|
|
430
|
-
"nvidia/cosmos-nemotron-34b",
|
|
431
|
-
"nvidia/llama-3.1-nemotron-ultra-253b-v1",
|
|
432
|
-
"nvidia/nemoretriever-ocr-v1",
|
|
433
|
-
"nvidia/parakeet-tdt-0.6b-v2",
|
|
434
|
-
"openai/gpt-oss-120b",
|
|
435
|
-
"openai/whisper-large-v3",
|
|
436
|
-
"qwen/qwen3-235b-a22b",
|
|
437
|
-
"qwen/qwen3-coder-480b-a35b-instruct"
|
|
438
|
-
],
|
|
439
|
-
docUrl: "https://docs.api.nvidia.com/nim/",
|
|
440
|
-
gateway: "models.dev"
|
|
441
|
-
},
|
|
442
|
-
upstage: {
|
|
443
|
-
url: "https://api.upstage.ai",
|
|
444
|
-
apiKeyEnvVar: "UPSTAGE_API_KEY",
|
|
445
|
-
apiKeyHeader: "Authorization",
|
|
446
|
-
name: "Upstage",
|
|
447
|
-
models: ["solar-mini", "solar-pro2"],
|
|
448
|
-
docUrl: "https://developers.upstage.ai/docs/apis/chat",
|
|
449
|
-
gateway: "models.dev"
|
|
450
|
-
},
|
|
451
|
-
groq: {
|
|
452
|
-
url: "https://api.groq.com/openai/v1",
|
|
453
|
-
apiKeyEnvVar: "GROQ_API_KEY",
|
|
454
|
-
apiKeyHeader: "Authorization",
|
|
455
|
-
name: "Groq",
|
|
456
|
-
models: [
|
|
457
|
-
"deepseek-r1-distill-llama-70b",
|
|
458
|
-
"gemma2-9b-it",
|
|
459
|
-
"llama-3.1-8b-instant",
|
|
460
|
-
"llama-3.3-70b-versatile",
|
|
461
|
-
"llama-guard-3-8b",
|
|
462
|
-
"llama3-70b-8192",
|
|
463
|
-
"llama3-8b-8192",
|
|
464
|
-
"meta-llama/llama-4-maverick-17b-128e-instruct",
|
|
465
|
-
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
466
|
-
"meta-llama/llama-guard-4-12b",
|
|
467
|
-
"mistral-saba-24b",
|
|
468
|
-
"moonshotai/kimi-k2-instruct",
|
|
469
|
-
"moonshotai/kimi-k2-instruct-0905",
|
|
470
|
-
"openai/gpt-oss-120b",
|
|
471
|
-
"openai/gpt-oss-20b",
|
|
472
|
-
"qwen-qwq-32b",
|
|
473
|
-
"qwen/qwen3-32b"
|
|
474
|
-
],
|
|
475
|
-
docUrl: "https://console.groq.com/docs/models",
|
|
476
|
-
gateway: "models.dev"
|
|
477
|
-
},
|
|
478
|
-
mistral: {
|
|
479
|
-
url: "https://api.mistral.ai/v1",
|
|
480
|
-
apiKeyEnvVar: "MISTRAL_API_KEY",
|
|
481
|
-
apiKeyHeader: "Authorization",
|
|
482
|
-
name: "Mistral",
|
|
483
|
-
models: [
|
|
484
|
-
"codestral-latest",
|
|
485
|
-
"devstral-medium-2507",
|
|
486
|
-
"devstral-small-2505",
|
|
487
|
-
"devstral-small-2507",
|
|
488
|
-
"magistral-medium-latest",
|
|
489
|
-
"magistral-small",
|
|
490
|
-
"ministral-3b-latest",
|
|
491
|
-
"ministral-8b-latest",
|
|
492
|
-
"mistral-large-latest",
|
|
493
|
-
"mistral-medium-2505",
|
|
494
|
-
"mistral-medium-2508",
|
|
495
|
-
"mistral-medium-latest",
|
|
496
|
-
"mistral-nemo",
|
|
497
|
-
"mistral-small-latest",
|
|
498
|
-
"open-mistral-7b",
|
|
499
|
-
"open-mixtral-8x22b",
|
|
500
|
-
"open-mixtral-8x7b",
|
|
501
|
-
"pixtral-12b",
|
|
502
|
-
"pixtral-large-latest"
|
|
503
|
-
],
|
|
504
|
-
docUrl: "https://docs.mistral.ai/getting-started/models/",
|
|
505
|
-
gateway: "models.dev"
|
|
506
|
-
},
|
|
507
|
-
vercel: {
|
|
508
|
-
url: "https://ai-gateway.vercel.sh/v1",
|
|
509
|
-
apiKeyEnvVar: "AI_GATEWAY_API_KEY",
|
|
510
|
-
apiKeyHeader: "Authorization",
|
|
511
|
-
name: "Vercel AI Gateway",
|
|
512
|
-
models: [
|
|
513
|
-
"amazon/nova-lite",
|
|
514
|
-
"amazon/nova-micro",
|
|
515
|
-
"amazon/nova-pro",
|
|
516
|
-
"anthropic/claude-3-5-haiku",
|
|
517
|
-
"anthropic/claude-3-haiku",
|
|
518
|
-
"anthropic/claude-3-opus",
|
|
519
|
-
"anthropic/claude-3.5-sonnet",
|
|
520
|
-
"anthropic/claude-3.7-sonnet",
|
|
521
|
-
"anthropic/claude-4-1-opus",
|
|
522
|
-
"anthropic/claude-4-opus",
|
|
523
|
-
"anthropic/claude-4-sonnet",
|
|
524
|
-
"anthropic/claude-4.5-sonnet",
|
|
525
|
-
"cerebras/qwen3-coder",
|
|
526
|
-
"deepseek/deepseek-r1",
|
|
527
|
-
"deepseek/deepseek-r1-distill-llama-70b",
|
|
528
|
-
"google/gemini-2.0-flash",
|
|
529
|
-
"google/gemini-2.0-flash-lite",
|
|
530
|
-
"google/gemini-2.5-flash",
|
|
531
|
-
"google/gemini-2.5-pro",
|
|
532
|
-
"meta/llama-3.3-70b",
|
|
533
|
-
"meta/llama-4-maverick",
|
|
534
|
-
"meta/llama-4-scout",
|
|
535
|
-
"mistral/codestral",
|
|
536
|
-
"mistral/magistral-medium",
|
|
537
|
-
"mistral/magistral-small",
|
|
538
|
-
"mistral/ministral-3b",
|
|
539
|
-
"mistral/ministral-8b",
|
|
540
|
-
"mistral/mistral-large",
|
|
541
|
-
"mistral/mistral-small",
|
|
542
|
-
"mistral/mixtral-8x22b-instruct",
|
|
543
|
-
"mistral/pixtral-12b",
|
|
544
|
-
"mistral/pixtral-large",
|
|
545
|
-
"moonshotai/kimi-k2",
|
|
546
|
-
"morph/morph-v3-fast",
|
|
547
|
-
"morph/morph-v3-large",
|
|
548
|
-
"openai/gpt-4-turbo",
|
|
549
|
-
"openai/gpt-4.1",
|
|
550
|
-
"openai/gpt-4.1-mini",
|
|
551
|
-
"openai/gpt-4.1-nano",
|
|
552
|
-
"openai/gpt-4o",
|
|
553
|
-
"openai/gpt-4o-mini",
|
|
554
|
-
"openai/gpt-5",
|
|
555
|
-
"openai/gpt-5-codex",
|
|
556
|
-
"openai/gpt-5-mini",
|
|
557
|
-
"openai/gpt-5-nano",
|
|
558
|
-
"openai/gpt-oss-120b",
|
|
559
|
-
"openai/gpt-oss-20b",
|
|
560
|
-
"openai/o1",
|
|
561
|
-
"openai/o3",
|
|
562
|
-
"openai/o3-mini",
|
|
563
|
-
"openai/o4-mini",
|
|
564
|
-
"vercel/v0-1.0-md",
|
|
565
|
-
"vercel/v0-1.5-md",
|
|
566
|
-
"xai/grok-2",
|
|
567
|
-
"xai/grok-2-vision",
|
|
568
|
-
"xai/grok-3",
|
|
569
|
-
"xai/grok-3-fast",
|
|
570
|
-
"xai/grok-3-mini",
|
|
571
|
-
"xai/grok-3-mini-fast",
|
|
572
|
-
"xai/grok-4",
|
|
573
|
-
"xai/grok-4-fast",
|
|
574
|
-
"xai/grok-4-fast-non-reasoning",
|
|
575
|
-
"xai/grok-code-fast-1"
|
|
576
|
-
],
|
|
577
|
-
docUrl: "https://github.com/vercel/ai/tree/5eb85cc45a259553501f535b8ac79a77d0e79223/packages/gateway",
|
|
578
|
-
gateway: "models.dev"
|
|
579
|
-
},
|
|
580
|
-
deepseek: {
|
|
581
|
-
url: "https://api.deepseek.com",
|
|
582
|
-
apiKeyEnvVar: "DEEPSEEK_API_KEY",
|
|
583
|
-
apiKeyHeader: "Authorization",
|
|
584
|
-
name: "DeepSeek",
|
|
585
|
-
models: ["deepseek-chat", "deepseek-reasoner"],
|
|
586
|
-
docUrl: "https://platform.deepseek.com/api-docs/pricing",
|
|
587
|
-
gateway: "models.dev"
|
|
588
|
-
},
|
|
589
|
-
"alibaba-cn": {
|
|
590
|
-
url: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
591
|
-
apiKeyEnvVar: "DASHSCOPE_API_KEY",
|
|
592
|
-
apiKeyHeader: "Authorization",
|
|
593
|
-
name: "Alibaba (China)",
|
|
594
|
-
models: ["qwen3-coder-plus"],
|
|
595
|
-
docUrl: "https://www.alibabacloud.com/help/en/model-studio/models",
|
|
596
|
-
gateway: "models.dev"
|
|
597
|
-
},
|
|
598
|
-
venice: {
|
|
599
|
-
url: "https://api.venice.ai/api/v1",
|
|
600
|
-
apiKeyEnvVar: "VENICE_API_KEY",
|
|
601
|
-
apiKeyHeader: "Authorization",
|
|
602
|
-
name: "Venice AI",
|
|
603
|
-
models: [
|
|
604
|
-
"deepseek-coder-v2-lite",
|
|
605
|
-
"deepseek-r1-671b",
|
|
606
|
-
"dolphin-2.9.2-qwen2-72b",
|
|
607
|
-
"llama-3.1-405b",
|
|
608
|
-
"llama-3.2-3b",
|
|
609
|
-
"llama-3.3-70b",
|
|
610
|
-
"mistral-31-24b",
|
|
611
|
-
"qwen-2.5-coder-32b",
|
|
612
|
-
"qwen-2.5-qwq-32b",
|
|
613
|
-
"qwen-2.5-vl",
|
|
614
|
-
"qwen3-235b",
|
|
615
|
-
"qwen3-4b",
|
|
616
|
-
"venice-uncensored"
|
|
617
|
-
],
|
|
618
|
-
docUrl: "https://docs.venice.ai",
|
|
619
|
-
gateway: "models.dev"
|
|
620
|
-
},
|
|
621
|
-
chutes: {
|
|
622
|
-
url: "https://llm.chutes.ai/v1",
|
|
623
|
-
apiKeyEnvVar: "CHUTES_API_KEY",
|
|
624
|
-
apiKeyHeader: "Authorization",
|
|
625
|
-
name: "Chutes",
|
|
626
|
-
models: [
|
|
627
|
-
"Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
628
|
-
"Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
629
|
-
"Qwen/Qwen3-30B-A3B",
|
|
630
|
-
"Qwen/Qwen3-30B-A3B-Instruct-2507",
|
|
631
|
-
"Qwen/Qwen3-30B-A3B-Thinking-2507",
|
|
632
|
-
"Qwen/Qwen3-Coder-30B-A3B-Instruct",
|
|
633
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",
|
|
634
|
-
"Qwen/Qwen3-Next-80B-A3B-Instruct",
|
|
635
|
-
"Qwen/Qwen3-Next-80B-A3B-Thinking",
|
|
636
|
-
"chutesai/Devstral-Small-2505",
|
|
637
|
-
"chutesai/Mistral-Small-3.2-24B-Instruct-2506",
|
|
638
|
-
"deepseek-ai/DeepSeek-R1-0528",
|
|
639
|
-
"deepseek-ai/DeepSeek-R1-0528-Qwen3-8B",
|
|
640
|
-
"deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
|
|
641
|
-
"deepseek-ai/DeepSeek-V3-0324",
|
|
642
|
-
"deepseek-ai/DeepSeek-V3.1",
|
|
643
|
-
"deepseek-ai/DeepSeek-V3.1-Terminus",
|
|
644
|
-
"deepseek-ai/DeepSeek-V3.1-turbo",
|
|
645
|
-
"deepseek-ai/DeepSeek-V3.1:THINKING",
|
|
646
|
-
"meituan-longcat/LongCat-Flash-Chat-FP8",
|
|
647
|
-
"moonshotai/Kimi-Dev-72B",
|
|
648
|
-
"moonshotai/Kimi-K2-Instruct-0905",
|
|
649
|
-
"moonshotai/Kimi-K2-Instruct-75k",
|
|
650
|
-
"moonshotai/Kimi-VL-A3B-Thinking",
|
|
651
|
-
"openai/gpt-oss-120b",
|
|
652
|
-
"tngtech/DeepSeek-R1T-Chimera",
|
|
653
|
-
"tngtech/DeepSeek-TNG-R1T2-Chimera",
|
|
654
|
-
"zai-org/GLM-4.5-Air",
|
|
655
|
-
"zai-org/GLM-4.5-FP8",
|
|
656
|
-
"zai-org/GLM-4.5-turbo",
|
|
657
|
-
"zai-org/GLM-4.6-FP8"
|
|
658
|
-
],
|
|
659
|
-
docUrl: "https://llm.chutes.ai/v1/models",
|
|
660
|
-
gateway: "models.dev"
|
|
661
|
-
},
|
|
662
|
-
cortecs: {
|
|
663
|
-
url: "https://api.cortecs.ai/v1",
|
|
664
|
-
apiKeyEnvVar: "CORTECS_API_KEY",
|
|
665
|
-
apiKeyHeader: "Authorization",
|
|
666
|
-
name: "Cortecs",
|
|
667
|
-
models: [
|
|
668
|
-
"claude-sonnet-4",
|
|
669
|
-
"deepseek-v3-0324",
|
|
670
|
-
"gemini-2.5-pro",
|
|
671
|
-
"gpt-4.1",
|
|
672
|
-
"gpt-oss-120b",
|
|
673
|
-
"kimi-k2-instruct",
|
|
674
|
-
"llama-3.1-405b-instruct",
|
|
675
|
-
"nova-pro-v1",
|
|
676
|
-
"qwen3-32b",
|
|
677
|
-
"qwen3-coder-480b-a35b-instruct"
|
|
678
|
-
],
|
|
679
|
-
docUrl: "https://api.cortecs.ai/v1/models",
|
|
680
|
-
gateway: "models.dev"
|
|
681
|
-
},
|
|
682
|
-
"github-models": {
|
|
683
|
-
url: "https://models.github.ai/inference",
|
|
684
|
-
apiKeyEnvVar: "GITHUB_TOKEN",
|
|
685
|
-
apiKeyHeader: "Authorization",
|
|
686
|
-
name: "GitHub Models",
|
|
687
|
-
models: [
|
|
688
|
-
"ai21-labs/ai21-jamba-1.5-large",
|
|
689
|
-
"ai21-labs/ai21-jamba-1.5-mini",
|
|
690
|
-
"cohere/cohere-command-a",
|
|
691
|
-
"cohere/cohere-command-r",
|
|
692
|
-
"cohere/cohere-command-r-08-2024",
|
|
693
|
-
"cohere/cohere-command-r-plus",
|
|
694
|
-
"cohere/cohere-command-r-plus-08-2024",
|
|
695
|
-
"core42/jais-30b-chat",
|
|
696
|
-
"deepseek/deepseek-r1",
|
|
697
|
-
"deepseek/deepseek-r1-0528",
|
|
698
|
-
"deepseek/deepseek-v3-0324",
|
|
699
|
-
"meta/llama-3.2-11b-vision-instruct",
|
|
700
|
-
"meta/llama-3.2-90b-vision-instruct",
|
|
701
|
-
"meta/llama-3.3-70b-instruct",
|
|
702
|
-
"meta/llama-4-maverick-17b-128e-instruct-fp8",
|
|
703
|
-
"meta/llama-4-scout-17b-16e-instruct",
|
|
704
|
-
"meta/meta-llama-3-70b-instruct",
|
|
705
|
-
"meta/meta-llama-3-8b-instruct",
|
|
706
|
-
"meta/meta-llama-3.1-405b-instruct",
|
|
707
|
-
"meta/meta-llama-3.1-70b-instruct",
|
|
708
|
-
"meta/meta-llama-3.1-8b-instruct",
|
|
709
|
-
"microsoft/mai-ds-r1",
|
|
710
|
-
"microsoft/phi-3-medium-128k-instruct",
|
|
711
|
-
"microsoft/phi-3-medium-4k-instruct",
|
|
712
|
-
"microsoft/phi-3-mini-128k-instruct",
|
|
713
|
-
"microsoft/phi-3-mini-4k-instruct",
|
|
714
|
-
"microsoft/phi-3-small-128k-instruct",
|
|
715
|
-
"microsoft/phi-3-small-8k-instruct",
|
|
716
|
-
"microsoft/phi-3.5-mini-instruct",
|
|
717
|
-
"microsoft/phi-3.5-moe-instruct",
|
|
718
|
-
"microsoft/phi-3.5-vision-instruct",
|
|
719
|
-
"microsoft/phi-4",
|
|
720
|
-
"microsoft/phi-4-mini-instruct",
|
|
721
|
-
"microsoft/phi-4-mini-reasoning",
|
|
722
|
-
"microsoft/phi-4-multimodal-instruct",
|
|
723
|
-
"microsoft/phi-4-reasoning",
|
|
724
|
-
"mistral-ai/codestral-2501",
|
|
725
|
-
"mistral-ai/ministral-3b",
|
|
726
|
-
"mistral-ai/mistral-large-2411",
|
|
727
|
-
"mistral-ai/mistral-medium-2505",
|
|
728
|
-
"mistral-ai/mistral-nemo",
|
|
729
|
-
"mistral-ai/mistral-small-2503",
|
|
730
|
-
"openai/gpt-4.1",
|
|
731
|
-
"openai/gpt-4.1-mini",
|
|
732
|
-
"openai/gpt-4.1-nano",
|
|
733
|
-
"openai/gpt-4o",
|
|
734
|
-
"openai/gpt-4o-mini",
|
|
735
|
-
"openai/o1",
|
|
736
|
-
"openai/o1-mini",
|
|
737
|
-
"openai/o1-preview",
|
|
738
|
-
"openai/o3",
|
|
739
|
-
"openai/o3-mini",
|
|
740
|
-
"openai/o4-mini",
|
|
741
|
-
"xai/grok-3",
|
|
742
|
-
"xai/grok-3-mini"
|
|
743
|
-
],
|
|
744
|
-
docUrl: "https://docs.github.com/en/github-models",
|
|
745
|
-
gateway: "models.dev"
|
|
746
|
-
},
|
|
747
|
-
togetherai: {
|
|
748
|
-
url: "https://api.together.xyz/v1",
|
|
749
|
-
apiKeyEnvVar: "TOGETHER_API_KEY",
|
|
750
|
-
apiKeyHeader: "Authorization",
|
|
751
|
-
name: "Together AI",
|
|
752
|
-
models: [
|
|
753
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",
|
|
754
|
-
"deepseek-ai/DeepSeek-R1",
|
|
755
|
-
"deepseek-ai/DeepSeek-V3",
|
|
756
|
-
"meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
757
|
-
"moonshotai/Kimi-K2-Instruct",
|
|
758
|
-
"openai/gpt-oss-120b"
|
|
759
|
-
],
|
|
760
|
-
docUrl: "https://docs.together.ai/docs/serverless-models",
|
|
761
|
-
gateway: "models.dev"
|
|
762
|
-
},
|
|
763
|
-
baseten: {
|
|
764
|
-
url: "https://inference.baseten.co/v1",
|
|
765
|
-
apiKeyEnvVar: "BASETEN_API_KEY",
|
|
766
|
-
apiKeyHeader: "Authorization",
|
|
767
|
-
name: "Baseten",
|
|
768
|
-
models: ["Qwen3/Qwen3-Coder-480B-A35B-Instruct", "moonshotai/Kimi-K2-Instruct-0905"],
|
|
769
|
-
docUrl: "https://docs.baseten.co/development/model-apis/overview",
|
|
770
|
-
gateway: "models.dev"
|
|
771
|
-
},
|
|
772
|
-
huggingface: {
|
|
773
|
-
url: "https://router.huggingface.co/v1",
|
|
774
|
-
apiKeyEnvVar: "HF_TOKEN",
|
|
775
|
-
apiKeyHeader: "Authorization",
|
|
776
|
-
name: "Hugging Face",
|
|
777
|
-
models: [
|
|
778
|
-
"Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
779
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
780
|
-
"Qwen/Qwen3-Next-80B-A3B-Instruct",
|
|
781
|
-
"Qwen/Qwen3-Next-80B-A3B-Thinking",
|
|
782
|
-
"deepseek-ai/DeepSeek-R1-0528",
|
|
783
|
-
"deepseek-ai/Deepseek-V3-0324",
|
|
784
|
-
"moonshotai/Kimi-K2-Instruct",
|
|
785
|
-
"moonshotai/Kimi-K2-Instruct-0905",
|
|
786
|
-
"zai-org/GLM-4.5",
|
|
787
|
-
"zai-org/GLM-4.5-Air",
|
|
788
|
-
"zai-org/GLM-4.6"
|
|
789
|
-
],
|
|
790
|
-
docUrl: "https://huggingface.co/docs/inference-providers",
|
|
791
|
-
gateway: "models.dev"
|
|
792
|
-
},
|
|
793
|
-
opencode: {
|
|
794
|
-
url: "https://opencode.ai/zen/v1",
|
|
795
|
-
apiKeyEnvVar: "OPENCODE_API_KEY",
|
|
796
|
-
apiKeyHeader: "Authorization",
|
|
797
|
-
name: "OpenCode Zen",
|
|
798
|
-
models: [
|
|
799
|
-
"claude-3-5-haiku",
|
|
800
|
-
"claude-opus-4-1",
|
|
801
|
-
"claude-sonnet-4",
|
|
802
|
-
"claude-sonnet-4-5",
|
|
803
|
-
"code-supernova",
|
|
804
|
-
"glm-4.6",
|
|
805
|
-
"gpt-5",
|
|
806
|
-
"gpt-5-codex",
|
|
807
|
-
"grok-code",
|
|
808
|
-
"kimi-k2",
|
|
809
|
-
"qwen3-coder",
|
|
810
|
-
"qwen3-max"
|
|
811
|
-
],
|
|
812
|
-
docUrl: "https://opencode.ai/docs/zen",
|
|
813
|
-
gateway: "models.dev"
|
|
814
|
-
},
|
|
815
|
-
fastrouter: {
|
|
816
|
-
url: "https://go.fastrouter.ai/api/v1",
|
|
817
|
-
apiKeyEnvVar: "FASTROUTER_API_KEY",
|
|
818
|
-
apiKeyHeader: "Authorization",
|
|
819
|
-
name: "FastRouter",
|
|
820
|
-
models: [
|
|
821
|
-
"anthropic/claude-opus-4.1",
|
|
822
|
-
"anthropic/claude-sonnet-4",
|
|
823
|
-
"deepseek-ai/deepseek-r1-distill-llama-70b",
|
|
824
|
-
"google/gemini-2.5-flash",
|
|
825
|
-
"google/gemini-2.5-pro",
|
|
826
|
-
"moonshotai/kimi-k2",
|
|
827
|
-
"openai/gpt-4.1",
|
|
828
|
-
"openai/gpt-5",
|
|
829
|
-
"openai/gpt-5-mini",
|
|
830
|
-
"openai/gpt-5-nano",
|
|
831
|
-
"openai/gpt-oss-120b",
|
|
832
|
-
"openai/gpt-oss-20b",
|
|
833
|
-
"qwen/qwen3-coder",
|
|
834
|
-
"x-ai/grok-4"
|
|
835
|
-
],
|
|
836
|
-
docUrl: "https://fastrouter.ai/models",
|
|
837
|
-
gateway: "models.dev"
|
|
838
|
-
},
|
|
839
|
-
google: {
|
|
840
|
-
apiKeyEnvVar: "GOOGLE_GENERATIVE_AI_API_KEY",
|
|
841
|
-
name: "Google",
|
|
842
|
-
models: [
|
|
843
|
-
"gemini-1.5-flash",
|
|
844
|
-
"gemini-1.5-flash-8b",
|
|
845
|
-
"gemini-1.5-pro",
|
|
846
|
-
"gemini-2.0-flash",
|
|
847
|
-
"gemini-2.0-flash-lite",
|
|
848
|
-
"gemini-2.5-flash",
|
|
849
|
-
"gemini-2.5-flash-lite",
|
|
850
|
-
"gemini-2.5-flash-lite-preview-06-17",
|
|
851
|
-
"gemini-2.5-flash-lite-preview-09-2025",
|
|
852
|
-
"gemini-2.5-flash-preview-04-17",
|
|
853
|
-
"gemini-2.5-flash-preview-05-20",
|
|
854
|
-
"gemini-2.5-flash-preview-09-2025",
|
|
855
|
-
"gemini-2.5-pro",
|
|
856
|
-
"gemini-2.5-pro-preview-05-06",
|
|
857
|
-
"gemini-2.5-pro-preview-06-05",
|
|
858
|
-
"gemini-flash-latest",
|
|
859
|
-
"gemini-flash-lite-latest",
|
|
860
|
-
"gemini-live-2.5-flash-preview-native-audio"
|
|
861
|
-
],
|
|
862
|
-
docUrl: "https://ai.google.dev/gemini-api/docs/pricing",
|
|
863
|
-
gateway: "models.dev"
|
|
864
|
-
},
|
|
865
|
-
inception: {
|
|
866
|
-
url: "https://api.inceptionlabs.ai/v1/",
|
|
867
|
-
apiKeyEnvVar: "INCEPTION_API_KEY",
|
|
868
|
-
apiKeyHeader: "Authorization",
|
|
869
|
-
name: "Inception",
|
|
870
|
-
models: ["mercury", "mercury-coder"],
|
|
871
|
-
docUrl: "https://platform.inceptionlabs.ai/docs",
|
|
872
|
-
gateway: "models.dev"
|
|
873
|
-
},
|
|
874
|
-
wandb: {
|
|
875
|
-
url: "https://api.inference.wandb.ai/v1",
|
|
876
|
-
apiKeyEnvVar: "WANDB_API_KEY",
|
|
877
|
-
apiKeyHeader: "Authorization",
|
|
878
|
-
name: "Weights & Biases",
|
|
879
|
-
models: [
|
|
880
|
-
"Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
881
|
-
"Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
882
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
883
|
-
"deepseek-ai/DeepSeek-R1-0528",
|
|
884
|
-
"deepseek-ai/DeepSeek-V3-0324",
|
|
885
|
-
"meta-llama/Llama-3.1-8B-Instruct",
|
|
886
|
-
"meta-llama/Llama-3.3-70B-Instruct",
|
|
887
|
-
"meta-llama/Llama-4-Scout-17B-16E-Instruct",
|
|
888
|
-
"microsoft/Phi-4-mini-instruct",
|
|
889
|
-
"moonshotai/Kimi-K2-Instruct"
|
|
890
|
-
],
|
|
891
|
-
docUrl: "https://weave-docs.wandb.ai/guides/integrations/inference/",
|
|
892
|
-
gateway: "models.dev"
|
|
893
|
-
},
|
|
894
|
-
openai: {
|
|
895
|
-
apiKeyEnvVar: "OPENAI_API_KEY",
|
|
896
|
-
name: "OpenAI",
|
|
897
|
-
models: [
|
|
898
|
-
"codex-mini-latest",
|
|
899
|
-
"gpt-3.5-turbo",
|
|
900
|
-
"gpt-4",
|
|
901
|
-
"gpt-4-turbo",
|
|
902
|
-
"gpt-4.1",
|
|
903
|
-
"gpt-4.1-mini",
|
|
904
|
-
"gpt-4.1-nano",
|
|
905
|
-
"gpt-4o",
|
|
906
|
-
"gpt-4o-2024-05-13",
|
|
907
|
-
"gpt-4o-2024-08-06",
|
|
908
|
-
"gpt-4o-2024-11-20",
|
|
909
|
-
"gpt-4o-mini",
|
|
910
|
-
"gpt-5",
|
|
911
|
-
"gpt-5-chat-latest",
|
|
912
|
-
"gpt-5-codex",
|
|
913
|
-
"gpt-5-mini",
|
|
914
|
-
"gpt-5-nano",
|
|
915
|
-
"o1",
|
|
916
|
-
"o1-mini",
|
|
917
|
-
"o1-preview",
|
|
918
|
-
"o1-pro",
|
|
919
|
-
"o3",
|
|
920
|
-
"o3-deep-research",
|
|
921
|
-
"o3-mini",
|
|
922
|
-
"o3-pro",
|
|
923
|
-
"o4-mini",
|
|
924
|
-
"o4-mini-deep-research"
|
|
925
|
-
],
|
|
926
|
-
docUrl: "https://platform.openai.com/docs/models",
|
|
927
|
-
gateway: "models.dev"
|
|
928
|
-
},
|
|
929
|
-
"zhipuai-coding-plan": {
|
|
930
|
-
url: "https://open.bigmodel.cn/api/coding/paas/v4",
|
|
931
|
-
apiKeyEnvVar: "ZHIPU_API_KEY",
|
|
932
|
-
apiKeyHeader: "Authorization",
|
|
933
|
-
name: "Zhipu AI Coding Plan",
|
|
934
|
-
models: ["glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v", "glm-4.6"],
|
|
935
|
-
docUrl: "https://docs.bigmodel.cn/cn/coding-plan/overview",
|
|
936
|
-
gateway: "models.dev"
|
|
937
|
-
},
|
|
938
|
-
perplexity: {
|
|
939
|
-
url: "https://api.perplexity.ai",
|
|
940
|
-
apiKeyEnvVar: "PERPLEXITY_API_KEY",
|
|
941
|
-
apiKeyHeader: "Authorization",
|
|
942
|
-
name: "Perplexity",
|
|
943
|
-
models: ["sonar", "sonar-pro", "sonar-reasoning", "sonar-reasoning-pro"],
|
|
944
|
-
docUrl: "https://docs.perplexity.ai",
|
|
945
|
-
gateway: "models.dev"
|
|
946
|
-
},
|
|
947
|
-
openrouter: {
|
|
948
|
-
url: "https://openrouter.ai/api/v1",
|
|
949
|
-
apiKeyEnvVar: "OPENROUTER_API_KEY",
|
|
950
|
-
name: "OpenRouter",
|
|
951
|
-
models: [
|
|
952
|
-
"anthropic/claude-3.5-haiku",
|
|
953
|
-
"anthropic/claude-3.7-sonnet",
|
|
954
|
-
"anthropic/claude-opus-4",
|
|
955
|
-
"anthropic/claude-opus-4.1",
|
|
956
|
-
"anthropic/claude-sonnet-4",
|
|
957
|
-
"anthropic/claude-sonnet-4.5",
|
|
958
|
-
"cognitivecomputations/dolphin3.0-mistral-24b",
|
|
959
|
-
"cognitivecomputations/dolphin3.0-r1-mistral-24b",
|
|
960
|
-
"deepseek/deepseek-chat-v3-0324",
|
|
961
|
-
"deepseek/deepseek-chat-v3.1",
|
|
962
|
-
"deepseek/deepseek-r1-0528-qwen3-8b:free",
|
|
963
|
-
"deepseek/deepseek-r1-0528:free",
|
|
964
|
-
"deepseek/deepseek-r1-distill-llama-70b",
|
|
965
|
-
"deepseek/deepseek-r1-distill-qwen-14b",
|
|
966
|
-
"deepseek/deepseek-r1:free",
|
|
967
|
-
"deepseek/deepseek-v3-base:free",
|
|
968
|
-
"deepseek/deepseek-v3.1-terminus",
|
|
969
|
-
"featherless/qwerky-72b",
|
|
970
|
-
"google/gemini-2.0-flash-001",
|
|
971
|
-
"google/gemini-2.0-flash-exp:free",
|
|
972
|
-
"google/gemini-2.5-flash",
|
|
973
|
-
"google/gemini-2.5-pro",
|
|
974
|
-
"google/gemini-2.5-pro-preview-05-06",
|
|
975
|
-
"google/gemini-2.5-pro-preview-06-05",
|
|
976
|
-
"google/gemma-2-9b-it:free",
|
|
977
|
-
"google/gemma-3-12b-it",
|
|
978
|
-
"google/gemma-3-27b-it",
|
|
979
|
-
"google/gemma-3n-e4b-it",
|
|
980
|
-
"google/gemma-3n-e4b-it:free",
|
|
981
|
-
"meta-llama/llama-3.2-11b-vision-instruct",
|
|
982
|
-
"meta-llama/llama-3.3-70b-instruct:free",
|
|
983
|
-
"meta-llama/llama-4-scout:free",
|
|
984
|
-
"microsoft/mai-ds-r1:free",
|
|
985
|
-
"mistralai/codestral-2508",
|
|
986
|
-
"mistralai/devstral-medium-2507",
|
|
987
|
-
"mistralai/devstral-small-2505",
|
|
988
|
-
"mistralai/devstral-small-2505:free",
|
|
989
|
-
"mistralai/devstral-small-2507",
|
|
990
|
-
"mistralai/mistral-7b-instruct:free",
|
|
991
|
-
"mistralai/mistral-medium-3",
|
|
992
|
-
"mistralai/mistral-medium-3.1",
|
|
993
|
-
"mistralai/mistral-nemo:free",
|
|
994
|
-
"mistralai/mistral-small-3.1-24b-instruct",
|
|
995
|
-
"mistralai/mistral-small-3.2-24b-instruct",
|
|
996
|
-
"mistralai/mistral-small-3.2-24b-instruct:free",
|
|
997
|
-
"moonshotai/kimi-dev-72b:free",
|
|
998
|
-
"moonshotai/kimi-k2",
|
|
999
|
-
"moonshotai/kimi-k2-0905",
|
|
1000
|
-
"moonshotai/kimi-k2:free",
|
|
1001
|
-
"nousresearch/deephermes-3-llama-3-8b-preview",
|
|
1002
|
-
"nousresearch/hermes-4-405b",
|
|
1003
|
-
"nousresearch/hermes-4-70b",
|
|
1004
|
-
"openai/gpt-4.1",
|
|
1005
|
-
"openai/gpt-4.1-mini",
|
|
1006
|
-
"openai/gpt-4o-mini",
|
|
1007
|
-
"openai/gpt-5",
|
|
1008
|
-
"openai/gpt-5-chat",
|
|
1009
|
-
"openai/gpt-5-codex",
|
|
1010
|
-
"openai/gpt-5-mini",
|
|
1011
|
-
"openai/gpt-5-nano",
|
|
1012
|
-
"openai/gpt-oss-120b",
|
|
1013
|
-
"openai/gpt-oss-20b",
|
|
1014
|
-
"openai/o4-mini",
|
|
1015
|
-
"openrouter/cypher-alpha:free",
|
|
1016
|
-
"openrouter/horizon-alpha",
|
|
1017
|
-
"openrouter/horizon-beta",
|
|
1018
|
-
"openrouter/sonoma-dusk-alpha",
|
|
1019
|
-
"openrouter/sonoma-sky-alpha",
|
|
1020
|
-
"qwen/qwen-2.5-coder-32b-instruct",
|
|
1021
|
-
"qwen/qwen2.5-vl-32b-instruct:free",
|
|
1022
|
-
"qwen/qwen2.5-vl-72b-instruct",
|
|
1023
|
-
"qwen/qwen2.5-vl-72b-instruct:free",
|
|
1024
|
-
"qwen/qwen3-14b:free",
|
|
1025
|
-
"qwen/qwen3-235b-a22b-07-25",
|
|
1026
|
-
"qwen/qwen3-235b-a22b-07-25:free",
|
|
1027
|
-
"qwen/qwen3-235b-a22b-thinking-2507",
|
|
1028
|
-
"qwen/qwen3-235b-a22b:free",
|
|
1029
|
-
"qwen/qwen3-30b-a3b-instruct-2507",
|
|
1030
|
-
"qwen/qwen3-30b-a3b:free",
|
|
1031
|
-
"qwen/qwen3-32b:free",
|
|
1032
|
-
"qwen/qwen3-8b:free",
|
|
1033
|
-
"qwen/qwen3-coder",
|
|
1034
|
-
"qwen/qwen3-coder:free",
|
|
1035
|
-
"qwen/qwen3-max",
|
|
1036
|
-
"qwen/qwen3-next-80b-a3b-instruct",
|
|
1037
|
-
"qwen/qwq-32b:free",
|
|
1038
|
-
"rekaai/reka-flash-3",
|
|
1039
|
-
"sarvamai/sarvam-m:free",
|
|
1040
|
-
"thudm/glm-z1-32b:free",
|
|
1041
|
-
"tngtech/deepseek-r1t2-chimera:free",
|
|
1042
|
-
"x-ai/grok-3",
|
|
1043
|
-
"x-ai/grok-3-beta",
|
|
1044
|
-
"x-ai/grok-3-mini",
|
|
1045
|
-
"x-ai/grok-3-mini-beta",
|
|
1046
|
-
"x-ai/grok-4",
|
|
1047
|
-
"x-ai/grok-4-fast",
|
|
1048
|
-
"x-ai/grok-4-fast:free",
|
|
1049
|
-
"x-ai/grok-code-fast-1",
|
|
1050
|
-
"z-ai/glm-4.5",
|
|
1051
|
-
"z-ai/glm-4.5-air",
|
|
1052
|
-
"z-ai/glm-4.5-air:free",
|
|
1053
|
-
"z-ai/glm-4.5v",
|
|
1054
|
-
"z-ai/glm-4.6"
|
|
1055
|
-
],
|
|
1056
|
-
docUrl: "https://openrouter.ai/models",
|
|
1057
|
-
gateway: "models.dev"
|
|
1058
|
-
},
|
|
1059
|
-
synthetic: {
|
|
1060
|
-
url: "https://api.synthetic.new/v1",
|
|
1061
|
-
apiKeyEnvVar: "SYNTHETIC_API_KEY",
|
|
1062
|
-
apiKeyHeader: "Authorization",
|
|
1063
|
-
name: "Synthetic",
|
|
1064
|
-
models: [
|
|
1065
|
-
"hf:Qwen/Qwen2.5-Coder-32B-Instruct",
|
|
1066
|
-
"hf:Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
1067
|
-
"hf:Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
1068
|
-
"hf:Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
1069
|
-
"hf:deepseek-ai/DeepSeek-R1",
|
|
1070
|
-
"hf:deepseek-ai/DeepSeek-R1-0528",
|
|
1071
|
-
"hf:deepseek-ai/DeepSeek-V3",
|
|
1072
|
-
"hf:deepseek-ai/DeepSeek-V3-0324",
|
|
1073
|
-
"hf:deepseek-ai/DeepSeek-V3.1",
|
|
1074
|
-
"hf:deepseek-ai/DeepSeek-V3.1-Terminus",
|
|
1075
|
-
"hf:meta-llama/Llama-3.1-405B-Instruct",
|
|
1076
|
-
"hf:meta-llama/Llama-3.1-70B-Instruct",
|
|
1077
|
-
"hf:meta-llama/Llama-3.1-8B-Instruct",
|
|
1078
|
-
"hf:meta-llama/Llama-3.3-70B-Instruct",
|
|
1079
|
-
"hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
|
|
1080
|
-
"hf:meta-llama/Llama-4-Scout-17B-16E-Instruct",
|
|
1081
|
-
"hf:moonshotai/Kimi-K2-Instruct",
|
|
1082
|
-
"hf:moonshotai/Kimi-K2-Instruct-0905",
|
|
1083
|
-
"hf:openai/gpt-oss-120b",
|
|
1084
|
-
"hf:zai-org/GLM-4.5",
|
|
1085
|
-
"hf:zai-org/GLM-4.6"
|
|
1086
|
-
],
|
|
1087
|
-
docUrl: "https://synthetic.new/pricing",
|
|
1088
|
-
gateway: "models.dev"
|
|
1089
|
-
},
|
|
1090
|
-
deepinfra: {
|
|
1091
|
-
url: "https://api.deepinfra.com/v1/openai",
|
|
1092
|
-
apiKeyEnvVar: "DEEPINFRA_API_KEY",
|
|
1093
|
-
apiKeyHeader: "Authorization",
|
|
1094
|
-
name: "Deep Infra",
|
|
1095
|
-
models: [
|
|
1096
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
1097
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo",
|
|
1098
|
-
"moonshotai/Kimi-K2-Instruct",
|
|
1099
|
-
"zai-org/GLM-4.5"
|
|
1100
|
-
],
|
|
1101
|
-
docUrl: "https://deepinfra.com/models",
|
|
1102
|
-
gateway: "models.dev"
|
|
1103
|
-
},
|
|
1104
|
-
zhipuai: {
|
|
1105
|
-
url: "https://open.bigmodel.cn/api/paas/v4",
|
|
1106
|
-
apiKeyEnvVar: "ZHIPU_API_KEY",
|
|
1107
|
-
apiKeyHeader: "Authorization",
|
|
1108
|
-
name: "Zhipu AI",
|
|
1109
|
-
models: ["glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v", "glm-4.6"],
|
|
1110
|
-
docUrl: "https://docs.z.ai/guides/overview/pricing",
|
|
1111
|
-
gateway: "models.dev"
|
|
1112
|
-
},
|
|
1113
|
-
submodel: {
|
|
1114
|
-
url: "https://llm.submodel.ai/v1",
|
|
1115
|
-
apiKeyEnvVar: "SUBMODEL_INSTAGEN_ACCESS_KEY",
|
|
1116
|
-
apiKeyHeader: "Authorization",
|
|
1117
|
-
name: "submodel",
|
|
1118
|
-
models: [
|
|
1119
|
-
"Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
1120
|
-
"Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
1121
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",
|
|
1122
|
-
"deepseek-ai/DeepSeek-R1-0528",
|
|
1123
|
-
"deepseek-ai/DeepSeek-V3-0324",
|
|
1124
|
-
"deepseek-ai/DeepSeek-V3.1",
|
|
1125
|
-
"openai/gpt-oss-120b",
|
|
1126
|
-
"zai-org/GLM-4.5-Air",
|
|
1127
|
-
"zai-org/GLM-4.5-FP8"
|
|
1128
|
-
],
|
|
1129
|
-
docUrl: "https://submodel.gitbook.io",
|
|
1130
|
-
gateway: "models.dev"
|
|
1131
|
-
},
|
|
1132
|
-
zai: {
|
|
1133
|
-
url: "https://api.z.ai/api/paas/v4",
|
|
1134
|
-
apiKeyEnvVar: "ZHIPU_API_KEY",
|
|
1135
|
-
apiKeyHeader: "Authorization",
|
|
1136
|
-
name: "Z.AI",
|
|
1137
|
-
models: ["glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v", "glm-4.6"],
|
|
1138
|
-
docUrl: "https://docs.z.ai/guides/overview/pricing",
|
|
1139
|
-
gateway: "models.dev"
|
|
1140
|
-
},
|
|
1141
|
-
inference: {
|
|
1142
|
-
url: "https://inference.net/v1",
|
|
1143
|
-
apiKeyEnvVar: "INFERENCE_API_KEY",
|
|
1144
|
-
apiKeyHeader: "Authorization",
|
|
1145
|
-
name: "Inference",
|
|
1146
|
-
models: [
|
|
1147
|
-
"google/gemma-3",
|
|
1148
|
-
"meta/llama-3.1-8b-instruct",
|
|
1149
|
-
"meta/llama-3.2-11b-vision-instruct",
|
|
1150
|
-
"meta/llama-3.2-1b-instruct",
|
|
1151
|
-
"meta/llama-3.2-3b-instruct",
|
|
1152
|
-
"mistral/mistral-nemo-12b-instruct",
|
|
1153
|
-
"osmosis/osmosis-structure-0.6b",
|
|
1154
|
-
"qwen/qwen-2.5-7b-vision-instruct",
|
|
1155
|
-
"qwen/qwen3-embedding-4b"
|
|
1156
|
-
],
|
|
1157
|
-
docUrl: "https://inference.net/models",
|
|
1158
|
-
gateway: "models.dev"
|
|
1159
|
-
},
|
|
1160
|
-
requesty: {
|
|
1161
|
-
url: "https://router.requesty.ai/v1",
|
|
1162
|
-
apiKeyEnvVar: "REQUESTY_API_KEY",
|
|
1163
|
-
apiKeyHeader: "Authorization",
|
|
1164
|
-
name: "Requesty",
|
|
1165
|
-
models: [
|
|
1166
|
-
"anthropic/claude-3-7-sonnet",
|
|
1167
|
-
"anthropic/claude-4-sonnet-20250522",
|
|
1168
|
-
"anthropic/claude-opus-4",
|
|
1169
|
-
"anthropic/claude-opus-4-1-20250805",
|
|
1170
|
-
"google/gemini-2.5-flash",
|
|
1171
|
-
"google/gemini-2.5-pro",
|
|
1172
|
-
"openai/gpt-4.1",
|
|
1173
|
-
"openai/gpt-4.1-mini",
|
|
1174
|
-
"openai/gpt-4o-mini",
|
|
1175
|
-
"openai/gpt-5",
|
|
1176
|
-
"openai/gpt-5-mini",
|
|
1177
|
-
"openai/gpt-5-nano",
|
|
1178
|
-
"openai/o4-mini"
|
|
1179
|
-
],
|
|
1180
|
-
docUrl: "https://requesty.ai/solution/llm-routing/models",
|
|
1181
|
-
gateway: "models.dev"
|
|
1182
|
-
},
|
|
1183
|
-
morph: {
|
|
1184
|
-
url: "https://api.morphllm.com/v1",
|
|
1185
|
-
apiKeyEnvVar: "MORPH_API_KEY",
|
|
1186
|
-
apiKeyHeader: "Authorization",
|
|
1187
|
-
name: "Morph",
|
|
1188
|
-
models: ["auto", "morph-v3-fast", "morph-v3-large"],
|
|
1189
|
-
docUrl: "https://docs.morphllm.com/api-reference/introduction",
|
|
1190
|
-
gateway: "models.dev"
|
|
1191
|
-
},
|
|
1192
|
-
lmstudio: {
|
|
1193
|
-
url: "http://127.0.0.1:1234/v1",
|
|
1194
|
-
apiKeyEnvVar: "LMSTUDIO_API_KEY",
|
|
1195
|
-
apiKeyHeader: "Authorization",
|
|
1196
|
-
name: "LMStudio",
|
|
1197
|
-
models: ["openai/gpt-oss-20b", "qwen/qwen3-30b-a3b-2507", "qwen/qwen3-coder-30b"],
|
|
1198
|
-
docUrl: "https://lmstudio.ai/models",
|
|
1199
|
-
gateway: "models.dev"
|
|
1200
|
-
},
|
|
1201
|
-
anthropic: {
|
|
1202
|
-
apiKeyEnvVar: "ANTHROPIC_API_KEY",
|
|
1203
|
-
name: "Anthropic",
|
|
1204
|
-
models: [
|
|
1205
|
-
"claude-3-5-haiku-20241022",
|
|
1206
|
-
"claude-3-5-sonnet-20240620",
|
|
1207
|
-
"claude-3-5-sonnet-20241022",
|
|
1208
|
-
"claude-3-7-sonnet-20250219",
|
|
1209
|
-
"claude-3-haiku-20240307",
|
|
1210
|
-
"claude-3-opus-20240229",
|
|
1211
|
-
"claude-3-sonnet-20240229",
|
|
1212
|
-
"claude-opus-4-1-20250805",
|
|
1213
|
-
"claude-opus-4-20250514",
|
|
1214
|
-
"claude-sonnet-4-20250514",
|
|
1215
|
-
"claude-sonnet-4-5-20250929"
|
|
1216
|
-
],
|
|
1217
|
-
docUrl: "https://docs.anthropic.com/en/docs/about-claude/models",
|
|
1218
|
-
gateway: "models.dev"
|
|
1219
|
-
},
|
|
1220
|
-
"fireworks-ai": {
|
|
1221
|
-
url: "https://api.fireworks.ai/inference/v1/",
|
|
1222
|
-
apiKeyEnvVar: "FIREWORKS_API_KEY",
|
|
1223
|
-
apiKeyHeader: "Authorization",
|
|
1224
|
-
name: "Fireworks AI",
|
|
1225
|
-
models: [
|
|
1226
|
-
"accounts/fireworks/models/deepseek-r1-0528",
|
|
1227
|
-
"accounts/fireworks/models/deepseek-v3-0324",
|
|
1228
|
-
"accounts/fireworks/models/deepseek-v3p1",
|
|
1229
|
-
"accounts/fireworks/models/glm-4p5",
|
|
1230
|
-
"accounts/fireworks/models/glm-4p5-air",
|
|
1231
|
-
"accounts/fireworks/models/gpt-oss-120b",
|
|
1232
|
-
"accounts/fireworks/models/gpt-oss-20b",
|
|
1233
|
-
"accounts/fireworks/models/kimi-k2-instruct",
|
|
1234
|
-
"accounts/fireworks/models/qwen3-235b-a22b",
|
|
1235
|
-
"accounts/fireworks/models/qwen3-coder-480b-a35b-instruct"
|
|
1236
|
-
],
|
|
1237
|
-
docUrl: "https://fireworks.ai/docs/",
|
|
1238
|
-
gateway: "models.dev"
|
|
1239
|
-
},
|
|
1240
|
-
modelscope: {
|
|
1241
|
-
url: "https://api-inference.modelscope.cn/v1",
|
|
1242
|
-
apiKeyEnvVar: "MODELSCOPE_API_KEY",
|
|
1243
|
-
apiKeyHeader: "Authorization",
|
|
1244
|
-
name: "ModelScope",
|
|
1245
|
-
models: [
|
|
1246
|
-
"Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
1247
|
-
"Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
1248
|
-
"Qwen/Qwen3-30B-A3B-Instruct-2507",
|
|
1249
|
-
"Qwen/Qwen3-30B-A3B-Thinking-2507",
|
|
1250
|
-
"Qwen/Qwen3-Coder-30B-A3B-Instruct",
|
|
1251
|
-
"Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
1252
|
-
"ZhipuAI/GLM-4.5"
|
|
1253
|
-
],
|
|
1254
|
-
docUrl: "https://modelscope.cn/docs/model-service/API-Inference/intro",
|
|
1255
|
-
gateway: "models.dev"
|
|
1256
|
-
},
|
|
1257
|
-
llama: {
|
|
1258
|
-
url: "https://api.llama.com/compat/v1/",
|
|
1259
|
-
apiKeyEnvVar: "LLAMA_API_KEY",
|
|
1260
|
-
apiKeyHeader: "Authorization",
|
|
1261
|
-
name: "Llama",
|
|
1262
|
-
models: [
|
|
1263
|
-
"cerebras-llama-4-maverick-17b-128e-instruct",
|
|
1264
|
-
"cerebras-llama-4-scout-17b-16e-instruct",
|
|
1265
|
-
"groq-llama-4-maverick-17b-128e-instruct",
|
|
1266
|
-
"llama-3.3-70b-instruct",
|
|
1267
|
-
"llama-3.3-8b-instruct",
|
|
1268
|
-
"llama-4-maverick-17b-128e-instruct-fp8",
|
|
1269
|
-
"llama-4-scout-17b-16e-instruct-fp8"
|
|
1270
|
-
],
|
|
1271
|
-
docUrl: "https://llama.developer.meta.com/docs/models",
|
|
1272
|
-
gateway: "models.dev"
|
|
1273
|
-
},
|
|
1274
|
-
cerebras: {
|
|
1275
|
-
url: "https://api.cerebras.ai/v1",
|
|
1276
|
-
apiKeyEnvVar: "CEREBRAS_API_KEY",
|
|
1277
|
-
apiKeyHeader: "Authorization",
|
|
1278
|
-
name: "Cerebras",
|
|
1279
|
-
models: ["gpt-oss-120b", "qwen-3-235b-a22b-instruct-2507", "qwen-3-coder-480b"],
|
|
1280
|
-
docUrl: "https://inference-docs.cerebras.ai/models/overview",
|
|
1281
|
-
gateway: "models.dev"
|
|
1282
|
-
},
|
|
1283
|
-
netlify: {
|
|
1284
|
-
apiKeyEnvVar: ["NETLIFY_TOKEN", "NETLIFY_SITE_ID"],
|
|
1285
|
-
apiKeyHeader: "Authorization",
|
|
1286
|
-
name: "Netlify",
|
|
1287
|
-
gateway: "netlify",
|
|
1288
|
-
models: [
|
|
1289
|
-
"anthropic/claude-opus-4-20250514",
|
|
1290
|
-
"anthropic/claude-3-7-sonnet-20250219",
|
|
1291
|
-
"anthropic/claude-3-7-sonnet-latest",
|
|
1292
|
-
"anthropic/claude-3-haiku-20240307",
|
|
1293
|
-
"anthropic/claude-opus-4-1-20250805",
|
|
1294
|
-
"anthropic/claude-sonnet-4-5-20250929",
|
|
1295
|
-
"anthropic/claude-sonnet-4-20250514",
|
|
1296
|
-
"anthropic/claude-3-5-haiku-20241022",
|
|
1297
|
-
"anthropic/claude-3-5-haiku-latest",
|
|
1298
|
-
"gemini/gemini-2.0-flash-lite",
|
|
1299
|
-
"gemini/gemini-2.5-flash-image-preview",
|
|
1300
|
-
"gemini/gemini-2.5-pro",
|
|
1301
|
-
"gemini/gemini-flash-latest",
|
|
1302
|
-
"gemini/gemini-2.5-flash-preview-09-2025",
|
|
1303
|
-
"gemini/gemini-flash-lite-latest",
|
|
1304
|
-
"gemini/gemini-2.5-flash",
|
|
1305
|
-
"gemini/gemini-2.5-flash-lite-preview-09-2025",
|
|
1306
|
-
"gemini/gemini-2.5-flash-lite",
|
|
1307
|
-
"gemini/gemini-2.0-flash",
|
|
1308
|
-
"openai/gpt-4o",
|
|
1309
|
-
"openai/gpt-4o-mini",
|
|
1310
|
-
"openai/o4-mini",
|
|
1311
|
-
"openai/o3",
|
|
1312
|
-
"openai/gpt-5-pro",
|
|
1313
|
-
"openai/gpt-5",
|
|
1314
|
-
"openai/gpt-5-codex",
|
|
1315
|
-
"openai/gpt-5-mini",
|
|
1316
|
-
"openai/gpt-5-nano",
|
|
1317
|
-
"openai/gpt-4.1",
|
|
1318
|
-
"openai/o3-mini",
|
|
1319
|
-
"openai/codex-mini-latest",
|
|
1320
|
-
"openai/gpt-4.1-mini",
|
|
1321
|
-
"openai/gpt-4.1-nano"
|
|
1322
|
-
],
|
|
1323
|
-
docUrl: "https://docs.netlify.com/build/ai-gateway/overview/"
|
|
1324
|
-
}
|
|
1325
|
-
};
|
|
1326
|
-
function getProviderConfig(providerId) {
|
|
1327
|
-
return PROVIDER_REGISTRY[providerId];
|
|
1328
|
-
}
|
|
1329
|
-
function parseModelString(modelString) {
|
|
1330
|
-
const firstSlashIndex = modelString.indexOf("/");
|
|
1331
|
-
if (firstSlashIndex !== -1) {
|
|
1332
|
-
const provider = modelString.substring(0, firstSlashIndex);
|
|
1333
|
-
const modelId = modelString.substring(firstSlashIndex + 1);
|
|
1334
|
-
if (provider && modelId) {
|
|
1335
|
-
return {
|
|
1336
|
-
provider,
|
|
1337
|
-
modelId
|
|
1338
|
-
};
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
return {
|
|
1342
|
-
provider: null,
|
|
1343
|
-
modelId: modelString
|
|
1344
|
-
};
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
// src/llm/model/router.ts
|
|
1348
|
-
function getStaticProvidersByGateway(name) {
|
|
1349
|
-
return Object.fromEntries(Object.entries(PROVIDER_REGISTRY).filter(([_provider, config]) => config.gateway === name));
|
|
1350
|
-
}
|
|
1351
|
-
var gateways = [new NetlifyGateway(), new ModelsDevGateway(getStaticProvidersByGateway(`models.dev`))];
|
|
1352
|
-
var ModelRouterLanguageModel = class _ModelRouterLanguageModel {
|
|
1353
|
-
specificationVersion = "v2";
|
|
1354
|
-
defaultObjectGenerationMode = "json";
|
|
1355
|
-
supportsStructuredOutputs = true;
|
|
1356
|
-
supportsImageUrls = true;
|
|
1357
|
-
supportedUrls = {};
|
|
1358
|
-
modelId;
|
|
1359
|
-
provider;
|
|
1360
|
-
config;
|
|
1361
|
-
gateway;
|
|
1362
|
-
constructor(config) {
|
|
1363
|
-
if (typeof config === `string`) config = { id: config };
|
|
1364
|
-
const parsedConfig = { ...config, routerId: config.id };
|
|
1365
|
-
this.gateway = findGatewayForModel(config.id, gateways);
|
|
1366
|
-
const parsed = parseModelRouterId(config.id, this.gateway.prefix);
|
|
1367
|
-
this.provider = parsed.providerId || "openai-compatible";
|
|
1368
|
-
if (parsed.providerId && parsed.modelId !== config.id) {
|
|
1369
|
-
parsedConfig.id = parsed.modelId;
|
|
1370
|
-
}
|
|
1371
|
-
this.modelId = parsedConfig.id;
|
|
1372
|
-
this.config = parsedConfig;
|
|
1373
|
-
this.gateway = findGatewayForModel(parsedConfig.routerId, gateways);
|
|
1374
|
-
}
|
|
1375
|
-
async doGenerate() {
|
|
1376
|
-
throw new Error(
|
|
1377
|
-
"doGenerate is not supported by Mastra model router. Mastra only uses streaming (doStream) for all LLM calls."
|
|
1378
|
-
);
|
|
1379
|
-
}
|
|
1380
|
-
async doStream(options) {
|
|
1381
|
-
let apiKey;
|
|
1382
|
-
try {
|
|
1383
|
-
apiKey = await this.gateway.getApiKey(this.config.routerId);
|
|
1384
|
-
} catch (error) {
|
|
1385
|
-
return {
|
|
1386
|
-
stream: new ReadableStream({
|
|
1387
|
-
start(controller) {
|
|
1388
|
-
controller.enqueue({
|
|
1389
|
-
type: "error",
|
|
1390
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
})
|
|
1394
|
-
};
|
|
1395
|
-
}
|
|
1396
|
-
const model = await this.resolveLanguageModel({
|
|
1397
|
-
apiKey,
|
|
1398
|
-
...parseModelRouterId(this.config.routerId, this.gateway.prefix)
|
|
1399
|
-
});
|
|
1400
|
-
return model.doStream(options);
|
|
1401
|
-
}
|
|
1402
|
-
async resolveLanguageModel({
|
|
1403
|
-
modelId,
|
|
1404
|
-
providerId,
|
|
1405
|
-
apiKey
|
|
1406
|
-
}) {
|
|
1407
|
-
const key = createHash("sha256").update(this.gateway.name + modelId + providerId + apiKey).digest("hex");
|
|
1408
|
-
if (_ModelRouterLanguageModel.modelInstances.has(key)) return _ModelRouterLanguageModel.modelInstances.get(key);
|
|
1409
|
-
const modelInstance = await this.gateway.resolveLanguageModel({ modelId, providerId, apiKey });
|
|
1410
|
-
_ModelRouterLanguageModel.modelInstances.set(key, modelInstance);
|
|
1411
|
-
return modelInstance;
|
|
1412
|
-
}
|
|
1413
|
-
static modelInstances = /* @__PURE__ */ new Map();
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
export { ModelRouterLanguageModel, PROVIDER_REGISTRY, getProviderConfig, parseModelString };
|
|
1417
|
-
//# sourceMappingURL=chunk-BZ6BIHLE.js.map
|
|
1418
|
-
//# sourceMappingURL=chunk-BZ6BIHLE.js.map
|