mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
feat(llm_passthrough_endpoints.py): base case passing for refactored vertex passthrough route
This commit is contained in:
parent
94d3413335
commit
b44b3bd36b
7 changed files with 115 additions and 111 deletions
|
@ -4495,11 +4495,11 @@ class Router:
|
|||
Each provider uses diff .env vars for pass-through endpoints, this helper uses the deployment credentials to set the .env vars for pass-through endpoints
|
||||
"""
|
||||
if deployment.litellm_params.use_in_pass_through is True:
|
||||
if custom_llm_provider == "vertex_ai":
|
||||
from litellm.proxy.vertex_ai_endpoints.vertex_endpoints import (
|
||||
vertex_pass_through_router,
|
||||
)
|
||||
from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (
|
||||
passthrough_endpoint_router,
|
||||
)
|
||||
|
||||
if custom_llm_provider == "vertex_ai":
|
||||
if (
|
||||
deployment.litellm_params.vertex_project is None
|
||||
or deployment.litellm_params.vertex_location is None
|
||||
|
@ -4508,16 +4508,12 @@ class Router:
|
|||
raise ValueError(
|
||||
"vertex_project, vertex_location, and vertex_credentials must be set in litellm_params for pass-through endpoints"
|
||||
)
|
||||
vertex_pass_through_router.add_vertex_credentials(
|
||||
passthrough_endpoint_router.add_vertex_credentials(
|
||||
project_id=deployment.litellm_params.vertex_project,
|
||||
location=deployment.litellm_params.vertex_location,
|
||||
vertex_credentials=deployment.litellm_params.vertex_credentials,
|
||||
)
|
||||
else:
|
||||
from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (
|
||||
passthrough_endpoint_router,
|
||||
)
|
||||
|
||||
passthrough_endpoint_router.set_pass_through_credentials(
|
||||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=deployment.litellm_params.api_base,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue