The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
ArizePhoenixConfig
Ishaan Jaffer8fbf060ac592
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex a7b75cb001f..901bceaa3bc 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -5714,6 +5714,20 @@"supports_tool_choice": true,"supports_vision": true},+ "bedrock/us-gov-west-1/claude-sonnet-4-5-20250929-v1:0": {+ "input_cost_per_token": 3.3e-06,+ "litellm_provider": "bedrock",+ "max_input_tokens": 200000,+ "max_output_tokens": 4096,+ "max_tokens": 4096,+ "mode": "chat",+ "output_cost_per_token": 1.65e-05,+ "supports_function_calling": true,+ "supports_pdf_input": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "supports_vision": true+ },"bedrock/us-gov-west-1/meta.llama3-70b-instruct-v1:0": {"input_cost_per_token": 2.65e-06,"litellm_provider": "bedrock",@@ -24634,10 +24648,52 @@"supports_tool_choice": true},"vertex_ai/gemini-2.5-flash-image": {+ "cache_read_input_token_cost": 3e-08,+ "input_cost_per_audio_token": 1e-06,+ "input_cost_per_token": 3e-07,"litellm_provider": "vertex_ai-language-models",+ "max_audio_length_hours": 8.4,+ "max_audio_per_prompt": 1,+ "max_images_per_prompt": 3000,+ "max_input_tokens": 32768,+ "max_output_tokens": 32768,+ "max_tokens": 32768,+ "max_pdf_size_mb": 30,+ "max_video_length": 1,+ "max_videos_per_prompt": 10,"mode": "image_generation","output_cost_per_image": 0.039,- "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/image-generation#edit-an-image"+ "output_cost_per_reasoning_token": 2.5e-06,+ "output_cost_per_token": 2.5e-06,+ "rpm": 100000,+ "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/image-generation#edit-an-image",+ "supported_endpoints": [+ "/v1/chat/completions",+ "/v1/completions",+ "/v1/batch"+ ],+ "supported_modalities": [+ "text",+ "image",+ "audio",+ "video"+ ],+ "supported_output_modalities": [+ "text",+ "image"+ ],+ "supports_audio_output": false,+ "supports_function_calling": true,+ "supports_parallel_function_calling": true,+ "supports_pdf_input": true,+ "supports_prompt_caching": true,+ "supports_response_schema": true,+ "supports_system_messages": true,+ "supports_tool_choice": true,+ "supports_url_context": true,+ "supports_vision": true,+ "supports_web_search": false,+ "tpm": 8000000},"vertex_ai/gemini-3-pro-image-preview": {"input_cost_per_image": 0.0011,diff --git a/tests/local_testing/test_arize_phoenix.py b/tests/local_testing/test_arize_phoenix.pyindex 920b5ac04d2..930ebb73c53 100644--- a/tests/local_testing/test_arize_phoenix.py+++ b/tests/local_testing/test_arize_phoenix.py@@ -27,82 +27,3 @@ async def test_async_otel_callback():)await asyncio.sleep(2)--- "env_vars, expected_headers, expected_endpoint, expected_protocol",- [- pytest.param(- {"PHOENIX_API_KEY": "test_api_key"},- "api_key=test_api_key",- "https://app.phoenix.arize.com/v1/traces",- "otlp_http",- id="default to http protocol and Arize hosted Phoenix endpoint",- ),- pytest.param(- {"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "", "PHOENIX_API_KEY": "test_api_key"},- "api_key=test_api_key",- "https://app.phoenix.arize.com/v1/traces",- "otlp_http",- id="empty string/unset endpoint will default to http protocol and Arize hosted Phoenix endpoint",- ),- pytest.param(- {"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "http://localhost:4318", "PHOENIX_COLLECTOR_ENDPOINT": "http://localhost:4317", "PHOENIX_API_KEY": "test_api_key"},- "Authorization=Bearer%20test_api_key",- "http://localhost:4318",- "otlp_http",- id="prioritize http if both endpoints are set",- ),- pytest.param(- {"PHOENIX_COLLECTOR_ENDPOINT": "https://localhost:6006", "PHOENIX_API_KEY": "test_api_key"},- "Authorization=Bearer%20test_api_key",- "https://localhost:6006",- "otlp_grpc",- id="custom grpc endpoint",- ),- pytest.param(- {"PHOENIX_COLLECTOR_ENDPOINT": "https://localhost:6006"},- None,- "https://localhost:6006",- "otlp_grpc",- id="custom grpc endpoint with no auth",- ),- pytest.param(- {"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "https://localhost:6006", "PHOENIX_API_KEY": "test_api_key"},- "Authorization=Bearer%20test_api_key",- "https://localhost:6006",- "otlp_http",- id="custom http endpoint",- ),- ],-)-def test_get_arize_phoenix_config(monkeypatch, env_vars, expected_headers, expected_endpoint, expected_protocol):- for key, value in env_vars.items():- monkeypatch.setenv(key, value)-- config = ArizePhoenixLogger.get_arize_phoenix_config()-- assert isinstance(config, ArizePhoenixConfig)- assert config.otlp_auth_headers == expected_headers- assert config.endpoint == expected_endpoint- assert config.protocol == expected_protocol-- "env_vars",- [- pytest.param(- {"PHOENIX_COLLECTOR_ENDPOINT": "https://app.phoenix.arize.com/v1/traces"},- id="missing api_key with explicit Arize Phoenix endpoint"- ),- pytest.param(- {},- id="missing api_key with no endpoint (defaults to Arize Phoenix)"- ),- ],-)-def test_get_arize_phoenix_config_expection_on_missing_api_key(monkeypatch, env_vars):- for key, value in env_vars.items():- monkeypatch.setenv(key, value)-- with pytest.raises(ValueError, match=f"PHOENIX_API_KEY must be set when the Arize hosted Phoenix endpoint is used."):- ArizePhoenixLogger.get_arize_phoenix_config()diff --git a/tests/test_litellm/integrations/arize/test_arize_phoenix.py b/tests/test_litellm/integrations/arize/test_arize_phoenix.pyindex 552f7538443..aa227fbff5e 100644--- a/tests/test_litellm/integrations/arize/test_arize_phoenix.py+++ b/tests/test_litellm/integrations/arize/test_arize_phoenix.py@@ -1,7 +1,12 @@import unittestfrom unittest.mock import patch-from litellm.integrations.arize.arize_phoenix import ArizePhoenixLogger+import pytest++from litellm.integrations.arize.arize_phoenix import (+ ArizePhoenixConfig,+ ArizePhoenixLogger,+)class TestArizePhoenixConfig(unittest.TestCase):@@ -87,5 +92,108 @@ class TestArizePhoenixConfig(unittest.TestCase):self.assertIsNone(config.otlp_auth_headers)++ "env_vars, expected_headers, expected_endpoint, expected_protocol",+ [+ pytest.param(+ {"PHOENIX_API_KEY": "test_api_key"},+ "Authorization=Bearer test_api_key",+ "http://localhost:6006/v1/traces",+ "otlp_http",+ id="default to http protocol and self-hosted Phoenix endpoint",+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "", "PHOENIX_API_KEY": "test_api_key"},+ "Authorization=Bearer test_api_key",+ "http://localhost:6006/v1/traces",+ "otlp_http",+ id="empty string/unset endpoint will default to http protocol and self-hosted Phoenix endpoint",+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "http://localhost:4318", "PHOENIX_COLLECTOR_ENDPOINT": "http://localhost:4317", "PHOENIX_API_KEY": "test_api_key"},+ "Authorization=Bearer test_api_key",+ "http://localhost:4318/v1/traces",+ "otlp_http",+ id="prioritize http if both endpoints are set",+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_ENDPOINT": "https://localhost:6006", "PHOENIX_API_KEY": "test_api_key"},+ "Authorization=Bearer test_api_key",+ "https://localhost:6006/v1/traces",+ "otlp_http",+ id="custom https endpoint treated as http",+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_ENDPOINT": "https://localhost:6006"},+ None,+ "https://localhost:6006/v1/traces",+ "otlp_http",+ id="custom https endpoint with no auth treated as http",+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_ENDPOINT": "grpc://localhost:6006", "PHOENIX_API_KEY": "test_api_key"},+ "Authorization=Bearer test_api_key",+ "grpc://localhost:6006",+ "otlp_grpc",+ id="explicit grpc endpoint with grpc:// prefix",+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_ENDPOINT": "http://localhost:4317"},+ None,+ "http://localhost:4317",+ "otlp_grpc",+ id="grpc endpoint with standard grpc port 4317",+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "https://localhost:6006", "PHOENIX_API_KEY": "test_api_key"},+ "Authorization=Bearer test_api_key",+ "https://localhost:6006/v1/traces",+ "otlp_http",+ id="custom http endpoint",+ ),+ ],+)+def test_get_arize_phoenix_config(monkeypatch, env_vars, expected_headers, expected_endpoint, expected_protocol):+ # Clear all Phoenix-related env vars first to ensure clean state+ for key in ["PHOENIX_API_KEY", "PHOENIX_COLLECTOR_ENDPOINT", "PHOENIX_COLLECTOR_HTTP_ENDPOINT"]:+ monkeypatch.delenv(key, raising=False)++ for key, value in env_vars.items():+ monkeypatch.setenv(key, value)++ config = ArizePhoenixLogger.get_arize_phoenix_config()++ assert isinstance(config, ArizePhoenixConfig)+ assert config.otlp_auth_headers == expected_headers+ assert config.endpoint == expected_endpoint+ assert config.protocol == expected_protocol++ "env_vars",+ [+ pytest.param(+ {"PHOENIX_COLLECTOR_ENDPOINT": "https://app.phoenix.arize.com/v1/traces"},+ id="missing api_key with explicit Arize Phoenix Cloud endpoint"+ ),+ pytest.param(+ {"PHOENIX_COLLECTOR_HTTP_ENDPOINT": "https://app.phoenix.arize.com/v1/traces"},+ id="missing api_key with HTTP Arize Phoenix Cloud endpoint"+ ),+ ],+)+def test_get_arize_phoenix_config_expection_on_missing_api_key(monkeypatch, env_vars):+ # Clear all Phoenix-related env vars first to ensure clean state+ for key in ["PHOENIX_API_KEY", "PHOENIX_COLLECTOR_ENDPOINT", "PHOENIX_COLLECTOR_HTTP_ENDPOINT"]:+ monkeypatch.delenv(key, raising=False)++ for key, value in env_vars.items():+ monkeypatch.setenv(key, value)++ with pytest.raises(ValueError, match="PHOENIX_API_KEY must be set when using Phoenix Cloud"):+ ArizePhoenixLogger.get_arize_phoenix_config()+++if __name__ == "__main__":unittest.main()