Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(pyproject.toml): bump uvicorn depedency requirement + Azure o1 model check fix + Vertex Anthropic headers fix #7773

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions litellm/llms/anthropic/chat/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,17 @@ def _map_stop_sequences(
) -> Optional[List[str]]:
new_stop: Optional[List[str]] = None
if isinstance(stop, str):
if stop.isspace() and litellm.drop_params is True: # anthropic doesn't allow whitespace characters as stop-sequences
if (
stop.isspace() and litellm.drop_params is True
): # anthropic doesn't allow whitespace characters as stop-sequences
return new_stop
new_stop = [stop]
elif isinstance(stop, list):
new_v = []
for v in stop:
if v.isspace() and litellm.drop_params is True: # anthropic doesn't allow whitespace characters as stop-sequences
if (
v.isspace() and litellm.drop_params is True
): # anthropic doesn't allow whitespace characters as stop-sequences
continue
new_v.append(v)
if len(new_v) > 0:
Expand Down Expand Up @@ -755,7 +759,7 @@ def validate_environment(
prompt_caching_set=prompt_caching_set,
pdf_used=pdf_used,
api_key=api_key,
is_vertex_request=False,
is_vertex_request=optional_params.get("is_vertex_request", False),
)

headers = {**headers, **anthropic_headers}
Expand Down
6 changes: 1 addition & 5 deletions litellm/llms/azure/chat/o1_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ def should_fake_stream(
return True

def is_o1_model(self, model: str) -> bool:
o1_models = ["o1-mini", "o1-preview"]
for m in o1_models:
if m in model:
return True
return False
return "o1" in model
9 changes: 4 additions & 5 deletions litellm/proxy/_new_secret_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
model_list:
- model_name: "gpt-4o"
- model_name: anthropic-vertex
litellm_params:
model: "azure/gpt-4o"
api_key: os.environ/AZURE_API_KEY
api_base: os.environ/AZURE_API_BASE

model: vertex_ai/claude-3-5-sonnet@20240620
vertex_ai_project: "pathrise-convert-1606954137718"
vertex_ai_location: "europe-west1"
Loading
Loading