forked from phoenix/litellm-mirror
enforce vertex streaming to use sse for streaming
This commit is contained in:
parent
088532082e
commit
8c68979274
2 changed files with 6 additions and 13 deletions
|
@ -4,15 +4,6 @@ model_list:
|
|||
model: openai/gpt-4o
|
||||
api_key: os.environ/OPENAI_API_KEY
|
||||
|
||||
|
||||
router_settings:
|
||||
provider_budget_config:
|
||||
openai:
|
||||
budget_limit: 0.000000000001 # float of $ value budget for time period
|
||||
time_period: 1d # can be 1d, 2d, 30d
|
||||
azure:
|
||||
budget_limit: 100
|
||||
time_period: 1d
|
||||
|
||||
litellm_settings:
|
||||
callbacks: ["prometheus"]
|
||||
default_vertex_config:
|
||||
vertex_project: "adroit-crow-413218"
|
||||
vertex_location: "us-central1"
|
||||
|
|
|
@ -194,14 +194,16 @@ async def vertex_proxy_route(
|
|||
verbose_proxy_logger.debug("updated url %s", updated_url)
|
||||
|
||||
## check for streaming
|
||||
target = str(updated_url)
|
||||
is_streaming_request = False
|
||||
if "stream" in str(updated_url):
|
||||
is_streaming_request = True
|
||||
target += "?alt=sse"
|
||||
|
||||
## CREATE PASS-THROUGH
|
||||
endpoint_func = create_pass_through_route(
|
||||
endpoint=endpoint,
|
||||
target=str(updated_url),
|
||||
target=target,
|
||||
custom_headers=headers,
|
||||
) # dynamically construct pass-through endpoint based on incoming path
|
||||
received_value = await endpoint_func(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue