o3-pro
This commit is contained in:
+2
-2
@@ -131,7 +131,7 @@ This project provides a proxy layer for various Large Language Models (LLMs) and
|
||||
|
||||
### Supported Models & Providers
|
||||
|
||||
* **OpenAI:** Handled in `src/proxy/openai.ts`. Supports models like GPT-4, GPT-3.5-turbo, as well as o-series models (o1, o1-mini, o1-pro, o3, o3-mini, o4-mini). Handles chat completions and potentially image generation (`src/proxy/openai-image.ts`).
|
||||
* **OpenAI:** Handled in `src/proxy/openai.ts`. Supports models like GPT-4, GPT-3.5-turbo, as well as o-series models (o1, o1-mini, o1-pro, o3, o3-mini, o3-pro, o4-mini). Handles chat completions and potentially image generation (`src/proxy/openai-image.ts`).
|
||||
* **Anthropic:** Handled in `src/proxy/anthropic.ts`. Supports Claude models. May use AWS Bedrock (`src/proxy/aws-claude.ts`) or Anthropic's direct API.
|
||||
* **Google AI / Vertex AI:** Handled in `src/proxy/google-ai.ts` and `src/proxy/gcp.ts`. Supports Gemini models (gemini-flash, gemini-pro, gemini-ultra).
|
||||
* **Mistral AI:** Handled in `src/proxy/mistral-ai.ts`. Supports Mistral models via their API or potentially AWS (`src/proxy/aws-mistral.ts`).
|
||||
@@ -229,7 +229,7 @@ The codebase handles several patterns for model naming and versioning:
|
||||
|
||||
1. **Date-stamped Models:** Many models include date stamps (e.g., `gpt-4-0125-preview`). The regex patterns in `OPENAI_MODEL_FAMILY_MAP` account for these with patterns like `^gpt-4o(-\\d{4}-\\d{2}-\\d{2})?$`.
|
||||
|
||||
2. **O-Series Models:** OpenAI's o-series models (o1, o1-mini, o1-pro, o3, o3-mini, o4-mini) follow a different naming convention. The codebase handles these with dedicated model families and regex patterns.
|
||||
2. **O-Series Models:** OpenAI's o-series models (o1, o1-mini, o1-pro, o3, o3-mini, o3-pro, o4-mini) follow a different naming convention. The codebase handles these with dedicated model families and regex patterns.
|
||||
|
||||
3. **Preview/Non-Preview Variants:** Some models have preview variants (e.g., `gpt-4.5-preview`). The regex patterns in `OPENAI_MODEL_FAMILY_MAP` account for these with patterns like `^gpt-4\\.5(-preview)?(-\\d{4}-\\d{2}-\\d{2})?$`.
|
||||
|
||||
|
||||
+1
-1
@@ -880,6 +880,6 @@ function parseCsv(val: string): string[] {
|
||||
|
||||
function getDefaultModelFamilies(): ModelFamily[] {
|
||||
return MODEL_FAMILIES.filter(
|
||||
(f) => !f.includes("o1-pro")
|
||||
(f) => !f.includes("o1-pro") && !f.includes("o3-pro")
|
||||
) as ModelFamily[];
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ const MODEL_FAMILY_FRIENDLY_NAME: { [f in ModelFamily]: string } = {
|
||||
o1: "OpenAI o1",
|
||||
"o1-mini": "OpenAI o1 mini",
|
||||
"o1-pro": "OpenAI o1 pro",
|
||||
"o3-pro": "OpenAI o3 pro",
|
||||
"o3-mini": "OpenAI o3 mini",
|
||||
"o3": "OpenAI o3",
|
||||
"o4-mini": "OpenAI o4 mini",
|
||||
@@ -78,6 +79,7 @@ const MODEL_FAMILY_FRIENDLY_NAME: { [f in ModelFamily]: string } = {
|
||||
"azure-o1": "Azure o1",
|
||||
"azure-o1-mini": "Azure o1 mini",
|
||||
"azure-o1-pro": "Azure o1 pro",
|
||||
"azure-o3-pro": "Azure o3 pro",
|
||||
"azure-o3-mini": "Azure o3 mini",
|
||||
"azure-o3": "Azure o3",
|
||||
"azure-o4-mini": "Azure o4 mini",
|
||||
|
||||
@@ -91,6 +91,8 @@ export const validateContextSize: RequestPreprocessor = async (req) => {
|
||||
modelMax = 128000;
|
||||
} else if (model.match(/^o1-pro(-\d{4}-\d{2}-\d{2})?$/)) {
|
||||
modelMax = 200000;
|
||||
} else if (model.match(/^o3-pro(-\d{4}-\d{2}-\d{2})?$/)) {
|
||||
modelMax = 200000;
|
||||
} else if (model.match(/^o1-preview(-\d{4}-\d{2}-\d{2})?$/)) {
|
||||
modelMax = 128000;
|
||||
} else if (model.match(/gpt-3.5-turbo/)) {
|
||||
|
||||
@@ -357,6 +357,7 @@ const setupChunkedTransfer: RequestHandler = (req, res, next) => {
|
||||
// Functions to handle model-specific API routing
|
||||
function shouldUseResponsesApi(model: string): boolean {
|
||||
return model === "o1-pro" || model.startsWith("o1-pro-") ||
|
||||
model === "o3-pro" || model.startsWith("o3-pro-") ||
|
||||
model === "codex-mini-latest" || model.startsWith("codex-mini-");
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export type APIFormat =
|
||||
| "openai"
|
||||
| "openai-text"
|
||||
| "openai-image"
|
||||
| "openai-responses" // New OpenAI Responses API for o1-pro model
|
||||
| "openai-responses" // OpenAI Responses API (e.g., for o1-pro, o3-pro)
|
||||
| "anthropic-chat" // Anthropic's newer messages array format
|
||||
| "anthropic-text" // Legacy flat string prompt format
|
||||
| "google-ai"
|
||||
|
||||
@@ -33,6 +33,7 @@ export type OpenAIModelFamily =
|
||||
| "o1"
|
||||
| "o1-mini"
|
||||
| "o1-pro"
|
||||
| "o3-pro"
|
||||
| "o3-mini"
|
||||
| "o3"
|
||||
| "o4-mini"
|
||||
@@ -90,6 +91,7 @@ export const MODEL_FAMILIES = (<A extends readonly ModelFamily[]>(
|
||||
"o1",
|
||||
"o1-mini",
|
||||
"o1-pro",
|
||||
"o3-pro",
|
||||
"o3-mini",
|
||||
"o3",
|
||||
"o4-mini",
|
||||
@@ -126,6 +128,7 @@ export const MODEL_FAMILIES = (<A extends readonly ModelFamily[]>(
|
||||
"azure-o1",
|
||||
"azure-o1-mini",
|
||||
"azure-o1-pro",
|
||||
"azure-o3-pro",
|
||||
"azure-o3-mini",
|
||||
"azure-o3",
|
||||
"azure-o4-mini",
|
||||
@@ -168,6 +171,7 @@ export const MODEL_FAMILY_SERVICE: {
|
||||
"o1": "openai",
|
||||
"o1-mini": "openai",
|
||||
"o1-pro": "openai",
|
||||
"o3-pro": "openai",
|
||||
"o3-mini": "openai",
|
||||
"o3": "openai",
|
||||
"o4-mini": "openai",
|
||||
@@ -197,6 +201,7 @@ export const MODEL_FAMILY_SERVICE: {
|
||||
"azure-o1": "azure",
|
||||
"azure-o1-mini": "azure",
|
||||
"azure-o1-pro": "azure",
|
||||
"azure-o3-pro": "azure",
|
||||
"azure-o3-mini": "azure",
|
||||
"azure-o3": "azure",
|
||||
"azure-o4-mini": "azure",
|
||||
@@ -235,6 +240,7 @@ export const OPENAI_MODEL_FAMILY_MAP: { [regex: string]: OpenAIModelFamily } = {
|
||||
"^dall-e-\\d{1}$": "dall-e",
|
||||
"^o1-mini(-\\d{4}-\\d{2}-\\d{2})?$": "o1-mini",
|
||||
"^o1-pro(-\\d{4}-\\d{2}-\\d{2})?$": "o1-pro",
|
||||
"^o3-pro(-\\d{4}-\\d{2}-\\d{2})?$": "o3-pro",
|
||||
"^o1(-\\d{4}-\\d{2}-\\d{2})?$": "o1",
|
||||
"^o3-mini(-\\d{4}-\\d{2}-\\d{2})?$": "o3-mini",
|
||||
"^o3(-\\d{4}-\\d{2}-\\d{2})?$": "o3",
|
||||
|
||||
+3
-1
@@ -19,13 +19,15 @@ const MODEL_PRICING: Record<ModelFamily, { input: number; output: number } | und
|
||||
"azure-gpt4-turbo": { input: 10.00, output: 30.00 },
|
||||
"o1-pro": { input: 150.00, output: 600.00 },
|
||||
"azure-o1-pro": { input: 150.00, output: 600.00 },
|
||||
"o3-pro": { input: 20.00, output: 80.00 },
|
||||
"azure-o3-pro": { input: 20.00, output: 80.00 },
|
||||
"o1": { input: 15.00, output: 60.00 },
|
||||
"azure-o1": { input: 15.00, output: 60.00 },
|
||||
"o1-mini": { input: 1.10, output: 4.40 },
|
||||
"azure-o1-mini": { input: 1.10, output: 4.40 },
|
||||
"o3-mini": { input: 1.10, output: 4.40 },
|
||||
"azure-o3-mini": { input: 1.10, output: 4.40 },
|
||||
"o3": { input: 2.00, output: 8.00 },
|
||||
"o3": { input: 10.00, output: 40.00 },
|
||||
"azure-o3": { input: 10.00, output: 40.00 },
|
||||
"o4-mini": { input: 1.10, output: 4.40 },
|
||||
"azure-o4-mini": { input: 1.10, output: 4.40 },
|
||||
|
||||
Reference in New Issue
Block a user