Skip to content

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]

Merge remote-tracking branch 'origin/main' into litellm_e2e_cost_calculation_scripted_provider

kerry3a5121e12663
diff --cc tests/e2e/conftest.py
index fd7b2f43f33,ac4cfb71407..2c4346b96f4
--- a/tests/e2e/conftest.py
+++ b/tests/e2e/conftest.py
@@@ -23,8 -23,8 +23,9 @@@ from typing import Fina
import pytest
import requests
from e2e_config import (
+ CLI_DETERMINISM_OPT_IN_ENV,
CONTROL_PLANE_BASE_URL,
+ COST_MAP_OPT_IN_ENV,
FIXTURE_DIR,
FIXTURE_MODE_RAW,
MANAGED_FILES_OPT_IN_ENV,
@@@ -54,7 -54,7 +55,8 @@@ OPT_IN_MARKERS: Final = MappingProxyTyp
"managed_files": MANAGED_FILES_OPT_IN_ENV,
"prompt_caching_stack": PROMPT_CACHING_OPT_IN_ENV,
"redis_chaos": REDIS_CHAOS_OPT_IN_ENV,
+ "cost_map_stack": COST_MAP_OPT_IN_ENV,
+ "cli_determinism": CLI_DETERMINISM_OPT_IN_ENV,
}
)
diff --cc tests/e2e/e2e_config.py
index a891d9dcba2,82ddb09f7f5..b34eadd8744
--- a/tests/e2e/e2e_config.py
+++ b/tests/e2e/e2e_config.py
@@@ -145,22 -145,7 +145,27 @@@ WEEKLY_ANOMALY_OPT_IN_ENV = "E2E_WEEKLY
MANAGED_FILES_OPT_IN_ENV = "E2E_MANAGED_FILES_STACK"
PROMPT_CACHING_OPT_IN_ENV = "E2E_PROMPT_CACHING_STACK"
REDIS_CHAOS_OPT_IN_ENV = "E2E_REDIS_CHAOS"
++<<<<<<< HEAD
+# The cost_calculation suite needs a proxy booted with LITELLM_MODEL_COST_MAP_URL
+# pointing at tests/e2e/cost_map.json (its whole map is test-owned rates) plus a
+# scripted-provider sidecar; deselected unless the opt-in env var is set.
+COST_MAP_OPT_IN_ENV = "E2E_COST_MAP_STACK"
+# Base URL of the proxy running the test cost map. Defaults to the shared proxy
+# so a local run only has to set the opt-in and boot the proxy accordingly.
+COST_MAP_PROXY_URL = os.environ.get("E2E_COST_MAP_PROXY_URL", PROXY_BASE_URL).rstrip("/")
+# Where the test runner reaches the scripted-provider sidecar's control API.
+SCRIPTED_PROVIDER_CONTROL_URL = os.environ.get(
+ "E2E_SCRIPTED_PROVIDER_CONTROL_URL", "http://127.0.0.1:9100"
+).rstrip("/")
+# The api_base root deployments register with: how the proxy (possibly in
+# another container) reaches the sidecar's provider wire.
+SCRIPTED_PROVIDER_PROXY_BASE = os.environ.get(
+ "E2E_SCRIPTED_PROVIDER_PROXY_BASE", SCRIPTED_PROVIDER_CONTROL_URL
+).rstrip("/")
++||||||| 930ec9643a
++=======
++CLI_DETERMINISM_OPT_IN_ENV = "E2E_CLI_DETERMINISM"
+ CLI_DETERMINISM_OPT_IN_ENV = "E2E_CLI_DETERMINISM"
ANOMALY_SESSIONS = int(os.environ.get("E2E_ANOMALY_SESSIONS", "6"))
ANOMALY_TURNS_PER_SESSION = int(os.environ.get("E2E_ANOMALY_TURNS_PER_SESSION", "6"))
ANOMALY_TURN_ATTEMPTS = int(os.environ.get("E2E_ANOMALY_TURN_ATTEMPTS", "3"))
diff --cc tests/e2e/pytest.ini
index 7d37bcc6d3e,f6d23a3ec12..2ad58894642
--- a/tests/e2e/pytest.ini
+++ b/tests/e2e/pytest.ini
@@@ -10,5 -10,5 +10,6 @@@ markers
weekly: real-provider anomaly load test that spends real money; deselected unless E2E_WEEKLY_ANOMALY is set
managed_files: needs a proxy running with require_managed_files enabled; deselected unless E2E_MANAGED_FILES_STACK is set
prompt_caching_stack: needs a proxy running with router_settings.optional_pre_call_checks including prompt_caching; deselected unless E2E_PROMPT_CACHING_STACK is set
+ cli_determinism: drives the real claude CLI for several seconds, which widens the window in which another test's in-flight upstream call is attributed to it; deselected unless E2E_CLI_DETERMINISM is set
redis_chaos: load test that pauses the proxy's Redis outright mid-run; needs a proxy booted from gateway/redis_chaos_ci_config.yml on the same host, and is deselected unless E2E_REDIS_CHAOS is set
+ cost_map_stack: needs a proxy whose whole cost map is tests/e2e/cost_map.json (LITELLM_MODEL_COST_MAP_URL) plus a scripted-provider sidecar; deselected unless E2E_COST_MAP_STACK is set