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
working code for vertex ai routes
Ishaan Jaff8051781af015
diff --git a/litellm/llms/fine_tuning_apis/vertex_ai.py b/litellm/llms/fine_tuning_apis/vertex_ai.pyindex 189ace11ada..cb238b04b74 100644--- a/litellm/llms/fine_tuning_apis/vertex_ai.py+++ b/litellm/llms/fine_tuning_apis/vertex_ai.py@@ -266,7 +266,7 @@ class VertexFineTuningAPI(VertexLLM):}url = None- if request_route == "tuningJobs":+ if request_route == "/tuningJobs":url = f"https://{vertex_location}-aiplatform.googleapis.com/v1/projects/{vertex_project}/locations/{vertex_location}/tuningJobs"if self.async_handler is None:diff --git a/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py b/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.pyindex be09a4932d1..659459cec39 100644--- a/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py+++ b/litellm/proxy/vertex_ai_endpoints/vertex_endpoints.py@@ -34,14 +34,13 @@ def set_default_vertex_config(config):if config is None:return- if not isinstance(config, list):- raise ValueError("invalid files config, expected a list is not a list")+ if not isinstance(config, dict):+ raise ValueError("invalid config, vertex default config must be a dictionary")- for element in config:- if isinstance(element, dict):- for key, value in element.items():- if isinstance(value, str) and value.startswith("os.environ/"):- element[key] = litellm.get_secret(value)+ if isinstance(config, dict):+ for key, value in config.items():+ if isinstance(value, str) and value.startswith("os.environ/"):+ config[key] = litellm.get_secret(value)default_vertex_config = config@@ -102,7 +101,6 @@ async def execute_post_vertex_ai_request(async def vertex_create_fine_tuning_job(request: Request,fastapi_response: Response,- endpoint_name: str,user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),):"""