From 7d88da123c0d8319f352962fb45d82e69e6e4dc4 Mon Sep 17 00:00:00 2001 From: celeste1900 <253458269+celeste1900@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:11:19 +0800 Subject: [PATCH] Add Ofox as an OpenAI-compatible provider (100 models) --- litellm/llms/openai_like/providers.json | 12 + model_prices_and_context_window.json | 1189 +++++++++++++++++ provider_endpoints_support.json | 17 + .../llms/openai_like/test_ofox_provider.py | 63 + 4 files changed, 1281 insertions(+) create mode 100644 tests/litellm/llms/openai_like/test_ofox_provider.py diff --git a/litellm/llms/openai_like/providers.json b/litellm/llms/openai_like/providers.json index d87346fea70..9b86a2729a4 100644 --- a/litellm/llms/openai_like/providers.json +++ b/litellm/llms/openai_like/providers.json @@ -176,5 +176,17 @@ "max_completion_tokens": "max_tokens" }, "supported_endpoints": ["/v1/chat/completions", "/v1/responses", "/v1/embeddings"] + }, + "ofox": { + "base_url": "https://api.ofox.ai/v1", + "api_key_env": "OFOX_API_KEY", + "api_base_env": "OFOX_API_BASE", + "param_mappings": { + "max_completion_tokens": "max_tokens" + }, + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ] } } diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index a3dcdaed3f7..ac32f13cef4 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -44072,5 +44072,1194 @@ } } ] + }, + "ofox/anthropic/claude-haiku-4.5": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 64000, + "input_cost_per_token": 1e-06, + "output_cost_per_token": 5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1e-07 + }, + "ofox/anthropic/claude-opus-4.5": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 64000, + "input_cost_per_token": 5e-06, + "output_cost_per_token": 2.5e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-07 + }, + "ofox/anthropic/claude-opus-4.6": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "input_cost_per_token": 5e-06, + "output_cost_per_token": 2.5e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-07 + }, + "ofox/anthropic/claude-opus-4.7": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "input_cost_per_token": 5e-06, + "output_cost_per_token": 2.5e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-07 + }, + "ofox/anthropic/claude-opus-4.8": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "input_cost_per_token": 5e-06, + "output_cost_per_token": 2.5e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-07 + }, + "ofox/anthropic/claude-sonnet-4.5": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 3e-06, + "output_cost_per_token": 1.5e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 3e-07 + }, + "ofox/anthropic/claude-sonnet-4.6": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "input_cost_per_token": 3e-06, + "output_cost_per_token": 1.5e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 3e-07 + }, + "ofox/anthropic/claude-sonnet-5": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2e-07 + }, + "ofox/bailian/qwen-flash": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 32000, + "input_cost_per_token": 2.2e-08, + "output_cost_per_token": 2.2e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 4.3e-09 + }, + "ofox/bailian/qwen-max": { + "max_tokens": 32000, + "max_input_tokens": 32000, + "max_output_tokens": 8000, + "input_cost_per_token": 3.5e-07, + "output_cost_per_token": 1.38e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 6.9e-08 + }, + "ofox/bailian/qwen-plus": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 32000, + "input_cost_per_token": 1.2e-07, + "output_cost_per_token": 2.9e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.3e-08 + }, + "ofox/bailian/qwen-turbo": { + "max_tokens": 128000, + "max_input_tokens": 128000, + "max_output_tokens": 16000, + "input_cost_per_token": 5e-08, + "output_cost_per_token": 9e-08, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 8.6e-09 + }, + "ofox/bailian/qwen-vl-max": { + "max_tokens": 128000, + "max_input_tokens": 128000, + "max_output_tokens": 8000, + "input_cost_per_token": 2.3e-07, + "output_cost_per_token": 5.8e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 4.6e-08 + }, + "ofox/bailian/qwen3-coder-flash": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 5e-07, + "output_cost_per_token": 2.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 6e-08 + }, + "ofox/bailian/qwen3-coder-next": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 2e-07, + "output_cost_per_token": 1.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": false, + "supports_vision": false + }, + "ofox/bailian/qwen3-coder-plus": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 1.8e-06, + "output_cost_per_token": 9e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2e-07 + }, + "ofox/bailian/qwen3-max": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 3.6e-07, + "output_cost_per_token": 1.43e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 7.2e-08 + }, + "ofox/bailian/qwen3.5-122b-a10b": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 2.9e-07, + "output_cost_per_token": 2.29e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.9e-07 + }, + "ofox/bailian/qwen3.5-27b": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 2.9e-07, + "output_cost_per_token": 2.05e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.9e-07 + }, + "ofox/bailian/qwen3.5-35b-a3b": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 2.9e-07, + "output_cost_per_token": 1.83e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.9e-07 + }, + "ofox/bailian/qwen3.5-397b-a17b": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 5.5e-07, + "output_cost_per_token": 3.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5.5e-07 + }, + "ofox/bailian/qwen3.5-flash": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 1e-07, + "output_cost_per_token": 4e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1e-08 + }, + "ofox/bailian/qwen3.5-plus": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 4e-07, + "output_cost_per_token": 2.4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 4e-08 + }, + "ofox/bailian/qwen3.6-27b": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 6e-07, + "output_cost_per_token": 3.6e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true + }, + "ofox/bailian/qwen3.6-flash": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 2.5e-07, + "output_cost_per_token": 1.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.5e-08 + }, + "ofox/bailian/qwen3.6-max-preview": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1.2e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2e-07 + }, + "ofox/bailian/qwen3.6-plus": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 5e-07, + "output_cost_per_token": 3e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-08 + }, + "ofox/bailian/qwen3.7-max": { + "max_tokens": 1064000, + "max_input_tokens": 1064000, + "max_output_tokens": 64000, + "input_cost_per_token": 2.5e-06, + "output_cost_per_token": 7.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.5e-07 + }, + "ofox/bailian/qwen3.7-plus": { + "max_tokens": 1064000, + "max_input_tokens": 1064000, + "max_output_tokens": 64000, + "input_cost_per_token": 4e-07, + "output_cost_per_token": 1.6e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 8e-08 + }, + "ofox/deepseek/deepseek-v3.2": { + "max_tokens": 128000, + "max_input_tokens": 128000, + "max_output_tokens": 32000, + "input_cost_per_token": 2.9e-07, + "output_cost_per_token": 4.3e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 6e-08 + }, + "ofox/deepseek/deepseek-v4-flash": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 384000, + "input_cost_per_token": 1.4e-07, + "output_cost_per_token": 2.8e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.8e-09 + }, + "ofox/deepseek/deepseek-v4-pro": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 384000, + "input_cost_per_token": 4.5e-07, + "output_cost_per_token": 8.8e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 3.7e-09 + }, + "ofox/google/gemini-2.5-flash": { + "max_tokens": 1048576, + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 2.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/google/gemini-2.5-flash-image": { + "max_tokens": 32000, + "max_input_tokens": 32000, + "max_output_tokens": 32000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 2.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": false, + "supports_vision": true + }, + "ofox/google/gemini-2.5-flash-lite": { + "max_tokens": 1048576, + "max_input_tokens": 1048576, + "max_output_tokens": 65535, + "input_cost_per_token": 1e-07, + "output_cost_per_token": 4e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.5e-08 + }, + "ofox/google/gemini-2.5-pro": { + "max_tokens": 1048576, + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "input_cost_per_token": 1.25e-06, + "output_cost_per_token": 1e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.25e-07 + }, + "ofox/google/gemini-3-flash-preview": { + "max_tokens": 1048576, + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "input_cost_per_token": 5e-07, + "output_cost_per_token": 3e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-08 + }, + "ofox/google/gemini-3-pro-image": { + "max_tokens": 66000, + "max_input_tokens": 66000, + "max_output_tokens": 32000, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1.2e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": false, + "supports_vision": true + }, + "ofox/google/gemini-3-pro-image-preview": { + "max_tokens": 64000, + "max_input_tokens": 64000, + "max_output_tokens": 32000, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1.2e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": false, + "supports_vision": true + }, + "ofox/google/gemini-3.1-flash-image": { + "max_tokens": 131000, + "max_input_tokens": 131000, + "max_output_tokens": 64000, + "input_cost_per_token": 5e-07, + "output_cost_per_token": 3e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": false, + "supports_vision": true + }, + "ofox/google/gemini-3.1-flash-image-preview": { + "max_tokens": 64000, + "max_input_tokens": 64000, + "max_output_tokens": 64000, + "input_cost_per_token": 5e-07, + "output_cost_per_token": 3e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": false, + "supports_vision": true + }, + "ofox/google/gemini-3.1-flash-lite": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 64000, + "input_cost_per_token": 2.5e-07, + "output_cost_per_token": 1.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.5e-08 + }, + "ofox/google/gemini-3.1-flash-lite-image": { + "max_tokens": 66000, + "max_input_tokens": 66000, + "max_output_tokens": 64000, + "input_cost_per_token": 2.5e-07, + "output_cost_per_token": 1.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": false, + "supports_vision": true + }, + "ofox/google/gemini-3.1-pro-preview": { + "max_tokens": 1048576, + "max_input_tokens": 1048576, + "max_output_tokens": 65536, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1.2e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2e-07 + }, + "ofox/google/gemini-3.5-flash": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 65536, + "input_cost_per_token": 1.5e-06, + "output_cost_per_token": 9e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.5e-07 + }, + "ofox/minimax/m2-her": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 131000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 1.2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false + }, + "ofox/minimax/minimax-m2": { + "max_tokens": 204800, + "max_input_tokens": 204800, + "max_output_tokens": 131000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 1.2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/minimax/minimax-m2.1": { + "max_tokens": 204800, + "max_input_tokens": 204800, + "max_output_tokens": 131000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 1.2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/minimax/minimax-m2.1-lightning": { + "max_tokens": 204800, + "max_input_tokens": 204800, + "max_output_tokens": 131000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 2.4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/minimax/minimax-m2.5": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 131000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 1.2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/minimax/minimax-m2.5-lightning": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 131000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 2.4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/minimax/minimax-m2.7": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 131000, + "input_cost_per_token": 3e-07, + "output_cost_per_token": 1.2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 6e-08 + }, + "ofox/minimax/minimax-m2.7-highspeed": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 131000, + "input_cost_per_token": 6e-07, + "output_cost_per_token": 2.4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 6e-08 + }, + "ofox/minimax/minimax-m3": { + "max_tokens": 1131000, + "max_input_tokens": 1131000, + "max_output_tokens": 131000, + "input_cost_per_token": 6e-07, + "output_cost_per_token": 2.4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.2e-07 + }, + "ofox/moonshotai/kimi-k2.5": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 6e-07, + "output_cost_per_token": 3e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1e-07 + }, + "ofox/moonshotai/kimi-k2.6": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 9.5e-07, + "output_cost_per_token": 4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.6e-07 + }, + "ofox/moonshotai/kimi-k2.7-code": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 9.5e-07, + "output_cost_per_token": 4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 1.9e-07 + }, + "ofox/moonshotai/kimi-k2.7-code-highspeed": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 9.5e-07, + "output_cost_per_token": 4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 1.9e-07 + }, + "ofox/openai/gpt-4.1": { + "max_tokens": 1047576, + "max_input_tokens": 1047576, + "max_output_tokens": 32768, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 8e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-07 + }, + "ofox/openai/gpt-4.1-mini": { + "max_tokens": 1047576, + "max_input_tokens": 1047576, + "max_output_tokens": 32768, + "input_cost_per_token": 4e-07, + "output_cost_per_token": 1.6e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1e-07 + }, + "ofox/openai/gpt-4o": { + "max_tokens": 128000, + "max_input_tokens": 128000, + "max_output_tokens": 16384, + "input_cost_per_token": 2.5e-06, + "output_cost_per_token": 1e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.25e-06 + }, + "ofox/openai/gpt-4o-mini": { + "max_tokens": 128000, + "max_input_tokens": 128000, + "max_output_tokens": 16384, + "input_cost_per_token": 1.5e-07, + "output_cost_per_token": 6e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 7.5e-08 + }, + "ofox/openai/gpt-5": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 65536, + "input_cost_per_token": 1.25e-06, + "output_cost_per_token": 1e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.3e-07 + }, + "ofox/openai/gpt-5-mini": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 32768, + "input_cost_per_token": 2.5e-07, + "output_cost_per_token": 2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/openai/gpt-5-nano": { + "max_tokens": 128000, + "max_input_tokens": 128000, + "max_output_tokens": 16384, + "input_cost_per_token": 5e-08, + "output_cost_per_token": 4e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 1e-08 + }, + "ofox/openai/gpt-5.1": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.25e-06, + "output_cost_per_token": 1e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.3e-07 + }, + "ofox/openai/gpt-5.1-codex-max": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.25e-06, + "output_cost_per_token": 1e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.3e-07 + }, + "ofox/openai/gpt-5.1-codex-mini": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 65536, + "input_cost_per_token": 2.5e-07, + "output_cost_per_token": 2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/openai/gpt-5.2": { + "max_tokens": 512000, + "max_input_tokens": 512000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.75e-06, + "output_cost_per_token": 1.4e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.8e-07 + }, + "ofox/openai/gpt-5.2-codex": { + "max_tokens": 512000, + "max_input_tokens": 512000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.75e-06, + "output_cost_per_token": 1.4e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.8e-07 + }, + "ofox/openai/gpt-5.3-codex": { + "max_tokens": 512000, + "max_input_tokens": 512000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.75e-06, + "output_cost_per_token": 1.4e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.8e-07 + }, + "ofox/openai/gpt-5.4": { + "max_tokens": 1050000, + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "input_cost_per_token": 2.5e-06, + "output_cost_per_token": 1.5e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.5e-07 + }, + "ofox/openai/gpt-5.4-mini": { + "max_tokens": 400000, + "max_input_tokens": 400000, + "max_output_tokens": 128000, + "input_cost_per_token": 7.5e-07, + "output_cost_per_token": 4.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 7.5e-08 + }, + "ofox/openai/gpt-5.4-nano": { + "max_tokens": 400000, + "max_input_tokens": 400000, + "max_output_tokens": 128000, + "input_cost_per_token": 2e-07, + "output_cost_per_token": 1.25e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2e-08 + }, + "ofox/openai/gpt-5.4-pro": { + "max_tokens": 1050000, + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "input_cost_per_token": 3e-05, + "output_cost_per_token": 0.00018, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true + }, + "ofox/openai/gpt-5.5": { + "max_tokens": 1050000, + "max_input_tokens": 1050000, + "max_output_tokens": 128000, + "input_cost_per_token": 5e-06, + "output_cost_per_token": 3e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-07 + }, + "ofox/volcengine/doubao-seed-1-6": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 1.2e-07, + "output_cost_per_token": 2.9e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.3e-08 + }, + "ofox/volcengine/doubao-seed-1-6-flash": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 32000, + "input_cost_per_token": 3e-08, + "output_cost_per_token": 2.2e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 4.3e-09 + }, + "ofox/volcengine/doubao-seed-1-6-vision": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 32000, + "input_cost_per_token": 1.2e-07, + "output_cost_per_token": 1.15e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.3e-08 + }, + "ofox/volcengine/doubao-seed-1-8": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 64000, + "input_cost_per_token": 1.2e-07, + "output_cost_per_token": 2.9e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.3e-08 + }, + "ofox/volcengine/doubao-seed-2.0-code": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 128000, + "input_cost_per_token": 6.7e-07, + "output_cost_per_token": 3.36e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.4e-07 + }, + "ofox/volcengine/doubao-seed-2.0-lite": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 32000, + "input_cost_per_token": 1.3e-07, + "output_cost_per_token": 7.6e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 3e-08 + }, + "ofox/volcengine/doubao-seed-2.0-mini": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 32000, + "input_cost_per_token": 6e-08, + "output_cost_per_token": 5.6e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2e-08 + }, + "ofox/volcengine/doubao-seed-2.0-pro": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 128000, + "input_cost_per_token": 6.7e-07, + "output_cost_per_token": 3.36e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.4e-07 + }, + "ofox/volcengine/doubao-seed-2.1-pro": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "input_cost_per_token": 8.84e-07, + "output_cost_per_token": 4.42e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.77e-07 + }, + "ofox/volcengine/doubao-seed-2.1-turbo": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "input_cost_per_token": 4.42e-07, + "output_cost_per_token": 2.212e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 8.5e-08 + }, + "ofox/volcengine/doubao-seed-character": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "input_cost_per_token": 1.77e-07, + "output_cost_per_token": 8.84e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.4e-08 + }, + "ofox/volcengine/doubao-seed-evolving": { + "max_tokens": 256000, + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "input_cost_per_token": 8.84e-07, + "output_cost_per_token": 4.42e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 1.77e-07 + }, + "ofox/x-ai/grok-4.1-fast": { + "max_tokens": 2000000, + "max_input_tokens": 2000000, + "max_output_tokens": 30000, + "input_cost_per_token": 2e-07, + "output_cost_per_token": 5e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 5e-08 + }, + "ofox/x-ai/grok-4.20": { + "max_tokens": 2000000, + "max_input_tokens": 2000000, + "max_output_tokens": 128000, + "input_cost_per_token": 4e-06, + "output_cost_per_token": 1.2e-05, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 4e-07 + }, + "ofox/x-ai/grok-4.3": { + "max_tokens": 1000000, + "max_input_tokens": 1000000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.25e-06, + "output_cost_per_token": 2.5e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2e-08 + }, + "ofox/z-ai/glm-4.6": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 4e-07, + "output_cost_per_token": 1.9e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 1.1e-07 + }, + "ofox/z-ai/glm-4.7": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 4e-07, + "output_cost_per_token": 2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 8e-08 + }, + "ofox/z-ai/glm-4.7-flash:free": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 0.0, + "output_cost_per_token": 0.0, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false + }, + "ofox/z-ai/glm-4.7-flashx": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 7.2e-08, + "output_cost_per_token": 4.3e-07, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 1.5e-08 + }, + "ofox/z-ai/glm-5": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 1e-06, + "output_cost_per_token": 3.2e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2e-07 + }, + "ofox/z-ai/glm-5-turbo": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.2e-06, + "output_cost_per_token": 4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.4e-07 + }, + "ofox/z-ai/glm-5.1": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.4e-06, + "output_cost_per_token": 4.4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.6e-07 + }, + "ofox/z-ai/glm-5.2": { + "max_tokens": 1048576, + "max_input_tokens": 1048576, + "max_output_tokens": 128000, + "input_cost_per_token": 1.4e-06, + "output_cost_per_token": 4.4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": false, + "cache_read_input_token_cost": 2.6e-07 + }, + "ofox/z-ai/glm-5v-turbo": { + "max_tokens": 200000, + "max_input_tokens": 200000, + "max_output_tokens": 128000, + "input_cost_per_token": 1.2e-06, + "output_cost_per_token": 4e-06, + "litellm_provider": "ofox", + "mode": "chat", + "supports_function_calling": true, + "supports_vision": true, + "cache_read_input_token_cost": 2.4e-07 } } diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json index 3034ada56ba..79cd61bd09a 100644 --- a/provider_endpoints_support.json +++ b/provider_endpoints_support.json @@ -2924,6 +2924,23 @@ "rerank": false, "a2a": false } + }, + "ofox": { + "display_name": "Ofox (`ofox`)", + "url": "https://docs.litellm.ai/docs/providers/ofox", + "endpoints": { + "chat_completions": true, + "messages": false, + "responses": true, + "embeddings": true, + "image_generations": true, + "audio_transcriptions": true, + "audio_speech": false, + "moderations": false, + "batches": false, + "rerank": false, + "a2a": false + } } }, "endpoints": { diff --git a/tests/litellm/llms/openai_like/test_ofox_provider.py b/tests/litellm/llms/openai_like/test_ofox_provider.py new file mode 100644 index 00000000000..f8291a1a085 --- /dev/null +++ b/tests/litellm/llms/openai_like/test_ofox_provider.py @@ -0,0 +1,63 @@ +""" +Unit tests for the Ofox OpenAI-like provider. +""" + +import os +import sys + +sys.path.insert( + 0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../..")) +) + +from litellm.llms.openai_like.dynamic_config import create_config_class +from litellm.llms.openai_like.json_loader import JSONProviderRegistry + +OFOX_BASE_URL = "https://api.ofox.ai/v1" + + +def _get_config(): + provider = JSONProviderRegistry.get("ofox") + assert provider is not None + config_class = create_config_class(provider) + return config_class() + + +def test_ofox_provider_registered(): + provider = JSONProviderRegistry.get("ofox") + assert provider is not None + assert provider.base_url == OFOX_BASE_URL + assert provider.api_key_env == "OFOX_API_KEY" + assert provider.api_base_env == "OFOX_API_BASE" + + +def test_ofox_resolves_env_api_key(monkeypatch): + config = _get_config() + monkeypatch.setenv("OFOX_API_KEY", "test-key") + api_base, api_key = config._get_openai_compatible_provider_info(None, None) + assert api_base == OFOX_BASE_URL + assert api_key == "test-key" + + +def test_ofox_maps_max_completion_tokens(): + config = _get_config() + params = config.map_openai_params( + non_default_params={"max_completion_tokens": 256}, + optional_params={}, + model="ofox/openai/gpt-5.5", + drop_params=False, + ) + assert params.get("max_tokens") == 256 + assert "max_completion_tokens" not in params + + +def test_ofox_complete_url_appends_endpoint(): + config = _get_config() + url = config.get_complete_url( + api_base=OFOX_BASE_URL, + api_key="test-key", + model="ofox/openai/gpt-5.5", + optional_params={}, + litellm_params={}, + stream=False, + ) + assert url == f"{OFOX_BASE_URL}/chat/completions"