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
docs(advisor): move supported providers to top, focus how it works on litellm native loop
Ishaan Jafferdd87f3be5bda
diff --git a/docs/my-website/docs/completion/anthropic_advisor_tool.md b/docs/my-website/docs/completion/anthropic_advisor_tool.mdindex bff0ba26879..23be7c776ee 100644--- a/docs/my-website/docs/completion/anthropic_advisor_tool.md+++ b/docs/my-website/docs/completion/anthropic_advisor_tool.md@@ -12,60 +12,50 @@ The advisor tool is in beta. Include `anthropic-beta: advisor-tool-2026-03-01` i:::-## How it works+## Supported Providers++| Provider | Chat Completions API | Messages API | Notes |+|----------|---------------------|--------------|-------|+| **Anthropic API** | ✅ | ✅ | Native — runs server-side |+| **OpenAI / Azure OpenAI** | ✅ | ✅ | LiteLLM orchestration loop |+| **Amazon Bedrock** | ✅ | ✅ | LiteLLM orchestration loop |+| **Google Vertex AI** | ✅ | ✅ | LiteLLM orchestration loop |+| **Groq / Mistral / others** | ✅ | ✅ | LiteLLM orchestration loop |-LiteLLM handles the advisor tool differently depending on the provider.+## How it works (LiteLLM native orchestration)-**Anthropic API (native):** the advisor tool definition is forwarded as-is to Anthropic. Anthropic runs the advisor sub-inference server-side, inside the same `/v1/messages` call. No extra round-trips.+For non-Anthropic providers, LiteLLM implements the advisor loop itself. The API you call is identical — LiteLLM handles everything transparently.-**All other providers (OpenAI, Bedrock, Vertex, Groq, Mistral, …):** LiteLLM implements the orchestration loop itself via `AdvisorOrchestrationHandler`. The advisor tool is translated into a regular function tool the provider understands. When the executor calls it, LiteLLM intercepts, makes a separate sub-call to the advisor model (always `claude-opus-4-6`), injects the advice, and re-calls the executor — all transparently inside your original request.+When a request arrives with an `advisor_20260301` tool and a non-Anthropic provider, `AdvisorOrchestrationHandler` intercepts it. It translates the advisor tool into a regular function tool the provider understands, then runs an orchestration loop:```mermaidflowchart TD- A["Client request — /messages or /chat/completions\ntools includes advisor_20260301"] --> B{"provider?"}-- B -->|anthropic| C["Forward to Anthropic API\nadvisor runs server-side natively\nno extra round-trips"]-- B -->|"openai / bedrock / vertex\ngroq / mistral / any other"| D["AdvisorOrchestrationHandler\nintercepts request"]-- D --> E["Translate advisor_20260301\ninto a regular function tool"]+ A["Your request\ntools: advisor_20260301\nmodel: e.g. openai/gpt-4.1-mini"] --> B["AdvisorOrchestrationHandler\ntranslates advisor → regular fn tool"]- E --> F["EXECUTOR CALL\ne.g. openai/gpt-4.1-mini\nreceives synthetic advisor fn tool"]+ B --> C["EXECUTOR CALL\nopenai / bedrock / vertex / etc."]- F --> G{"executor\nstop_reason?"}+ C --> D{"executor calls\nadvisor tool?"}- G -->|"tool_use name=advisor"| H{"iteration >\nmax_uses?"}+ D -->|"yes — tool_use\nname=advisor"| E{"max_uses\nexceeded?"}- H -->|no| I["ADVISOR SUB-CALL\nclaude-opus-4-6\nno tools — full transcript forwarded"]+ E -->|no| F["ADVISOR SUB-CALL\nclaude-opus-4-6\nfull transcript forwarded\nno tools"]- I --> J["Inject advisor advice\nas tool_result into message history"]+ F --> G["Inject advice as\ntool_result into history"]- J --> F+ G --> C- H -->|yes| K["Raise AdvisorMaxIterationsError\n(caller can catch and handle)"]+ E -->|yes| H["AdvisorMaxIterationsError"]- G -->|"end_turn / other\nno advisor call"| L["Return clean final response\nno advisor blocks exposed to caller"]-- C --> L+ D -->|"no — end_turn\nor other stop reason"| I["Clean final response\nno advisor blocks in output"]```-**Key properties of the non-native path:**--- Executor always called non-streaming; streaming is emulated via `FakeAnthropicMessagesStreamIterator` on the final response.-- The advisor sub-call uses no tools and receives the full conversation transcript.-- `advisor_tool_result` blocks are stripped from message history before each executor call — providers like OpenAI never see Anthropic-specific block types.-- `max_uses` is a hard cap: once exceeded, `AdvisorMaxIterationsError` is raised. Callers can catch this or set a high enough limit.-- `max_uses=0` disables the advisor entirely — the first call raises immediately.--## Supported Providers+**What LiteLLM does for you:**-| Provider | Chat Completions API | Messages API | Notes |-|----------|---------------------|--------------|-------|-| **Anthropic API** | ✅ | ✅ | Native — runs server-side |-| **OpenAI / Azure OpenAI** | ✅ | ✅ | LiteLLM orchestration loop |-| **Amazon Bedrock** | ✅ | ✅ | LiteLLM orchestration loop |-| **Google Vertex AI** | ✅ | ✅ | LiteLLM orchestration loop |-| **Groq / Mistral / others** | ✅ | ✅ | LiteLLM orchestration loop |+- Strips `advisor_20260301` from the outgoing request — the provider only sees a standard function tool named `advisor`+- When the executor calls it, intercepts before the result reaches you, runs the advisor sub-call, and injects the advice+- Strips any `advisor_tool_result` / `server_tool_use` blocks from message history on re-send so non-Anthropic providers never see Anthropic-specific types+- Wraps the final response in an SSE stream if you requested `stream=True`+- Enforces `max_uses` as a hard cap — `AdvisorMaxIterationsError` is raised if exceeded; `max_uses=0` disables the advisor entirely## Model Compatibility