@clinebot/llms 0.0.20 → 0.0.22
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/dist/config-browser.d.ts +1 -0
- package/dist/config-browser.d.ts.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.browser.js +5 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -12
- package/dist/models/generated-access.d.ts +1 -0
- package/dist/models/generated-access.d.ts.map +1 -0
- package/dist/models/generated-provider-loaders.d.ts +1 -0
- package/dist/models/generated-provider-loaders.d.ts.map +1 -0
- package/dist/models/generated.d.ts +1 -0
- package/dist/models/generated.d.ts.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/models-dev-catalog.d.ts +1 -0
- package/dist/models/models-dev-catalog.d.ts.map +1 -0
- package/dist/models/providers/aihubmix.d.ts +1 -0
- package/dist/models/providers/aihubmix.d.ts.map +1 -0
- package/dist/models/providers/anthropic.d.ts +1 -0
- package/dist/models/providers/anthropic.d.ts.map +1 -0
- package/dist/models/providers/asksage.d.ts +1 -0
- package/dist/models/providers/asksage.d.ts.map +1 -0
- package/dist/models/providers/baseten.d.ts +1 -0
- package/dist/models/providers/baseten.d.ts.map +1 -0
- package/dist/models/providers/bedrock.d.ts +1 -0
- package/dist/models/providers/bedrock.d.ts.map +1 -0
- package/dist/models/providers/cerebras.d.ts +1 -0
- package/dist/models/providers/cerebras.d.ts.map +1 -0
- package/dist/models/providers/claude-code.d.ts +1 -0
- package/dist/models/providers/claude-code.d.ts.map +1 -0
- package/dist/models/providers/cline.d.ts +1 -0
- package/dist/models/providers/cline.d.ts.map +1 -0
- package/dist/models/providers/deepseek.d.ts +1 -0
- package/dist/models/providers/deepseek.d.ts.map +1 -0
- package/dist/models/providers/dify.d.ts +1 -0
- package/dist/models/providers/dify.d.ts.map +1 -0
- package/dist/models/providers/doubao.d.ts +1 -0
- package/dist/models/providers/doubao.d.ts.map +1 -0
- package/dist/models/providers/fireworks.d.ts +1 -0
- package/dist/models/providers/fireworks.d.ts.map +1 -0
- package/dist/models/providers/gemini.d.ts +1 -0
- package/dist/models/providers/gemini.d.ts.map +1 -0
- package/dist/models/providers/groq.d.ts +1 -0
- package/dist/models/providers/groq.d.ts.map +1 -0
- package/dist/models/providers/hicap.d.ts +1 -0
- package/dist/models/providers/hicap.d.ts.map +1 -0
- package/dist/models/providers/huawei-cloud-maas.d.ts +1 -0
- package/dist/models/providers/huawei-cloud-maas.d.ts.map +1 -0
- package/dist/models/providers/huggingface.d.ts +1 -0
- package/dist/models/providers/huggingface.d.ts.map +1 -0
- package/dist/models/providers/index.d.ts +1 -0
- package/dist/models/providers/index.d.ts.map +1 -0
- package/dist/models/providers/litellm.d.ts +1 -0
- package/dist/models/providers/litellm.d.ts.map +1 -0
- package/dist/models/providers/lmstudio.d.ts +1 -0
- package/dist/models/providers/lmstudio.d.ts.map +1 -0
- package/dist/models/providers/minimax.d.ts +1 -0
- package/dist/models/providers/minimax.d.ts.map +1 -0
- package/dist/models/providers/mistral.d.ts +1 -0
- package/dist/models/providers/mistral.d.ts.map +1 -0
- package/dist/models/providers/moonshot.d.ts +1 -0
- package/dist/models/providers/moonshot.d.ts.map +1 -0
- package/dist/models/providers/nebius.d.ts +1 -0
- package/dist/models/providers/nebius.d.ts.map +1 -0
- package/dist/models/providers/nous-research.d.ts +1 -0
- package/dist/models/providers/nous-research.d.ts.map +1 -0
- package/dist/models/providers/oca.d.ts +1 -0
- package/dist/models/providers/oca.d.ts.map +1 -0
- package/dist/models/providers/ollama.d.ts +1 -0
- package/dist/models/providers/ollama.d.ts.map +1 -0
- package/dist/models/providers/openai-codex.d.ts +1 -0
- package/dist/models/providers/openai-codex.d.ts.map +1 -0
- package/dist/models/providers/openai.d.ts +1 -0
- package/dist/models/providers/openai.d.ts.map +1 -0
- package/dist/models/providers/opencode.d.ts +1 -0
- package/dist/models/providers/opencode.d.ts.map +1 -0
- package/dist/models/providers/openrouter.d.ts +1 -0
- package/dist/models/providers/openrouter.d.ts.map +1 -0
- package/dist/models/providers/qwen-code.d.ts +1 -0
- package/dist/models/providers/qwen-code.d.ts.map +1 -0
- package/dist/models/providers/qwen.d.ts +1 -0
- package/dist/models/providers/qwen.d.ts.map +1 -0
- package/dist/models/providers/requesty.d.ts +1 -0
- package/dist/models/providers/requesty.d.ts.map +1 -0
- package/dist/models/providers/sambanova.d.ts +1 -0
- package/dist/models/providers/sambanova.d.ts.map +1 -0
- package/dist/models/providers/sapaicore.d.ts +1 -0
- package/dist/models/providers/sapaicore.d.ts.map +1 -0
- package/dist/models/providers/together.d.ts +1 -0
- package/dist/models/providers/together.d.ts.map +1 -0
- package/dist/models/providers/vercel-ai-gateway.d.ts +1 -0
- package/dist/models/providers/vercel-ai-gateway.d.ts.map +1 -0
- package/dist/models/providers/vertex.d.ts +1 -0
- package/dist/models/providers/vertex.d.ts.map +1 -0
- package/dist/models/providers/xai.d.ts +1 -0
- package/dist/models/providers/xai.d.ts.map +1 -0
- package/dist/models/providers/zai.d.ts +1 -0
- package/dist/models/providers/zai.d.ts.map +1 -0
- package/dist/models/query.d.ts +1 -0
- package/dist/models/query.d.ts.map +1 -0
- package/dist/models/registry.d.ts +1 -0
- package/dist/models/registry.d.ts.map +1 -0
- package/dist/models/schemas/index.d.ts +1 -0
- package/dist/models/schemas/index.d.ts.map +1 -0
- package/dist/models/schemas/model.d.ts +1 -0
- package/dist/models/schemas/model.d.ts.map +1 -0
- package/dist/models/schemas/query.d.ts +1 -0
- package/dist/models/schemas/query.d.ts.map +1 -0
- package/dist/providers/handlers/ai-sdk-community.d.ts +1 -0
- package/dist/providers/handlers/ai-sdk-community.d.ts.map +1 -0
- package/dist/providers/handlers/ai-sdk-provider-base.d.ts +1 -0
- package/dist/providers/handlers/ai-sdk-provider-base.d.ts.map +1 -0
- package/dist/providers/handlers/anthropic-base.d.ts +1 -0
- package/dist/providers/handlers/anthropic-base.d.ts.map +1 -0
- package/dist/providers/handlers/asksage.d.ts +1 -0
- package/dist/providers/handlers/asksage.d.ts.map +1 -0
- package/dist/providers/handlers/auth.d.ts +1 -0
- package/dist/providers/handlers/auth.d.ts.map +1 -0
- package/dist/providers/handlers/base.d.ts +1 -0
- package/dist/providers/handlers/base.d.ts.map +1 -0
- package/dist/providers/handlers/bedrock-base.d.ts +1 -0
- package/dist/providers/handlers/bedrock-base.d.ts.map +1 -0
- package/dist/providers/handlers/bedrock-client.d.ts +1 -0
- package/dist/providers/handlers/bedrock-client.d.ts.map +1 -0
- package/dist/providers/handlers/community-sdk.d.ts +1 -0
- package/dist/providers/handlers/community-sdk.d.ts.map +1 -0
- package/dist/providers/handlers/fetch-base.d.ts +1 -0
- package/dist/providers/handlers/fetch-base.d.ts.map +1 -0
- package/dist/providers/handlers/gemini-base.d.ts +1 -0
- package/dist/providers/handlers/gemini-base.d.ts.map +1 -0
- package/dist/providers/handlers/index.d.ts +1 -0
- package/dist/providers/handlers/index.d.ts.map +1 -0
- package/dist/providers/handlers/openai-base.d.ts +1 -0
- package/dist/providers/handlers/openai-base.d.ts.map +1 -0
- package/dist/providers/handlers/openai-responses.d.ts +1 -0
- package/dist/providers/handlers/openai-responses.d.ts.map +1 -0
- package/dist/providers/handlers/providers.d.ts +1 -0
- package/dist/providers/handlers/providers.d.ts.map +1 -0
- package/dist/providers/handlers/r1-base.d.ts +1 -0
- package/dist/providers/handlers/r1-base.d.ts.map +1 -0
- package/dist/providers/handlers/registry.d.ts +1 -0
- package/dist/providers/handlers/registry.d.ts.map +1 -0
- package/dist/providers/handlers/vertex.d.ts +1 -0
- package/dist/providers/handlers/vertex.d.ts.map +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/public.browser.d.ts +1 -0
- package/dist/providers/public.browser.d.ts.map +1 -0
- package/dist/providers/public.d.ts +1 -0
- package/dist/providers/public.d.ts.map +1 -0
- package/dist/providers/shared/openai-compatible.d.ts +1 -0
- package/dist/providers/shared/openai-compatible.d.ts.map +1 -0
- package/dist/providers/transform/ai-sdk-community-format.d.ts +1 -0
- package/dist/providers/transform/ai-sdk-community-format.d.ts.map +1 -0
- package/dist/providers/transform/anthropic-format.d.ts +1 -0
- package/dist/providers/transform/anthropic-format.d.ts.map +1 -0
- package/dist/providers/transform/content-format.d.ts +1 -0
- package/dist/providers/transform/content-format.d.ts.map +1 -0
- package/dist/providers/transform/gemini-format.d.ts +1 -0
- package/dist/providers/transform/gemini-format.d.ts.map +1 -0
- package/dist/providers/transform/index.d.ts +1 -0
- package/dist/providers/transform/index.d.ts.map +1 -0
- package/dist/providers/transform/openai-format.d.ts +1 -0
- package/dist/providers/transform/openai-format.d.ts.map +1 -0
- package/dist/providers/transform/r1-format.d.ts +1 -0
- package/dist/providers/transform/r1-format.d.ts.map +1 -0
- package/dist/providers/types/config.d.ts +1 -0
- package/dist/providers/types/config.d.ts.map +1 -0
- package/dist/providers/types/handler.d.ts +1 -0
- package/dist/providers/types/handler.d.ts.map +1 -0
- package/dist/providers/types/index.d.ts +1 -0
- package/dist/providers/types/index.d.ts.map +1 -0
- package/dist/providers/types/messages.d.ts +1 -0
- package/dist/providers/types/messages.d.ts.map +1 -0
- package/dist/providers/types/model-info.d.ts +1 -0
- package/dist/providers/types/model-info.d.ts.map +1 -0
- package/dist/providers/types/provider-ids.d.ts +1 -1
- package/dist/providers/types/provider-ids.d.ts.map +1 -0
- package/dist/providers/types/settings.d.ts +1 -0
- package/dist/providers/types/settings.d.ts.map +1 -0
- package/dist/providers/types/stream.d.ts +1 -0
- package/dist/providers/types/stream.d.ts.map +1 -0
- package/dist/providers/utils/index.d.ts +1 -0
- package/dist/providers/utils/index.d.ts.map +1 -0
- package/dist/providers/utils/retry.d.ts +1 -0
- package/dist/providers/utils/retry.d.ts.map +1 -0
- package/dist/providers/utils/stream-processor.d.ts +1 -0
- package/dist/providers/utils/stream-processor.d.ts.map +1 -0
- package/dist/providers/utils/tool-processor.d.ts +1 -0
- package/dist/providers/utils/tool-processor.d.ts.map +1 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +3 -4
- package/src/catalog.ts +0 -20
- package/src/config-browser.ts +0 -11
- package/src/config.ts +0 -49
- package/src/index.browser.ts +0 -9
- package/src/index.ts +0 -10
- package/src/live-providers.test.ts +0 -138
- package/src/models/generated-access.ts +0 -41
- package/src/models/generated-provider-loaders.ts +0 -166
- package/src/models/generated.ts +0 -11785
- package/src/models/index.ts +0 -271
- package/src/models/models-dev-catalog.test.ts +0 -161
- package/src/models/models-dev-catalog.ts +0 -168
- package/src/models/providers/aihubmix.ts +0 -19
- package/src/models/providers/anthropic.ts +0 -60
- package/src/models/providers/asksage.ts +0 -19
- package/src/models/providers/baseten.ts +0 -21
- package/src/models/providers/bedrock.ts +0 -30
- package/src/models/providers/cerebras.ts +0 -24
- package/src/models/providers/claude-code.ts +0 -51
- package/src/models/providers/cline.ts +0 -25
- package/src/models/providers/deepseek.ts +0 -33
- package/src/models/providers/dify.ts +0 -17
- package/src/models/providers/doubao.ts +0 -33
- package/src/models/providers/fireworks.ts +0 -34
- package/src/models/providers/gemini.ts +0 -43
- package/src/models/providers/groq.ts +0 -33
- package/src/models/providers/hicap.ts +0 -18
- package/src/models/providers/huawei-cloud-maas.ts +0 -18
- package/src/models/providers/huggingface.ts +0 -22
- package/src/models/providers/index.ts +0 -162
- package/src/models/providers/litellm.ts +0 -19
- package/src/models/providers/lmstudio.ts +0 -22
- package/src/models/providers/minimax.ts +0 -34
- package/src/models/providers/mistral.ts +0 -19
- package/src/models/providers/moonshot.ts +0 -34
- package/src/models/providers/nebius.ts +0 -24
- package/src/models/providers/nous-research.ts +0 -21
- package/src/models/providers/oca.ts +0 -30
- package/src/models/providers/ollama.ts +0 -18
- package/src/models/providers/openai-codex.ts +0 -46
- package/src/models/providers/openai.ts +0 -43
- package/src/models/providers/opencode.ts +0 -28
- package/src/models/providers/openrouter.ts +0 -24
- package/src/models/providers/qwen-code.ts +0 -33
- package/src/models/providers/qwen.ts +0 -34
- package/src/models/providers/requesty.ts +0 -23
- package/src/models/providers/sambanova.ts +0 -23
- package/src/models/providers/sapaicore.ts +0 -34
- package/src/models/providers/together.ts +0 -35
- package/src/models/providers/vercel-ai-gateway.ts +0 -23
- package/src/models/providers/vertex.ts +0 -36
- package/src/models/providers/xai.ts +0 -34
- package/src/models/providers/zai.ts +0 -25
- package/src/models/query.ts +0 -407
- package/src/models/registry.ts +0 -511
- package/src/models/schemas/index.ts +0 -62
- package/src/models/schemas/model.ts +0 -308
- package/src/models/schemas/query.ts +0 -336
- package/src/providers/browser.ts +0 -4
- package/src/providers/handlers/ai-sdk-community.ts +0 -229
- package/src/providers/handlers/ai-sdk-provider-base.ts +0 -203
- package/src/providers/handlers/anthropic-base.test.ts +0 -30
- package/src/providers/handlers/anthropic-base.ts +0 -387
- package/src/providers/handlers/asksage.test.ts +0 -103
- package/src/providers/handlers/asksage.ts +0 -138
- package/src/providers/handlers/auth.test.ts +0 -19
- package/src/providers/handlers/auth.ts +0 -121
- package/src/providers/handlers/base.test.ts +0 -230
- package/src/providers/handlers/base.ts +0 -310
- package/src/providers/handlers/bedrock-base.ts +0 -390
- package/src/providers/handlers/bedrock-client.ts +0 -100
- package/src/providers/handlers/codex.test.ts +0 -160
- package/src/providers/handlers/community-sdk.test.ts +0 -321
- package/src/providers/handlers/community-sdk.ts +0 -391
- package/src/providers/handlers/fetch-base.ts +0 -68
- package/src/providers/handlers/gemini-base.test.ts +0 -261
- package/src/providers/handlers/gemini-base.ts +0 -307
- package/src/providers/handlers/index.ts +0 -67
- package/src/providers/handlers/openai-base.ts +0 -341
- package/src/providers/handlers/openai-responses.test.ts +0 -259
- package/src/providers/handlers/openai-responses.ts +0 -634
- package/src/providers/handlers/providers.test.ts +0 -120
- package/src/providers/handlers/providers.ts +0 -563
- package/src/providers/handlers/r1-base.ts +0 -283
- package/src/providers/handlers/registry.ts +0 -185
- package/src/providers/handlers/vertex.test.ts +0 -124
- package/src/providers/handlers/vertex.ts +0 -302
- package/src/providers/index.ts +0 -534
- package/src/providers/public.browser.ts +0 -20
- package/src/providers/public.ts +0 -51
- package/src/providers/shared/openai-compatible.ts +0 -63
- package/src/providers/transform/ai-sdk-community-format.test.ts +0 -73
- package/src/providers/transform/ai-sdk-community-format.ts +0 -115
- package/src/providers/transform/anthropic-format.ts +0 -230
- package/src/providers/transform/content-format.ts +0 -34
- package/src/providers/transform/format-conversion.test.ts +0 -413
- package/src/providers/transform/gemini-format.ts +0 -262
- package/src/providers/transform/index.ts +0 -22
- package/src/providers/transform/openai-format.ts +0 -290
- package/src/providers/transform/r1-format.ts +0 -287
- package/src/providers/types/config.ts +0 -396
- package/src/providers/types/handler.ts +0 -92
- package/src/providers/types/index.ts +0 -120
- package/src/providers/types/messages.ts +0 -162
- package/src/providers/types/model-info.test.ts +0 -57
- package/src/providers/types/model-info.ts +0 -65
- package/src/providers/types/provider-ids.test.ts +0 -12
- package/src/providers/types/provider-ids.ts +0 -89
- package/src/providers/types/settings.test.ts +0 -49
- package/src/providers/types/settings.ts +0 -533
- package/src/providers/types/stream.ts +0 -117
- package/src/providers/utils/index.ts +0 -27
- package/src/providers/utils/retry.test.ts +0 -140
- package/src/providers/utils/retry.ts +0 -188
- package/src/providers/utils/stream-processor.test.ts +0 -232
- package/src/providers/utils/stream-processor.ts +0 -472
- package/src/providers/utils/tool-processor.test.ts +0 -235
- package/src/providers/utils/tool-processor.ts +0 -146
- package/src/sdk.ts +0 -264
- package/src/types.ts +0 -79
package/src/models/index.ts
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @clinebot/models
|
|
3
|
-
*
|
|
4
|
-
* Model definitions and registry for all supported AI providers.
|
|
5
|
-
*
|
|
6
|
-
* This package provides:
|
|
7
|
-
* - Type-safe model definitions using Zod schemas
|
|
8
|
-
* - A central registry for accessing models across providers
|
|
9
|
-
* - Powerful query API for filtering models by capabilities, pricing, etc.
|
|
10
|
-
* - Support for custom models and runtime registration
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import {
|
|
15
|
-
* queryModels,
|
|
16
|
-
* createQuery,
|
|
17
|
-
* getModel,
|
|
18
|
-
* ANTHROPIC_MODELS,
|
|
19
|
-
* } from "@clinebot/models"
|
|
20
|
-
*
|
|
21
|
-
* // Get all models with vision support
|
|
22
|
-
* const visionModels = queryModels({
|
|
23
|
-
* capabilities: ["images"],
|
|
24
|
-
* })
|
|
25
|
-
*
|
|
26
|
-
* // Use fluent query builder
|
|
27
|
-
* const cheapModels = createQuery()
|
|
28
|
-
* .fromProviders(["anthropic", "openai"])
|
|
29
|
-
* .maxPrice({ input: 5 })
|
|
30
|
-
* .withCapabilities(["reasoning"])
|
|
31
|
-
* .execute()
|
|
32
|
-
*
|
|
33
|
-
* // Access specific model info
|
|
34
|
-
* const claude = getModel("anthropic", "claude-sonnet-4-20250514")
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @packageDocumentation
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
// =============================================================================
|
|
41
|
-
// Schema Exports (Types & Validation)
|
|
42
|
-
// =============================================================================
|
|
43
|
-
|
|
44
|
-
export {
|
|
45
|
-
// API Format
|
|
46
|
-
ApiFormat,
|
|
47
|
-
ApiFormatSchema,
|
|
48
|
-
type ApiFormatType,
|
|
49
|
-
getPricing,
|
|
50
|
-
// Model Helpers
|
|
51
|
-
hasCapability,
|
|
52
|
-
isActive,
|
|
53
|
-
isDeprecated,
|
|
54
|
-
type ModelCapability,
|
|
55
|
-
// Model Capabilities
|
|
56
|
-
ModelCapabilitySchema,
|
|
57
|
-
type ModelCollection,
|
|
58
|
-
ModelCollectionSchema,
|
|
59
|
-
type ModelEntry,
|
|
60
|
-
// Model Entry
|
|
61
|
-
ModelEntrySchema,
|
|
62
|
-
type ModelInfo,
|
|
63
|
-
// Model Info
|
|
64
|
-
ModelInfoSchema,
|
|
65
|
-
// Query Match
|
|
66
|
-
type ModelMatch,
|
|
67
|
-
type ModelPricing,
|
|
68
|
-
// Pricing
|
|
69
|
-
ModelPricingSchema,
|
|
70
|
-
type ModelQueryConfig,
|
|
71
|
-
// Query Config
|
|
72
|
-
ModelQueryConfigSchema,
|
|
73
|
-
type ModelQueryResult,
|
|
74
|
-
// Query Result
|
|
75
|
-
ModelQueryResultSchema,
|
|
76
|
-
type ModelStatus,
|
|
77
|
-
// Model Status
|
|
78
|
-
ModelStatusSchema,
|
|
79
|
-
// Query Helpers
|
|
80
|
-
matchesQuery,
|
|
81
|
-
type ProviderCapability,
|
|
82
|
-
// Provider
|
|
83
|
-
ProviderCapabilitySchema,
|
|
84
|
-
type ProviderInfo,
|
|
85
|
-
ProviderInfoSchema,
|
|
86
|
-
safeValidateModelInfo,
|
|
87
|
-
safeValidateQueryConfig,
|
|
88
|
-
sortModels,
|
|
89
|
-
type ThinkingConfig,
|
|
90
|
-
// Thinking Config
|
|
91
|
-
ThinkingConfigSchema,
|
|
92
|
-
validateModelInfo,
|
|
93
|
-
validateQueryConfig,
|
|
94
|
-
} from "./schemas/index";
|
|
95
|
-
|
|
96
|
-
// =============================================================================
|
|
97
|
-
// Registry Exports
|
|
98
|
-
// =============================================================================
|
|
99
|
-
|
|
100
|
-
export {
|
|
101
|
-
clearCustomModels,
|
|
102
|
-
deprecateModel,
|
|
103
|
-
getAllModels,
|
|
104
|
-
// Provider Access
|
|
105
|
-
getAllProviders,
|
|
106
|
-
getDefaultModel,
|
|
107
|
-
getModel,
|
|
108
|
-
getModelCount,
|
|
109
|
-
// Model Access
|
|
110
|
-
getModelsForProvider,
|
|
111
|
-
getProvider,
|
|
112
|
-
getProviderCollection,
|
|
113
|
-
getProviderIds,
|
|
114
|
-
hasProvider,
|
|
115
|
-
registerModel,
|
|
116
|
-
registerModels,
|
|
117
|
-
// Registration
|
|
118
|
-
registerProvider,
|
|
119
|
-
resetRegistry,
|
|
120
|
-
unregisterModel,
|
|
121
|
-
unregisterProvider,
|
|
122
|
-
// Updates
|
|
123
|
-
updateModel,
|
|
124
|
-
} from "./registry";
|
|
125
|
-
|
|
126
|
-
// =============================================================================
|
|
127
|
-
// Query API Exports
|
|
128
|
-
// =============================================================================
|
|
129
|
-
|
|
130
|
-
export {
|
|
131
|
-
createQuery,
|
|
132
|
-
getActiveModels,
|
|
133
|
-
getCachingModels,
|
|
134
|
-
getComputerUseModels,
|
|
135
|
-
getDeprecatedModels,
|
|
136
|
-
// Statistics
|
|
137
|
-
getModelStatistics,
|
|
138
|
-
getModelsByProvider,
|
|
139
|
-
getModelsInPriceRange,
|
|
140
|
-
getModelsWithContextWindow,
|
|
141
|
-
getReasoningModels,
|
|
142
|
-
getToolModels,
|
|
143
|
-
// Convenience Queries
|
|
144
|
-
getVisionModels,
|
|
145
|
-
// Query Builder
|
|
146
|
-
ModelQueryBuilder,
|
|
147
|
-
// Main Query Function
|
|
148
|
-
queryModels,
|
|
149
|
-
searchModels,
|
|
150
|
-
} from "./query";
|
|
151
|
-
|
|
152
|
-
// =============================================================================
|
|
153
|
-
// Generated Catalog Exports
|
|
154
|
-
// =============================================================================
|
|
155
|
-
|
|
156
|
-
export {
|
|
157
|
-
getGeneratedModelsForProvider,
|
|
158
|
-
getGeneratedModelsVersion,
|
|
159
|
-
getGeneratedProviderModels,
|
|
160
|
-
} from "./generated-access";
|
|
161
|
-
|
|
162
|
-
// =============================================================================
|
|
163
|
-
// Provider Model Exports
|
|
164
|
-
// =============================================================================
|
|
165
|
-
|
|
166
|
-
export {
|
|
167
|
-
AIHUBMIX_PROVIDER,
|
|
168
|
-
ANTHROPIC_DEFAULT_MODEL,
|
|
169
|
-
// Anthropic
|
|
170
|
-
ANTHROPIC_MODELS,
|
|
171
|
-
ANTHROPIC_PROVIDER,
|
|
172
|
-
ASKSAGE_PROVIDER,
|
|
173
|
-
// Other Providers
|
|
174
|
-
BASETEN_PROVIDER,
|
|
175
|
-
BEDROCK_DEFAULT_MODEL,
|
|
176
|
-
BEDROCK_MODELS,
|
|
177
|
-
BEDROCK_PROVIDER,
|
|
178
|
-
CEREBRAS_DEFAULT_MODEL,
|
|
179
|
-
// Cerebras
|
|
180
|
-
CEREBRAS_MODELS,
|
|
181
|
-
CEREBRAS_PROVIDER,
|
|
182
|
-
CLAUDE_CODE_DEFAULT_MODEL,
|
|
183
|
-
CLAUDE_CODE_MODELS,
|
|
184
|
-
CLAUDE_CODE_PROVIDER,
|
|
185
|
-
CLINE_DEFAULT_MODEL,
|
|
186
|
-
CLINE_MODELS,
|
|
187
|
-
CLINE_PROVIDER,
|
|
188
|
-
DEEPSEEK_DEFAULT_MODEL,
|
|
189
|
-
// DeepSeek
|
|
190
|
-
DEEPSEEK_MODELS,
|
|
191
|
-
DEEPSEEK_PROVIDER,
|
|
192
|
-
DEFAULT_EXTERNAL_OCA_BASE_URL,
|
|
193
|
-
DEFAULT_INTERNAL_OCA_BASE_URL,
|
|
194
|
-
DIFY_PROVIDER,
|
|
195
|
-
FIREWORKS_DEFAULT_MODEL,
|
|
196
|
-
// Fireworks
|
|
197
|
-
FIREWORKS_MODELS,
|
|
198
|
-
FIREWORKS_PROVIDER,
|
|
199
|
-
GEMINI_DEFAULT_MODEL,
|
|
200
|
-
// Gemini
|
|
201
|
-
GEMINI_MODELS,
|
|
202
|
-
GEMINI_PROVIDER,
|
|
203
|
-
GROQ_DEFAULT_MODEL,
|
|
204
|
-
// Groq
|
|
205
|
-
GROQ_MODELS,
|
|
206
|
-
GROQ_PROVIDER,
|
|
207
|
-
// Helpers
|
|
208
|
-
getActiveAnthropicModels,
|
|
209
|
-
getActiveGeminiModels,
|
|
210
|
-
getActiveOpenAIModels,
|
|
211
|
-
getActiveXAIModels,
|
|
212
|
-
getAnthropicReasoningModels,
|
|
213
|
-
getDeepSeekReasoningModels,
|
|
214
|
-
getFireworksFunctionModels,
|
|
215
|
-
getGeminiThinkingModels,
|
|
216
|
-
getGroqVisionModels,
|
|
217
|
-
getOpenAIReasoningModels,
|
|
218
|
-
getTogetherLlamaModels,
|
|
219
|
-
HICAP_PROVIDER,
|
|
220
|
-
HUAWEI_CLOUD_MAAS_PROVIDER,
|
|
221
|
-
HUGGINGFACE_PROVIDER,
|
|
222
|
-
LITELLM_PROVIDER,
|
|
223
|
-
LMSTUDIO_PROVIDER,
|
|
224
|
-
MINIMAX_DEFAULT_MODEL,
|
|
225
|
-
MINIMAX_MODELS,
|
|
226
|
-
MINIMAX_PROVIDER,
|
|
227
|
-
MISTRAL_PROVIDER,
|
|
228
|
-
MOONSHOT_DEFAULT_MODEL,
|
|
229
|
-
MOONSHOT_MODELS,
|
|
230
|
-
MOONSHOT_PROVIDER,
|
|
231
|
-
NEBIUS_DEFAULT_MODEL,
|
|
232
|
-
// Nebius
|
|
233
|
-
NEBIUS_MODELS,
|
|
234
|
-
NEBIUS_PROVIDER,
|
|
235
|
-
NOUS_RESEARCH_DEFAULT_MODEL,
|
|
236
|
-
// Nous Research
|
|
237
|
-
NOUS_RESEARCH_MODELS,
|
|
238
|
-
NOUS_RESEARCH_PROVIDER,
|
|
239
|
-
OCA_DEFAULT_MODEL,
|
|
240
|
-
OCA_MODELS,
|
|
241
|
-
OCA_PROVIDER,
|
|
242
|
-
// Local Providers
|
|
243
|
-
OLLAMA_PROVIDER,
|
|
244
|
-
OPENAI_CODEX_DEFAULT_MODEL,
|
|
245
|
-
OPENAI_CODEX_PROVIDER,
|
|
246
|
-
OPENAI_DEFAULT_MODEL,
|
|
247
|
-
// OpenAI
|
|
248
|
-
OPENAI_MODELS,
|
|
249
|
-
OPENAI_PROVIDER,
|
|
250
|
-
OPENROUTER_DEFAULT_MODEL,
|
|
251
|
-
OPENROUTER_MODELS,
|
|
252
|
-
OPENROUTER_PROVIDER,
|
|
253
|
-
// Gateway Providers
|
|
254
|
-
REQUESTY_PROVIDER,
|
|
255
|
-
SAMBANOVA_DEFAULT_MODEL,
|
|
256
|
-
// SambaNova
|
|
257
|
-
SAMBANOVA_MODELS,
|
|
258
|
-
SAMBANOVA_PROVIDER,
|
|
259
|
-
TOGETHER_DEFAULT_MODEL,
|
|
260
|
-
// Together
|
|
261
|
-
TOGETHER_MODELS,
|
|
262
|
-
TOGETHER_PROVIDER,
|
|
263
|
-
VERCEL_AI_GATEWAY_PROVIDER,
|
|
264
|
-
VERTEX_DEFAULT_MODEL,
|
|
265
|
-
VERTEX_MODELS,
|
|
266
|
-
VERTEX_PROVIDER,
|
|
267
|
-
XAI_DEFAULT_MODEL,
|
|
268
|
-
// xAI
|
|
269
|
-
XAI_MODELS,
|
|
270
|
-
XAI_PROVIDER,
|
|
271
|
-
} from "./providers/index";
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
fetchModelsDevProviderModels,
|
|
4
|
-
type ModelsDevPayload,
|
|
5
|
-
normalizeModelsDevProviderModels,
|
|
6
|
-
} from "./models-dev-catalog";
|
|
7
|
-
|
|
8
|
-
describe("models-dev-catalog", () => {
|
|
9
|
-
it("normalizes payload with model filtering and defaults", () => {
|
|
10
|
-
const payload: ModelsDevPayload = {
|
|
11
|
-
openai: {
|
|
12
|
-
models: {
|
|
13
|
-
"gpt-live": {
|
|
14
|
-
name: "GPT Live",
|
|
15
|
-
tool_call: true,
|
|
16
|
-
reasoning: true,
|
|
17
|
-
structured_output: true,
|
|
18
|
-
temperature: true,
|
|
19
|
-
release_date: "2026-01-01",
|
|
20
|
-
modalities: { input: ["text", "image"] },
|
|
21
|
-
limit: { context: 1_000_000 },
|
|
22
|
-
cost: { input: 1, output: 2, cache_read: 0.5, cache_write: 0.8 },
|
|
23
|
-
status: "preview",
|
|
24
|
-
},
|
|
25
|
-
"gpt-no-tools": {
|
|
26
|
-
name: "GPT No Tools",
|
|
27
|
-
tool_call: false,
|
|
28
|
-
},
|
|
29
|
-
"gpt-deprecated": {
|
|
30
|
-
name: "GPT Deprecated",
|
|
31
|
-
tool_call: true,
|
|
32
|
-
status: "deprecated",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
anthropic: {
|
|
37
|
-
models: {
|
|
38
|
-
"claude-defaults": {
|
|
39
|
-
tool_call: true,
|
|
40
|
-
status: "experimental",
|
|
41
|
-
release_date: "2025-02-01",
|
|
42
|
-
},
|
|
43
|
-
"claude-older": {
|
|
44
|
-
tool_call: true,
|
|
45
|
-
release_date: "2024-02-01",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const providerModels = normalizeModelsDevProviderModels(payload, {
|
|
52
|
-
openai: "openai-native",
|
|
53
|
-
anthropic: "anthropic",
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
expect(providerModels).toEqual({
|
|
57
|
-
"openai-native": {
|
|
58
|
-
"gpt-live": {
|
|
59
|
-
id: "gpt-live",
|
|
60
|
-
name: "GPT Live",
|
|
61
|
-
contextWindow: 1_000_000,
|
|
62
|
-
maxTokens: 4096,
|
|
63
|
-
capabilities: [
|
|
64
|
-
"images",
|
|
65
|
-
"tools",
|
|
66
|
-
"reasoning",
|
|
67
|
-
"structured_output",
|
|
68
|
-
"temperature",
|
|
69
|
-
],
|
|
70
|
-
pricing: {
|
|
71
|
-
input: 1,
|
|
72
|
-
output: 2,
|
|
73
|
-
cacheRead: 0.5,
|
|
74
|
-
cacheWrite: 0.8,
|
|
75
|
-
},
|
|
76
|
-
status: "preview",
|
|
77
|
-
releaseDate: "2026-01-01",
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
anthropic: {
|
|
81
|
-
"claude-defaults": {
|
|
82
|
-
id: "claude-defaults",
|
|
83
|
-
name: "claude-defaults",
|
|
84
|
-
contextWindow: 4096,
|
|
85
|
-
maxTokens: 204,
|
|
86
|
-
capabilities: ["tools"],
|
|
87
|
-
pricing: {
|
|
88
|
-
input: 0,
|
|
89
|
-
output: 0,
|
|
90
|
-
cacheRead: 0,
|
|
91
|
-
cacheWrite: 0,
|
|
92
|
-
},
|
|
93
|
-
status: undefined,
|
|
94
|
-
releaseDate: "2025-02-01",
|
|
95
|
-
},
|
|
96
|
-
"claude-older": {
|
|
97
|
-
id: "claude-older",
|
|
98
|
-
name: "claude-older",
|
|
99
|
-
contextWindow: 4096,
|
|
100
|
-
maxTokens: 204,
|
|
101
|
-
capabilities: ["tools"],
|
|
102
|
-
pricing: {
|
|
103
|
-
input: 0,
|
|
104
|
-
output: 0,
|
|
105
|
-
cacheRead: 0,
|
|
106
|
-
cacheWrite: 0,
|
|
107
|
-
},
|
|
108
|
-
status: undefined,
|
|
109
|
-
releaseDate: "2024-02-01",
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
expect(Object.keys(providerModels.anthropic ?? {})).toEqual([
|
|
114
|
-
"claude-defaults",
|
|
115
|
-
"claude-older",
|
|
116
|
-
]);
|
|
117
|
-
expect(providerModels["openai-native"]).not.toHaveProperty(
|
|
118
|
-
"gpt-deprecated",
|
|
119
|
-
);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it("fetches and normalizes models.dev payload", async () => {
|
|
123
|
-
const fetcher = vi.fn(async () => ({
|
|
124
|
-
ok: true,
|
|
125
|
-
json: async () =>
|
|
126
|
-
({
|
|
127
|
-
openai: {
|
|
128
|
-
models: {
|
|
129
|
-
"gpt-live": { tool_call: true },
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
}) satisfies ModelsDevPayload,
|
|
133
|
-
}));
|
|
134
|
-
|
|
135
|
-
const result = await fetchModelsDevProviderModels(
|
|
136
|
-
"https://models.dev/api.json",
|
|
137
|
-
{ openai: "openai-native" },
|
|
138
|
-
fetcher as unknown as typeof fetch,
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
expect(fetcher).toHaveBeenCalledWith("https://models.dev/api.json");
|
|
142
|
-
expect(result["openai-native"]).toHaveProperty("gpt-live");
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it("throws when models.dev request fails", async () => {
|
|
146
|
-
const fetcher = vi.fn(async () => ({
|
|
147
|
-
ok: false,
|
|
148
|
-
status: 503,
|
|
149
|
-
}));
|
|
150
|
-
|
|
151
|
-
await expect(
|
|
152
|
-
fetchModelsDevProviderModels(
|
|
153
|
-
"https://models.dev/api.json",
|
|
154
|
-
{ openai: "openai-native" },
|
|
155
|
-
fetcher as unknown as typeof fetch,
|
|
156
|
-
),
|
|
157
|
-
).rejects.toThrow(
|
|
158
|
-
"Failed to load model catalog from https://models.dev/api.json: HTTP 503",
|
|
159
|
-
);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import type { ModelInfo } from "./schemas/index";
|
|
2
|
-
|
|
3
|
-
export interface ModelsDevModel {
|
|
4
|
-
name?: string;
|
|
5
|
-
tool_call?: boolean;
|
|
6
|
-
reasoning?: boolean;
|
|
7
|
-
structured_output?: boolean;
|
|
8
|
-
temperature?: boolean;
|
|
9
|
-
release_date?: string;
|
|
10
|
-
limit?: {
|
|
11
|
-
context?: number;
|
|
12
|
-
output?: number;
|
|
13
|
-
};
|
|
14
|
-
cost?: {
|
|
15
|
-
input?: number;
|
|
16
|
-
output?: number;
|
|
17
|
-
cache_read?: number;
|
|
18
|
-
cache_write?: number;
|
|
19
|
-
};
|
|
20
|
-
modalities?: {
|
|
21
|
-
input?: string[];
|
|
22
|
-
};
|
|
23
|
-
status?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface ModelsDevProviderPayload {
|
|
27
|
-
models?: Record<string, ModelsDevModel>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type ModelsDevPayload = Record<string, ModelsDevProviderPayload>;
|
|
31
|
-
export type ModelsDevProviderKeyMap = Record<string, string>;
|
|
32
|
-
|
|
33
|
-
const DEFAULT_CONTEXT_WINDOW = 4096;
|
|
34
|
-
const DEFAULT_MAX_TOKENS = 4096;
|
|
35
|
-
|
|
36
|
-
function parseReleaseDate(value: string | undefined): number {
|
|
37
|
-
if (!value) {
|
|
38
|
-
return Number.NEGATIVE_INFINITY;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const timestamp = Date.parse(value);
|
|
42
|
-
return Number.isNaN(timestamp) ? Number.NEGATIVE_INFINITY : timestamp;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function sortModelsByReleaseDate(
|
|
46
|
-
models: Record<string, ModelInfo>,
|
|
47
|
-
): Record<string, ModelInfo> {
|
|
48
|
-
return Object.fromEntries(
|
|
49
|
-
Object.entries(models).sort(([modelIdA, modelA], [modelIdB, modelB]) => {
|
|
50
|
-
const releaseDateA = parseReleaseDate(modelA.releaseDate);
|
|
51
|
-
const releaseDateB = parseReleaseDate(modelB.releaseDate);
|
|
52
|
-
if (releaseDateA !== releaseDateB) {
|
|
53
|
-
return releaseDateB - releaseDateA;
|
|
54
|
-
}
|
|
55
|
-
return modelIdA.localeCompare(modelIdB);
|
|
56
|
-
}),
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function toCapabilities(model: ModelsDevModel): ModelInfo["capabilities"] {
|
|
61
|
-
const capabilities: NonNullable<ModelInfo["capabilities"]> = [];
|
|
62
|
-
if (model.modalities?.input?.includes("image")) {
|
|
63
|
-
capabilities.push("images");
|
|
64
|
-
}
|
|
65
|
-
if (model.modalities?.input?.includes("pdf")) {
|
|
66
|
-
capabilities.push("files");
|
|
67
|
-
}
|
|
68
|
-
if (model.tool_call === true) {
|
|
69
|
-
capabilities.push("tools");
|
|
70
|
-
}
|
|
71
|
-
if (model.reasoning === true) {
|
|
72
|
-
capabilities.push("reasoning");
|
|
73
|
-
}
|
|
74
|
-
if (model.structured_output === true) {
|
|
75
|
-
capabilities.push("structured_output");
|
|
76
|
-
}
|
|
77
|
-
if (model.temperature === true) {
|
|
78
|
-
capabilities.push("temperature");
|
|
79
|
-
}
|
|
80
|
-
return capabilities;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function toStatus(status: string | undefined): ModelInfo["status"] {
|
|
84
|
-
if (
|
|
85
|
-
status === "active" ||
|
|
86
|
-
status === "preview" ||
|
|
87
|
-
status === "deprecated" ||
|
|
88
|
-
status === "legacy"
|
|
89
|
-
) {
|
|
90
|
-
return status;
|
|
91
|
-
}
|
|
92
|
-
return undefined;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function toModelInfo(modelId: string, model: ModelsDevModel): ModelInfo {
|
|
96
|
-
// If context or output limits are missing, default to DEFAULT_CONTEXT_WINDOW and DEFAULT_MAX_TOKENS respectively.
|
|
97
|
-
// If context and max are the same value, assume max tokens should be 5% of that value to avoid overallocation.
|
|
98
|
-
const contextWindow = model.limit?.context ?? DEFAULT_CONTEXT_WINDOW;
|
|
99
|
-
const outputToken = model.limit?.output ?? DEFAULT_MAX_TOKENS;
|
|
100
|
-
const discounted =
|
|
101
|
-
contextWindow === outputToken ? outputToken * 0.05 : outputToken;
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
id: modelId,
|
|
105
|
-
name: model.name || modelId,
|
|
106
|
-
contextWindow,
|
|
107
|
-
maxTokens: Math.floor(discounted),
|
|
108
|
-
capabilities: toCapabilities(model),
|
|
109
|
-
pricing: {
|
|
110
|
-
input: model.cost?.input ?? 0,
|
|
111
|
-
output: model.cost?.output ?? 0,
|
|
112
|
-
cacheRead: model.cost?.cache_read ?? 0,
|
|
113
|
-
cacheWrite: model.cost?.cache_write ?? 0,
|
|
114
|
-
},
|
|
115
|
-
status: toStatus(model.status),
|
|
116
|
-
releaseDate: model.release_date,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function isDeprecatedModel(model: ModelsDevModel): boolean {
|
|
121
|
-
return model.status === "deprecated";
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function normalizeModelsDevProviderModels(
|
|
125
|
-
payload: ModelsDevPayload,
|
|
126
|
-
providerKeyMap: ModelsDevProviderKeyMap,
|
|
127
|
-
): Record<string, Record<string, ModelInfo>> {
|
|
128
|
-
const providerModels: Record<string, Record<string, ModelInfo>> = {};
|
|
129
|
-
|
|
130
|
-
for (const [sourceProviderKey, targetProviderId] of Object.entries(
|
|
131
|
-
providerKeyMap,
|
|
132
|
-
)) {
|
|
133
|
-
const source = payload[sourceProviderKey];
|
|
134
|
-
if (!source?.models) {
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const models: Record<string, ModelInfo> = {};
|
|
139
|
-
for (const [modelId, model] of Object.entries(source.models)) {
|
|
140
|
-
if (model.tool_call !== true || isDeprecatedModel(model)) {
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
models[modelId] = toModelInfo(modelId, model);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (Object.keys(models).length > 0) {
|
|
147
|
-
providerModels[targetProviderId] = sortModelsByReleaseDate(models);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return providerModels;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export async function fetchModelsDevProviderModels(
|
|
155
|
-
url: string,
|
|
156
|
-
providerKeyMap: ModelsDevProviderKeyMap,
|
|
157
|
-
fetcher: typeof fetch = fetch,
|
|
158
|
-
): Promise<Record<string, Record<string, ModelInfo>>> {
|
|
159
|
-
const response = await fetcher(url);
|
|
160
|
-
if (!response.ok) {
|
|
161
|
-
throw new Error(
|
|
162
|
-
`Failed to load model catalog from ${url}: HTTP ${response.status}`,
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const payload = (await response.json()) as ModelsDevPayload;
|
|
167
|
-
return normalizeModelsDevProviderModels(payload, providerKeyMap);
|
|
168
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AIhubmix Provider
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { getGeneratedModelsForProvider } from "../generated-access";
|
|
6
|
-
import type { ModelCollection } from "../schemas/index";
|
|
7
|
-
|
|
8
|
-
export const AIHUBMIX_PROVIDER: ModelCollection = {
|
|
9
|
-
provider: {
|
|
10
|
-
id: "aihubmix",
|
|
11
|
-
name: "AI Hub Mix",
|
|
12
|
-
description: "AI model aggregator",
|
|
13
|
-
protocol: "openai-chat",
|
|
14
|
-
baseUrl: "https://api.aihubmix.com/v1",
|
|
15
|
-
defaultModelId: "gpt-4o",
|
|
16
|
-
env: ["AIHUBMIX_API_KEY"],
|
|
17
|
-
},
|
|
18
|
-
models: getGeneratedModelsForProvider("aihubmix"),
|
|
19
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Anthropic Models
|
|
3
|
-
*
|
|
4
|
-
* Model definitions for Anthropic's Claude family of models.
|
|
5
|
-
* https://docs.anthropic.com/en/docs/about-claude/models
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { getGeneratedModelsForProvider } from "../generated-access";
|
|
9
|
-
import type { ModelCollection, ModelInfo } from "../schemas/index";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Anthropic model definitions
|
|
13
|
-
*/
|
|
14
|
-
export const ANTHROPIC_MODELS = getGeneratedModelsForProvider("anthropic");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Default Anthropic model ID
|
|
18
|
-
*/
|
|
19
|
-
export const ANTHROPIC_DEFAULT_MODEL =
|
|
20
|
-
Object.keys(ANTHROPIC_MODELS)[0] ?? "claude-sonnet-4-6";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Anthropic provider information
|
|
24
|
-
*/
|
|
25
|
-
export const ANTHROPIC_PROVIDER: ModelCollection = {
|
|
26
|
-
provider: {
|
|
27
|
-
id: "anthropic",
|
|
28
|
-
name: "Anthropic",
|
|
29
|
-
description: "Creator of Claude, the AI assistant",
|
|
30
|
-
protocol: "anthropic",
|
|
31
|
-
baseUrl: "https://api.anthropic.com",
|
|
32
|
-
defaultModelId: ANTHROPIC_DEFAULT_MODEL,
|
|
33
|
-
capabilities: ["reasoning", "prompt-cache"],
|
|
34
|
-
env: ["ANTHROPIC_API_KEY"],
|
|
35
|
-
},
|
|
36
|
-
models: ANTHROPIC_MODELS,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Get all active Anthropic models
|
|
41
|
-
*/
|
|
42
|
-
export function getActiveAnthropicModels(): Record<string, ModelInfo> {
|
|
43
|
-
return Object.fromEntries(
|
|
44
|
-
Object.entries(ANTHROPIC_MODELS).filter(
|
|
45
|
-
([, info]) =>
|
|
46
|
-
!info.status || info.status === "active" || info.status === "preview",
|
|
47
|
-
),
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Get Anthropic models with reasoning/thinking support
|
|
53
|
-
*/
|
|
54
|
-
export function getAnthropicReasoningModels(): Record<string, ModelInfo> {
|
|
55
|
-
return Object.fromEntries(
|
|
56
|
-
Object.entries(ANTHROPIC_MODELS).filter(
|
|
57
|
-
([, info]) => info.thinkingConfig !== undefined,
|
|
58
|
-
),
|
|
59
|
-
);
|
|
60
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AskSage Provider
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { ModelCollection } from "../schemas/index";
|
|
6
|
-
|
|
7
|
-
export const ASKSAGE_PROVIDER: ModelCollection = {
|
|
8
|
-
provider: {
|
|
9
|
-
id: "asksage",
|
|
10
|
-
name: "AskSage",
|
|
11
|
-
description: "AskSage platform",
|
|
12
|
-
protocol: "openai-chat",
|
|
13
|
-
baseUrl: "https://api.asksage.ai/server",
|
|
14
|
-
defaultModelId: "gpt-4o",
|
|
15
|
-
capabilities: ["tools"],
|
|
16
|
-
env: ["ASKSAGE_API_KEY"],
|
|
17
|
-
},
|
|
18
|
-
models: {},
|
|
19
|
-
};
|