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]

test(cli): drop lite --version subprocess regression

kerry1fc1aaabdaa3
diff --git a/tests/test_litellm/proxy/client/cli/test_global_options.py b/tests/test_litellm/proxy/client/cli/test_global_options.py
index 9ed9f91ab9f..b73d1acc6e3 100644
--- a/tests/test_litellm/proxy/client/cli/test_global_options.py
+++ b/tests/test_litellm/proxy/client/cli/test_global_options.py
@@ -1,10 +1,6 @@
# stdlib imports
import json
import os
-import shutil
-import subprocess
-import threading
-from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from unittest.mock import Mock, patch
@@ -37,58 +33,6 @@ def test_cli_version_flag(cli_runner):
assert "LiteLLM Proxy Server Version: 1.2.3" in result.output
-def test_lite_version_does_not_fetch_model_cost_map(tmp_path: Path) -> None:
- lite_path = shutil.which("lite")
- if lite_path is None:
- pytest.skip("lite executable is unavailable")
-
- request_log: Path = tmp_path / "requests.log"
-
- class _CostMapHandler(BaseHTTPRequestHandler):
- def do_GET(self) -> None:
- with request_log.open("a", encoding="utf-8") as log_file:
- log_file.write(f"{self.path}\n")
- body = b'{"test-model": {"litellm_provider": "openai", "mode": "chat"}}'
- self.send_response(200)
- self.send_header("Content-Type", "application/json")
- self.send_header("Content-Length", str(len(body)))
- self.end_headers()
- self.wfile.write(body)
-
- def log_message(self, format: str, *args: object) -> None:
- return
-
- server = ThreadingHTTPServer(("127.0.0.1", 0), _CostMapHandler)
- thread = threading.Thread(target=server.serve_forever, daemon=True)
- thread.start()
- try:
- env = {key: value for key, value in os.environ.items() if key != "LITELLM_LOCAL_MODEL_COST_MAP"}
- source_root = str(Path(__file__).resolve().parents[5])
- env["PYTHONPATH"] = os.pathsep.join(filter(None, (source_root, env.get("PYTHONPATH"))))
- env.update(
- {
- "LITELLM_MODEL_COST_MAP_URL": f"http://127.0.0.1:{server.server_port}/map.json",
- "LITELLM_PROXY_URL": "http://127.0.0.1:9",
- }
- )
- result = subprocess.run(
- [lite_path, "--version"],
- capture_output=True,
- text=True,
- timeout=120,
- env=env,
- )
- finally:
- server.shutdown()
- server.server_close()
- thread.join(timeout=10)
-
- assert result.returncode == 0
- assert "LiteLLM Proxy CLI Version" in result.stdout
- request_count: int = request_log.read_text(encoding="utf-8").count("\n") if request_log.exists() else 0
- assert request_count == 0
-
-
def test_cli_source_is_ascii_only():
"""Non-ASCII output (emoji, box-drawing chars) raises UnicodeEncodeError on legacy Windows
consoles (cp1252), so the whole CLI package must stay ASCII-only."""