+14
-3
@@ -0,1 +1,2 @@ | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"anthropic:claude-sonnet-4-5"` */ | ||
| declare enum ClaudeModel { | ||
@@ -14,2 +15,3 @@ HAIKU_3 = "claude-3-haiku-20240307", | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"openai:gpt-4o"` */ | ||
| declare enum GPTModel { | ||
@@ -33,2 +35,3 @@ GPT35_0613 = "gpt-3.5-turbo-0613", | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"groq:llama-3.3-70b-versatile"` */ | ||
| declare enum GroqModel { | ||
@@ -40,5 +43,8 @@ LLAMA_3_70B_8192 = "llama3-70b-8192", | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"openrouter:qwen/qwen3.6-plus:free"` */ | ||
| declare enum OpenRouterModel { | ||
| QWEN3_6_PLUS_FREE = "qwen/qwen3.6-plus:free" | ||
| GEMMA_4_31B_IT_FREE = "google/gemma-4-31b-it:free", | ||
| GEMMA_4_31B_IT = "google/gemma-4-31b-it" | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"google:gemini-2.0-flash"` */ | ||
| declare enum GeminiModel { | ||
@@ -108,3 +114,4 @@ GEMINI_1_5_PRO = "gemini-1.5-pro-latest", | ||
| } | ||
| type AnyModel = GPTModel | ClaudeModel | GroqModel | GeminiModel | OpenRouterModel; | ||
| type Provider = "openai" | "anthropic" | "google" | "groq" | "openrouter"; | ||
| type AnyModel = GPTModel | ClaudeModel | GroqModel | GeminiModel | OpenRouterModel | (string & {}); | ||
| interface GenericPayload { | ||
@@ -121,4 +128,8 @@ model: AnyModel; | ||
| declare function parseModelString(model: string): { | ||
| provider: Provider; | ||
| modelId: string; | ||
| }; | ||
| declare function callWithRetries(id: string | string[], aiPayload: GenericPayload, aiConfig?: OpenAIConfig | AnthropicAIConfig, retries?: number, chunkTimeoutMs?: number): Promise<ParsedResponseMessage>; | ||
| export { type AnyModel, ClaudeModel, type FunctionDefinition, GPTModel, GeminiModel, type GenericMessage, type GenericPayload, GroqModel, type OpenAIConfig, OpenRouterModel, callWithRetries }; | ||
| export { type AnyModel, ClaudeModel, type FunctionDefinition, GPTModel, GeminiModel, type GenericMessage, type GenericPayload, GroqModel, type OpenAIConfig, OpenRouterModel, type Provider, callWithRetries, parseModelString }; |
+14
-3
@@ -0,1 +1,2 @@ | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"anthropic:claude-sonnet-4-5"` */ | ||
| declare enum ClaudeModel { | ||
@@ -14,2 +15,3 @@ HAIKU_3 = "claude-3-haiku-20240307", | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"openai:gpt-4o"` */ | ||
| declare enum GPTModel { | ||
@@ -33,2 +35,3 @@ GPT35_0613 = "gpt-3.5-turbo-0613", | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"groq:llama-3.3-70b-versatile"` */ | ||
| declare enum GroqModel { | ||
@@ -40,5 +43,8 @@ LLAMA_3_70B_8192 = "llama3-70b-8192", | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"openrouter:qwen/qwen3.6-plus:free"` */ | ||
| declare enum OpenRouterModel { | ||
| QWEN3_6_PLUS_FREE = "qwen/qwen3.6-plus:free" | ||
| GEMMA_4_31B_IT_FREE = "google/gemma-4-31b-it:free", | ||
| GEMMA_4_31B_IT = "google/gemma-4-31b-it" | ||
| } | ||
| /** @deprecated Use provider prefix strings instead, e.g. `"google:gemini-2.0-flash"` */ | ||
| declare enum GeminiModel { | ||
@@ -108,3 +114,4 @@ GEMINI_1_5_PRO = "gemini-1.5-pro-latest", | ||
| } | ||
| type AnyModel = GPTModel | ClaudeModel | GroqModel | GeminiModel | OpenRouterModel; | ||
| type Provider = "openai" | "anthropic" | "google" | "groq" | "openrouter"; | ||
| type AnyModel = GPTModel | ClaudeModel | GroqModel | GeminiModel | OpenRouterModel | (string & {}); | ||
| interface GenericPayload { | ||
@@ -121,4 +128,8 @@ model: AnyModel; | ||
| declare function parseModelString(model: string): { | ||
| provider: Provider; | ||
| modelId: string; | ||
| }; | ||
| declare function callWithRetries(id: string | string[], aiPayload: GenericPayload, aiConfig?: OpenAIConfig | AnthropicAIConfig, retries?: number, chunkTimeoutMs?: number): Promise<ParsedResponseMessage>; | ||
| export { type AnyModel, ClaudeModel, type FunctionDefinition, GPTModel, GeminiModel, type GenericMessage, type GenericPayload, GroqModel, type OpenAIConfig, OpenRouterModel, callWithRetries }; | ||
| export { type AnyModel, ClaudeModel, type FunctionDefinition, GPTModel, GeminiModel, type GenericMessage, type GenericPayload, GroqModel, type OpenAIConfig, OpenRouterModel, type Provider, callWithRetries, parseModelString }; |
+80
-56
@@ -38,3 +38,4 @@ "use strict"; | ||
| OpenRouterModel: () => OpenRouterModel, | ||
| callWithRetries: () => callWithRetries | ||
| callWithRetries: () => callWithRetries, | ||
| parseModelString: () => parseModelString | ||
| }); | ||
@@ -85,3 +86,4 @@ module.exports = __toCommonJS(proof_exports); | ||
| var OpenRouterModel = /* @__PURE__ */ ((OpenRouterModel2) => { | ||
| OpenRouterModel2["QWEN3_6_PLUS_FREE"] = "qwen/qwen3.6-plus:free"; | ||
| OpenRouterModel2["GEMMA_4_31B_IT_FREE"] = "google/gemma-4-31b-it:free"; | ||
| OpenRouterModel2["GEMMA_4_31B_IT"] = "google/gemma-4-31b-it"; | ||
| return OpenRouterModel2; | ||
@@ -508,3 +510,4 @@ })(OpenRouterModel || {}); | ||
| ); | ||
| const useStreaming = openAiPayload.model !== "o1-mini" /* O1_MINI */ && openAiPayload.model !== "o1-preview" /* O1_PREVIEW */; | ||
| const modelStr = openAiPayload.model; | ||
| const useStreaming = modelStr !== "o1-mini" /* O1_MINI */ && modelStr !== "o1-preview" /* O1_PREVIEW */ && !modelStr.startsWith("o1"); | ||
| return withRetries( | ||
@@ -1098,58 +1101,78 @@ id, | ||
| } | ||
| function isAnthropicPayload(payload) { | ||
| return Object.values(ClaudeModel).includes(payload.model); | ||
| var VALID_PROVIDERS = ["openai", "anthropic", "google", "groq", "openrouter"]; | ||
| var ENUM_PROVIDER_MAP = [ | ||
| { values: new Set(Object.values(GPTModel)), provider: "openai" }, | ||
| { values: new Set(Object.values(ClaudeModel)), provider: "anthropic" }, | ||
| { values: new Set(Object.values(GeminiModel)), provider: "google" }, | ||
| { values: new Set(Object.values(GroqModel)), provider: "groq" }, | ||
| { values: new Set(Object.values(OpenRouterModel)), provider: "openrouter" } | ||
| ]; | ||
| function parseModelString(model) { | ||
| const colonIndex = model.indexOf(":"); | ||
| if (colonIndex !== -1) { | ||
| const prefix = model.substring(0, colonIndex); | ||
| if (VALID_PROVIDERS.includes(prefix)) { | ||
| const modelId = model.substring(colonIndex + 1); | ||
| if (!modelId) { | ||
| throw new Error( | ||
| `Empty model ID in model string '${model}'. Expected format: 'provider:model-id'` | ||
| ); | ||
| } | ||
| return { provider: prefix, modelId }; | ||
| } | ||
| } | ||
| for (const { values, provider } of ENUM_PROVIDER_MAP) { | ||
| if (values.has(model)) { | ||
| return { provider, modelId: model }; | ||
| } | ||
| } | ||
| if (colonIndex !== -1) { | ||
| const prefix = model.substring(0, colonIndex); | ||
| throw new Error( | ||
| `Unknown provider '${prefix}' in model string '${model}'. Valid providers: ${VALID_PROVIDERS.join(", ")}` | ||
| ); | ||
| } | ||
| throw new Error( | ||
| `Unable to determine provider for model '${model}'. Use a provider prefix (e.g. 'openai:${model}') or a known model enum value. Valid providers: ${VALID_PROVIDERS.join(", ")}` | ||
| ); | ||
| } | ||
| function isOpenAiPayload(payload) { | ||
| return Object.values(GPTModel).includes(payload.model); | ||
| } | ||
| function isGroqPayload(payload) { | ||
| return Object.values(GroqModel).includes(payload.model); | ||
| } | ||
| function isGoogleAIPayload(payload) { | ||
| return Object.values(GeminiModel).includes(payload.model); | ||
| } | ||
| function isOpenRouterPayload(payload) { | ||
| return Object.values(OpenRouterModel).includes(payload.model); | ||
| } | ||
| async function callWithRetries(id, aiPayload, aiConfig, retries = 5, chunkTimeoutMs = 15e3) { | ||
| try { | ||
| if (isAnthropicPayload(aiPayload)) { | ||
| return await callAnthropicWithRetries( | ||
| id, | ||
| await prepareAnthropicPayload(id, aiPayload), | ||
| aiConfig, | ||
| retries | ||
| ); | ||
| const { provider, modelId } = parseModelString(aiPayload.model); | ||
| const routingPayload = { ...aiPayload, model: modelId }; | ||
| switch (provider) { | ||
| case "anthropic": | ||
| return await callAnthropicWithRetries( | ||
| id, | ||
| await prepareAnthropicPayload(id, routingPayload), | ||
| aiConfig, | ||
| retries | ||
| ); | ||
| case "openai": | ||
| return await callOpenAiWithRetries( | ||
| id, | ||
| await prepareOpenAIPayload(id, routingPayload), | ||
| aiConfig, | ||
| retries, | ||
| chunkTimeoutMs | ||
| ); | ||
| case "groq": | ||
| return await callGroqWithRetries( | ||
| id, | ||
| prepareGroqPayload(routingPayload), | ||
| retries | ||
| ); | ||
| case "google": | ||
| return await callGoogleAIWithRetries( | ||
| id, | ||
| await prepareGoogleAIPayload(id, routingPayload), | ||
| retries | ||
| ); | ||
| case "openrouter": | ||
| return await callOpenRouterWithRetries( | ||
| id, | ||
| prepareOpenRouterPayload(routingPayload), | ||
| retries | ||
| ); | ||
| } | ||
| if (isOpenAiPayload(aiPayload)) { | ||
| return await callOpenAiWithRetries( | ||
| id, | ||
| await prepareOpenAIPayload(id, aiPayload), | ||
| aiConfig, | ||
| retries, | ||
| chunkTimeoutMs | ||
| ); | ||
| } | ||
| if (isGroqPayload(aiPayload)) { | ||
| return await callGroqWithRetries( | ||
| id, | ||
| prepareGroqPayload(aiPayload), | ||
| retries | ||
| ); | ||
| } | ||
| if (isGoogleAIPayload(aiPayload)) { | ||
| return await callGoogleAIWithRetries( | ||
| id, | ||
| await prepareGoogleAIPayload(id, aiPayload), | ||
| retries | ||
| ); | ||
| } | ||
| if (isOpenRouterPayload(aiPayload)) { | ||
| return await callOpenRouterWithRetries( | ||
| id, | ||
| prepareOpenRouterPayload(aiPayload), | ||
| retries | ||
| ); | ||
| } | ||
| throw new Error("Invalid AI payload: Unknown model type."); | ||
| } catch (error2) { | ||
@@ -1187,4 +1210,5 @@ if (aiPayload.fallbackModel) { | ||
| OpenRouterModel, | ||
| callWithRetries | ||
| callWithRetries, | ||
| parseModelString | ||
| }); | ||
| //# sourceMappingURL=index.js.map |
+78
-55
@@ -51,3 +51,4 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { | ||
| var OpenRouterModel = /* @__PURE__ */ ((OpenRouterModel2) => { | ||
| OpenRouterModel2["QWEN3_6_PLUS_FREE"] = "qwen/qwen3.6-plus:free"; | ||
| OpenRouterModel2["GEMMA_4_31B_IT_FREE"] = "google/gemma-4-31b-it:free"; | ||
| OpenRouterModel2["GEMMA_4_31B_IT"] = "google/gemma-4-31b-it"; | ||
| return OpenRouterModel2; | ||
@@ -477,3 +478,4 @@ })(OpenRouterModel || {}); | ||
| ); | ||
| const useStreaming = openAiPayload.model !== "o1-mini" /* O1_MINI */ && openAiPayload.model !== "o1-preview" /* O1_PREVIEW */; | ||
| const modelStr = openAiPayload.model; | ||
| const useStreaming = modelStr !== "o1-mini" /* O1_MINI */ && modelStr !== "o1-preview" /* O1_PREVIEW */ && !modelStr.startsWith("o1"); | ||
| return withRetries( | ||
@@ -1067,58 +1069,78 @@ id, | ||
| } | ||
| function isAnthropicPayload(payload) { | ||
| return Object.values(ClaudeModel).includes(payload.model); | ||
| var VALID_PROVIDERS = ["openai", "anthropic", "google", "groq", "openrouter"]; | ||
| var ENUM_PROVIDER_MAP = [ | ||
| { values: new Set(Object.values(GPTModel)), provider: "openai" }, | ||
| { values: new Set(Object.values(ClaudeModel)), provider: "anthropic" }, | ||
| { values: new Set(Object.values(GeminiModel)), provider: "google" }, | ||
| { values: new Set(Object.values(GroqModel)), provider: "groq" }, | ||
| { values: new Set(Object.values(OpenRouterModel)), provider: "openrouter" } | ||
| ]; | ||
| function parseModelString(model) { | ||
| const colonIndex = model.indexOf(":"); | ||
| if (colonIndex !== -1) { | ||
| const prefix = model.substring(0, colonIndex); | ||
| if (VALID_PROVIDERS.includes(prefix)) { | ||
| const modelId = model.substring(colonIndex + 1); | ||
| if (!modelId) { | ||
| throw new Error( | ||
| `Empty model ID in model string '${model}'. Expected format: 'provider:model-id'` | ||
| ); | ||
| } | ||
| return { provider: prefix, modelId }; | ||
| } | ||
| } | ||
| for (const { values, provider } of ENUM_PROVIDER_MAP) { | ||
| if (values.has(model)) { | ||
| return { provider, modelId: model }; | ||
| } | ||
| } | ||
| if (colonIndex !== -1) { | ||
| const prefix = model.substring(0, colonIndex); | ||
| throw new Error( | ||
| `Unknown provider '${prefix}' in model string '${model}'. Valid providers: ${VALID_PROVIDERS.join(", ")}` | ||
| ); | ||
| } | ||
| throw new Error( | ||
| `Unable to determine provider for model '${model}'. Use a provider prefix (e.g. 'openai:${model}') or a known model enum value. Valid providers: ${VALID_PROVIDERS.join(", ")}` | ||
| ); | ||
| } | ||
| function isOpenAiPayload(payload) { | ||
| return Object.values(GPTModel).includes(payload.model); | ||
| } | ||
| function isGroqPayload(payload) { | ||
| return Object.values(GroqModel).includes(payload.model); | ||
| } | ||
| function isGoogleAIPayload(payload) { | ||
| return Object.values(GeminiModel).includes(payload.model); | ||
| } | ||
| function isOpenRouterPayload(payload) { | ||
| return Object.values(OpenRouterModel).includes(payload.model); | ||
| } | ||
| async function callWithRetries(id, aiPayload, aiConfig, retries = 5, chunkTimeoutMs = 15e3) { | ||
| try { | ||
| if (isAnthropicPayload(aiPayload)) { | ||
| return await callAnthropicWithRetries( | ||
| id, | ||
| await prepareAnthropicPayload(id, aiPayload), | ||
| aiConfig, | ||
| retries | ||
| ); | ||
| const { provider, modelId } = parseModelString(aiPayload.model); | ||
| const routingPayload = { ...aiPayload, model: modelId }; | ||
| switch (provider) { | ||
| case "anthropic": | ||
| return await callAnthropicWithRetries( | ||
| id, | ||
| await prepareAnthropicPayload(id, routingPayload), | ||
| aiConfig, | ||
| retries | ||
| ); | ||
| case "openai": | ||
| return await callOpenAiWithRetries( | ||
| id, | ||
| await prepareOpenAIPayload(id, routingPayload), | ||
| aiConfig, | ||
| retries, | ||
| chunkTimeoutMs | ||
| ); | ||
| case "groq": | ||
| return await callGroqWithRetries( | ||
| id, | ||
| prepareGroqPayload(routingPayload), | ||
| retries | ||
| ); | ||
| case "google": | ||
| return await callGoogleAIWithRetries( | ||
| id, | ||
| await prepareGoogleAIPayload(id, routingPayload), | ||
| retries | ||
| ); | ||
| case "openrouter": | ||
| return await callOpenRouterWithRetries( | ||
| id, | ||
| prepareOpenRouterPayload(routingPayload), | ||
| retries | ||
| ); | ||
| } | ||
| if (isOpenAiPayload(aiPayload)) { | ||
| return await callOpenAiWithRetries( | ||
| id, | ||
| await prepareOpenAIPayload(id, aiPayload), | ||
| aiConfig, | ||
| retries, | ||
| chunkTimeoutMs | ||
| ); | ||
| } | ||
| if (isGroqPayload(aiPayload)) { | ||
| return await callGroqWithRetries( | ||
| id, | ||
| prepareGroqPayload(aiPayload), | ||
| retries | ||
| ); | ||
| } | ||
| if (isGoogleAIPayload(aiPayload)) { | ||
| return await callGoogleAIWithRetries( | ||
| id, | ||
| await prepareGoogleAIPayload(id, aiPayload), | ||
| retries | ||
| ); | ||
| } | ||
| if (isOpenRouterPayload(aiPayload)) { | ||
| return await callOpenRouterWithRetries( | ||
| id, | ||
| prepareOpenRouterPayload(aiPayload), | ||
| retries | ||
| ); | ||
| } | ||
| throw new Error("Invalid AI payload: Unknown model type."); | ||
| } catch (error2) { | ||
@@ -1155,4 +1177,5 @@ if (aiPayload.fallbackModel) { | ||
| OpenRouterModel, | ||
| callWithRetries | ||
| callWithRetries, | ||
| parseModelString | ||
| }; | ||
| //# sourceMappingURL=index.mjs.map |
+1
-1
| { | ||
| "name": "190proof", | ||
| "version": "1.0.88", | ||
| "version": "1.0.89", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
+98
-63
@@ -15,2 +15,3 @@ # 190proof | ||
| - ☁️ Cloud service providers supported (Azure, AWS Bedrock) | ||
| - 🔌 Provider prefix strings for any model without waiting for package updates | ||
@@ -27,8 +28,9 @@ ## Installation | ||
| Use any model from any provider with the `provider:model-id` format: | ||
| ```typescript | ||
| import { callWithRetries } from "190proof"; | ||
| import { GPTModel, GenericPayload } from "190proof/interfaces"; | ||
| import { callWithRetries, GenericPayload } from "190proof"; | ||
| const payload: GenericPayload = { | ||
| model: GPTModel.GPT4O_MINI, | ||
| model: "openai:gpt-4o-mini", | ||
| messages: [ | ||
@@ -49,14 +51,13 @@ { | ||
| ```typescript | ||
| import { callWithRetries } from "190proof"; | ||
| import { | ||
| ClaudeModel, | ||
| GeminiModel, | ||
| GroqModel, | ||
| OpenRouterModel, | ||
| GenericPayload, | ||
| } from "190proof/interfaces"; | ||
| import { callWithRetries, GenericPayload } from "190proof"; | ||
| // OpenAI | ||
| const openaiPayload: GenericPayload = { | ||
| model: "openai:gpt-5", | ||
| messages: [{ role: "user", content: "Hello!" }], | ||
| }; | ||
| // Anthropic | ||
| const claudePayload: GenericPayload = { | ||
| model: ClaudeModel.SONNET_4, | ||
| model: "anthropic:claude-sonnet-4-5", | ||
| messages: [{ role: "user", content: "Hello!" }], | ||
@@ -67,3 +68,3 @@ }; | ||
| const geminiPayload: GenericPayload = { | ||
| model: GeminiModel.GEMINI_2_0_FLASH, | ||
| model: "google:gemini-2.0-flash", | ||
| messages: [{ role: "user", content: "Hello!" }], | ||
@@ -74,3 +75,3 @@ }; | ||
| const groqPayload: GenericPayload = { | ||
| model: GroqModel.LLAMA_3_70B_8192, | ||
| model: "groq:llama-3.3-70b-versatile", | ||
| messages: [{ role: "user", content: "Hello!" }], | ||
@@ -81,3 +82,3 @@ }; | ||
| const openRouterPayload: GenericPayload = { | ||
| model: OpenRouterModel.QWEN3_6_PLUS_FREE, | ||
| model: "openrouter:google/gemma-4-31b-it:free", | ||
| messages: [{ role: "user", content: "Hello!" }], | ||
@@ -93,3 +94,3 @@ }; | ||
| const payload: GenericPayload = { | ||
| model: GPTModel.GPT4O, | ||
| model: "openai:gpt-4o", | ||
| messages: [ | ||
@@ -127,3 +128,3 @@ { | ||
| const payload: GenericPayload = { | ||
| model: ClaudeModel.SONNET_4, | ||
| model: "anthropic:claude-sonnet-4-5", | ||
| messages: [ | ||
@@ -150,3 +151,3 @@ { | ||
| const payload: GenericPayload = { | ||
| model: GeminiModel.GEMINI_2_0_FLASH, | ||
| model: "google:gemini-2.0-flash", | ||
| messages: [ | ||
@@ -167,58 +168,80 @@ { | ||
| ### Inspecting Model Routing | ||
| Use `parseModelString` to see how a model string will be routed: | ||
| ```typescript | ||
| import { parseModelString } from "190proof"; | ||
| parseModelString("openai:gpt-7"); | ||
| // → { provider: "openai", modelId: "gpt-7" } | ||
| parseModelString("openrouter:org/model-name:free"); | ||
| // → { provider: "openrouter", modelId: "org/model-name:free" } | ||
| ``` | ||
| ## Provider Prefix Format | ||
| The model string format is `provider:model-id`, where the provider prefix is one of: | ||
| | Prefix | Provider | | ||
| |---|---| | ||
| | `openai` | OpenAI | | ||
| | `anthropic` | Anthropic | | ||
| | `google` | Google (Gemini) | | ||
| | `groq` | Groq | | ||
| | `openrouter` | OpenRouter | | ||
| The prefix is stripped before sending to the API, so the model ID should be exactly what the provider expects (e.g. `"openai:gpt-4o"` sends `"gpt-4o"` to OpenAI). | ||
| ## Supported Models | ||
| ### OpenAI Models | ||
| These models are tested. You can use any model with the `provider:model-id` format. | ||
| - `gpt-3.5-turbo-0613` | ||
| - `gpt-3.5-turbo-16k-0613` | ||
| - `gpt-3.5-turbo-0125` | ||
| - `gpt-4-1106-preview` | ||
| - `gpt-4-0125-preview` | ||
| - `gpt-4-turbo-2024-04-09` | ||
| - `gpt-4o` | ||
| - `gpt-4o-mini` | ||
| - `o1-preview` | ||
| - `o1-mini` | ||
| - `o3-mini` | ||
| - `gpt-4.1` | ||
| - `gpt-4.1-mini` | ||
| - `gpt-4.1-nano` | ||
| - `gpt-5` | ||
| - `gpt-5-mini` | ||
| ### OpenAI | ||
| ### Anthropic Models | ||
| - `openai:gpt-5` | ||
| - `openai:gpt-5-mini` | ||
| - `openai:gpt-4.1` | ||
| - `openai:gpt-4.1-mini` | ||
| - `openai:gpt-4.1-nano` | ||
| - `openai:gpt-4o` | ||
| - `openai:gpt-4o-mini` | ||
| - `openai:o3-mini` | ||
| - `openai:o1-preview` | ||
| - `openai:o1-mini` | ||
| - `claude-3-haiku-20240307` | ||
| - `claude-3-sonnet-20240229` | ||
| - `claude-3-opus-20240229` | ||
| - `claude-3-5-haiku-20241022` | ||
| - `claude-3-5-sonnet-20241022` | ||
| - `claude-sonnet-4-20250514` | ||
| - `claude-opus-4-20250514` | ||
| - `claude-opus-4-1` | ||
| - `claude-haiku-4-5` | ||
| - `claude-sonnet-4-5` | ||
| - `claude-opus-4-5` | ||
| ### Anthropic | ||
| ### Google Models | ||
| - `anthropic:claude-opus-4-5` | ||
| - `anthropic:claude-sonnet-4-5` | ||
| - `anthropic:claude-haiku-4-5` | ||
| - `anthropic:claude-opus-4-1` | ||
| - `anthropic:claude-opus-4-20250514` | ||
| - `anthropic:claude-sonnet-4-20250514` | ||
| - `anthropic:claude-3-5-sonnet-20241022` | ||
| - `anthropic:claude-3-5-haiku-20241022` | ||
| - `gemini-1.5-pro-latest` | ||
| - `gemini-exp-1206` | ||
| - `gemini-2.0-flash` | ||
| - `gemini-2.0-flash-exp-image-generation` | ||
| - `gemini-2.0-flash-thinking-exp` | ||
| - `gemini-2.0-flash-thinking-exp-01-21` | ||
| - `gemini-2.5-flash-preview-04-17` | ||
| - `gemini-3-flash-preview` | ||
| - `gemini-3.1-flash-lite-preview` | ||
| ### Groq Models | ||
| - `google:gemini-3.1-flash-lite-preview` | ||
| - `google:gemini-3-flash-preview` | ||
| - `google:gemini-2.5-flash-preview-04-17` | ||
| - `google:gemini-2.0-flash` | ||
| - `google:gemini-2.0-flash-exp-image-generation` | ||
| - `google:gemini-1.5-pro-latest` | ||
| - `llama3-70b-8192` | ||
| - `deepseek-r1-distill-llama-70b` | ||
| ### Groq | ||
| ### OpenRouter Models | ||
| - `groq:llama-3.3-70b-versatile` | ||
| - `groq:llama3-70b-8192` | ||
| - `groq:qwen/qwen3-32b` | ||
| - `groq:deepseek-r1-distill-llama-70b` | ||
| - `qwen/qwen3.6-plus:free` | ||
| ### OpenRouter | ||
| - `openrouter:google/gemma-4-31b-it:free` | ||
| - `openrouter:google/gemma-4-31b-it` | ||
| ## Environment Variables | ||
@@ -282,2 +305,14 @@ | ||
| ### `parseModelString(model)` | ||
| Parses a model string into its provider and model ID components. | ||
| #### Parameters | ||
| - `model`: `string` - A model string in `"provider:model-id"` format | ||
| #### Returns | ||
| `{ provider: Provider, modelId: string }` | ||
| ### Configuration Options | ||
@@ -294,3 +329,3 @@ | ||
| modelConfigMap?: Record< | ||
| GPTModel, | ||
| string, | ||
| { | ||
@@ -297,0 +332,0 @@ resource: string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
258918
4.39%2499
2.38%341
11.44%