-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
[Infra] Reduce llm_translation_testing parallelism and tolerate worker restarts #25897
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
Closed
yuneng-berri
wants to merge
4
commits into
litellm_internal_staging
from
litellm_llmTranslationOomMitigation
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6fab790
Merge pull request #25867 from BerriAI/litellm_day_0_opus_4.7_support
ishaan-berri fe6fef9
Fix version in docs
Sameerlite c0fc4c4
Merge pull request #25876 from BerriAI/litellm_hotfix_opus_4.7
ishaan-berri 86c5b55
[Infra] CI: reduce llm_translation_testing parallelism and tolerate w…
yuneng-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,366 @@ | ||
| --- | ||
| slug: claude_opus_4_7 | ||
| title: "Day 0 Support: Claude Opus 4.7" | ||
| date: 2026-04-16T10:00:00 | ||
| authors: | ||
| - sameer | ||
| - ishaan-alt | ||
| - krrish | ||
| description: "Day 0 support for Claude Opus 4.7 on LiteLLM AI Gateway - use across Anthropic, Azure, Vertex AI, and Bedrock." | ||
| tags: [anthropic, claude, opus 4.7] | ||
| hide_table_of_contents: false | ||
| --- | ||
|
|
||
| import Tabs from '@theme/Tabs'; | ||
| import TabItem from '@theme/TabItem'; | ||
|
|
||
| LiteLLM now supports [Claude Opus 4.7](https://www.anthropic.com/news/claude-opus-4-7) on Day 0. Use it across Anthropic, Azure, Vertex AI, and Bedrock through the LiteLLM AI Gateway. | ||
|
|
||
| {/* truncate */} | ||
|
|
||
| ## Docker Image | ||
|
|
||
| ```bash | ||
| docker pull ghcr.io/berriai/litellm:litellm_stable_release_branch-v1.83.3-stable.opus-4.7 | ||
| ``` | ||
|
|
||
| ## Usage - Anthropic | ||
|
|
||
| <Tabs> | ||
| <TabItem value="proxy" label="LiteLLM Proxy"> | ||
|
|
||
| **1. Setup config.yaml** | ||
|
|
||
| ```yaml | ||
| model_list: | ||
| - model_name: claude-opus-4-7 | ||
| litellm_params: | ||
| model: anthropic/claude-opus-4-7 | ||
| api_key: os.environ/ANTHROPIC_API_KEY | ||
| ``` | ||
|
|
||
| **2. Start the proxy** | ||
|
|
||
| ```bash | ||
| docker run -d \ | ||
| -p 4000:4000 \ | ||
| -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \ | ||
| -v $(pwd)/config.yaml:/app/config.yaml \ | ||
| ghcr.io/berriai/litellm:litellm_stable_release_branch-v1.83.3-stable.opus-4.7 \ | ||
| --config /app/config.yaml | ||
| ``` | ||
|
|
||
| **3. Test it!** | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/chat/completions' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'Authorization: Bearer $LITELLM_KEY' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "what llm are you" | ||
| } | ||
| ] | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ## Usage - Azure | ||
|
|
||
| <Tabs> | ||
| <TabItem value="proxy" label="LiteLLM Proxy"> | ||
|
|
||
| **1. Setup config.yaml** | ||
|
|
||
| ```yaml | ||
| model_list: | ||
| - model_name: claude-opus-4-7 | ||
| litellm_params: | ||
| model: azure_ai/claude-opus-4-7 | ||
| api_key: os.environ/AZURE_AI_API_KEY | ||
| api_base: os.environ/AZURE_AI_API_BASE # https://<resource>.services.ai.azure.com | ||
| ``` | ||
|
|
||
| **2. Start the proxy** | ||
|
|
||
| ```bash | ||
| docker run -d \ | ||
| -p 4000:4000 \ | ||
| -e AZURE_AI_API_KEY=$AZURE_AI_API_KEY \ | ||
| -e AZURE_AI_API_BASE=$AZURE_AI_API_BASE \ | ||
| -v $(pwd)/config.yaml:/app/config.yaml \ | ||
| ghcr.io/berriai/litellm:litellm_stable_release_branch-v1.83.3-stable.opus-4.7 \ | ||
| --config /app/config.yaml | ||
| ``` | ||
|
|
||
| **3. Test it!** | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/chat/completions' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'Authorization: Bearer $LITELLM_KEY' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "what llm are you" | ||
| } | ||
| ] | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ## Usage - Vertex AI | ||
|
|
||
| <Tabs> | ||
| <TabItem value="proxy" label="LiteLLM Proxy"> | ||
|
|
||
| **1. Setup config.yaml** | ||
|
|
||
| ```yaml | ||
| model_list: | ||
| - model_name: claude-opus-4-7 | ||
| litellm_params: | ||
| model: vertex_ai/claude-opus-4-7 | ||
| vertex_project: os.environ/VERTEX_PROJECT | ||
| vertex_location: us-east5 | ||
| ``` | ||
|
|
||
| **2. Start the proxy** | ||
|
|
||
| ```bash | ||
| docker run -d \ | ||
| -p 4000:4000 \ | ||
| -e VERTEX_PROJECT=$VERTEX_PROJECT \ | ||
| -e GOOGLE_APPLICATION_CREDENTIALS=/app/credentials.json \ | ||
| -v $(pwd)/config.yaml:/app/config.yaml \ | ||
| -v $(pwd)/credentials.json:/app/credentials.json \ | ||
| ghcr.io/berriai/litellm:litellm_stable_release_branch-v1.83.3-stable.opus-4.7 \ | ||
| --config /app/config.yaml | ||
| ``` | ||
|
|
||
| **3. Test it!** | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/chat/completions' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'Authorization: Bearer $LITELLM_KEY' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "what llm are you" | ||
| } | ||
| ] | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ## Usage - Bedrock | ||
|
|
||
| <Tabs> | ||
| <TabItem value="proxy" label="LiteLLM Proxy"> | ||
|
|
||
| **1. Setup config.yaml** | ||
|
|
||
| ```yaml | ||
| model_list: | ||
| - model_name: claude-opus-4-7 | ||
| litellm_params: | ||
| model: bedrock/anthropic.claude-opus-4-7 | ||
| aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID | ||
| aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY | ||
| aws_region_name: us-east-1 | ||
| ``` | ||
|
|
||
| **2. Start the proxy** | ||
|
|
||
| ```bash | ||
| docker run -d \ | ||
| -p 4000:4000 \ | ||
| -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ | ||
| -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \ | ||
| -v $(pwd)/config.yaml:/app/config.yaml \ | ||
| ghcr.io/berriai/litellm:litellm_stable_release_branch-v1.83.3-stable.opus-4.7 \ | ||
| --config /app/config.yaml | ||
| ``` | ||
|
|
||
| **3. Test it!** | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/chat/completions' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'Authorization: Bearer $LITELLM_KEY' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "what llm are you" | ||
| } | ||
| ] | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ## Advanced Features | ||
|
|
||
| ### Adaptive Thinking | ||
|
|
||
| :::note | ||
| When using `reasoning_effort` with Claude Opus 4.7, all values (`low`, `medium`, `high`, `xhigh`) are mapped to `thinking: {type: "adaptive"}`. To use explicit thinking budgets with `type: "enabled"`, pass the native `thinking` parameter directly. | ||
| ::: | ||
|
|
||
| <Tabs> | ||
| <TabItem value="completions" label="/chat/completions"> | ||
|
|
||
| LiteLLM supports adaptive thinking through the `reasoning_effort` parameter: | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/chat/completions' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'Authorization: Bearer $LITELLM_KEY' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "Solve this complex problem: What is the optimal strategy for..." | ||
| } | ||
| ], | ||
| "reasoning_effort": "high" | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| <TabItem value="messages" label="/v1/messages"> | ||
|
|
||
| Use the `thinking` parameter with `type: "adaptive"` to enable adaptive thinking mode: | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/v1/messages' \ | ||
| --header 'x-api-key: sk-12345' \ | ||
| --header 'content-type: application/json' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "max_tokens": 16000, | ||
| "thinking": { | ||
| "type": "adaptive" | ||
| }, | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "Explain why the sum of two even numbers is always even." | ||
| } | ||
| ] | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| ### Effort Levels | ||
|
|
||
| Claude Opus 4.7 supports four effort levels: `low`, `medium`, `high` (default), and `xhigh`. These give you finer-grained control over how much reasoning the model applies to a task. Pass the effort level via the `output_config` parameter. | ||
|
|
||
| `xhigh` is a new effort level introduced with Opus 4.7 that sits above `high`. The `max` effort level is Claude Opus 4.6 only and is not available on 4.7. | ||
|
|
||
| <Tabs> | ||
| <TabItem value="completions" label="/chat/completions"> | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/chat/completions' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'Authorization: Bearer $LITELLM_KEY' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "Explain quantum computing" | ||
| } | ||
| ], | ||
| "output_config": { | ||
| "effort": "xhigh" | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| **Using OpenAI SDK:** | ||
|
|
||
| ```python | ||
| import openai | ||
|
|
||
| client = openai.OpenAI( | ||
| api_key="your-litellm-key", | ||
| base_url="http://0.0.0.0:4000" | ||
| ) | ||
|
|
||
| response = client.chat.completions.create( | ||
| model="claude-opus-4-7", | ||
| messages=[{"role": "user", "content": "Explain quantum computing"}], | ||
| extra_body={"output_config": {"effort": "xhigh"}} | ||
| ) | ||
| ``` | ||
|
|
||
| **Using LiteLLM SDK:** | ||
|
|
||
| ```python | ||
| from litellm import completion | ||
|
|
||
| response = completion( | ||
| model="anthropic/claude-opus-4-7", | ||
| messages=[{"role": "user", "content": "Explain quantum computing"}], | ||
| output_config={"effort": "xhigh"}, | ||
| ) | ||
| ``` | ||
|
|
||
| You can combine `reasoning_effort` with `output_config` for even more fine-grained control over the model's behavior. | ||
|
|
||
| </TabItem> | ||
| <TabItem value="messages" label="/v1/messages"> | ||
|
|
||
| ```bash | ||
| curl --location 'http://0.0.0.0:4000/v1/messages' \ | ||
| --header 'x-api-key: sk-12345' \ | ||
| --header 'content-type: application/json' \ | ||
| --data '{ | ||
| "model": "claude-opus-4-7", | ||
| "max_tokens": 4096, | ||
| "messages": [ | ||
| { | ||
| "role": "user", | ||
| "content": "Explain quantum computing" | ||
| } | ||
| ], | ||
| "output_config": { | ||
| "effort": "xhigh" | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
| **Effort level guide:** | ||
|
|
||
| | Effort | When to use | | ||
| |--------|-------------| | ||
| | `low` | Short, fast responses — simple lookups, formatting, classification | | ||
| | `medium` | Balanced tradeoff for everyday Q&A and light reasoning | | ||
| | `high` (default) | Complex reasoning, code generation, analysis | | ||
| | `xhigh` | Hardest problems — multi-step math, deep research, agentic planning | | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no_output_timeoutmay be tight with half the workersHalving workers from 8 → 4 will increase wall-clock run time for CPU/memory-bound tests. The current
no_output_timeout: 15mis the time without any output; as long as pytest prints progress it won't fire. If any test generates no output for a full 15 minutes (e.g. a hung network call that slips past the 120 s--timeout), the job could be killed. Worth monitoring the first few runs to confirm the suite still comfortably finishes within the overall job limit.