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
fix test changes
Ishaan Jaff4948673e3572
diff --git a/tests/proxy_reliability_tests/setup_toxi_proxy.py b/tests/proxy_reliability_tests/setup_toxi_proxy.pydeleted file mode 100644index b44298aca5b..00000000000--- a/tests/proxy_reliability_tests/setup_toxi_proxy.py+++ /dev/null@@ -1,96 +0,0 @@-import os-import platform-import subprocess-import time-import requests-import stat---def download_toxiproxy():- # Determine system architecture and OS- system = platform.system().lower()- machine = platform.machine().lower()-- # Map architecture names- arch_map = {- "x86_64": "amd64",- "amd64": "amd64",- "arm64": "arm64",- "aarch64": "arm64",- }-- arch = arch_map.get(machine, machine)-- # Construct download URL (using latest version 2.5.0)- base_url = "https://github.com/Shopify/toxiproxy/releases/download/v2.5.0/"- if system == "linux":- filename = f"toxiproxy-server-linux-{arch}"- cli_filename = f"toxiproxy-cli-linux-{arch}"- elif system == "darwin":- filename = f"toxiproxy-server-darwin-{arch}"- cli_filename = f"toxiproxy-cli-darwin-{arch}"- else:- raise Exception("Unsupported operating system")-- # Download server- response = requests.get(f"{base_url}{filename}")- with open("toxiproxy-server", "wb") as f:- f.write(response.content)-- # Download CLI- response = requests.get(f"{base_url}{cli_filename}")- with open("toxiproxy-cli", "wb") as f:- f.write(response.content)-- # Make files executable- os.chmod("toxiproxy-server", stat.S_IRWXU)- os.chmod("toxiproxy-cli", stat.S_IRWXU)---def setup_toxiproxy():- # Start toxiproxy-server- server_process = subprocess.Popen(["./toxiproxy-server"])-- # Wait for server to start- time.sleep(2)-- # Create proxy- subprocess.run(- [- "./toxiproxy-cli",- "create",- "-l",- "0.0.0.0:6666",- "-u",- "ep-dry-paper-a69g2y1q-pooler.us-west-2.aws.neon.tech:5432",- "postgres_proxy",- ]- )-- return server_process---def main():- try:- # Download ToxiProxy binaries- download_toxiproxy()-- # Setup ToxiProxy- server_process = setup_toxiproxy()-- print("ToxiProxy setup completed successfully!")- print("Proxy 'postgres_proxy' created and listening on 127.0.0.1:6666")-- # Keep the script running to maintain the proxy- try:- server_process.wait()- except KeyboardInterrupt:- server_process.terminate()- print("\nToxiProxy server stopped")-- except Exception as e:- print(f"Error: {e}")---if __name__ == "__main__":- main()diff --git a/tests/proxy_reliability_tests/test_configs/test_config.yaml b/tests/proxy_reliability_tests/test_configs/test_config.yamldeleted file mode 100644index 4912a35f89f..00000000000--- a/tests/proxy_reliability_tests/test_configs/test_config.yaml+++ /dev/null@@ -1,9 +0,0 @@-model_list:- - model_name: fake-openai-endpoint- litellm_params:- model: openai/fake- api_key: fake-key- api_base: https://exampleopenaiendpoint-production.up.railway.app/--general_settings:- allow_requests_on_db_unavailable: True\ No newline at end of filediff --git a/tests/proxy_reliability_tests/test_using_litellm_db_outage.py b/tests/proxy_reliability_tests/test_using_litellm_db_outage.pydeleted file mode 100644index ea9c7e3f3ab..00000000000--- a/tests/proxy_reliability_tests/test_using_litellm_db_outage.py+++ /dev/null@@ -1,76 +0,0 @@-import asyncio-import os-import subprocess-import sys-import time-import traceback-import pytest--sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path--import litellm--import os-import subprocess-import time--import pytest-import requests--TEST_MASTER_KEY = "sk-1234"---def test_litellm_proxy_server_config_no_general_settings():- # Install the litellm[proxy] package- # Start the server- try:- subprocess.run(["pip", "install", "litellm[proxy]"])- filepath = os.path.dirname(os.path.abspath(__file__))- config_fp = f"{filepath}/test_configs/test_config.yaml"-- # Set DATABASE_URL environment variable- os.environ["DATABASE_URL"] = os.getenv("TOXI_PROXY_DATABASE_URL")- os.environ["LITELLM_MASTER_KEY"] = TEST_MASTER_KEY-- server_process = subprocess.Popen(- [- "python",- "-m",- "litellm.proxy.proxy_cli",- "--config",- config_fp,- ]- )-- # Allow some time for the server to start- time.sleep(60) # Adjust the sleep time if necessary-- # Send a request to the /health/liveliness endpoint- response = requests.get("http://localhost:4000/health/liveliness")-- # Check if the response is successful- assert response.status_code == 200- assert response.json() == "I'm alive!"-- # Test /chat/completions- response = requests.post(- "http://localhost:4000/chat/completions",- headers={"Authorization": "Bearer 1234567890"},- json={- "model": "test_openai_models",- "messages": [{"role": "user", "content": "Hello, how are you?"}],- },- )-- assert response.status_code == 200-- except ImportError:- pytest.fail("Failed to import litellm.proxy_server")- except requests.ConnectionError:- pytest.fail("Failed to connect to the server")- finally:- # Shut down the server- server_process.terminate()- server_process.wait()