mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
Adds a 'passthrough' feature row to the Claude Code compat matrix that
drives the real claude CLI in each cloud's native mode against
LiteLLM's passthrough routes (the LLM-gateway setup from
code.claude.com/docs/en/gateway) instead of the /v1/messages
translation layer:
- anthropic: ANTHROPIC_BASE_URL={proxy}/anthropic, forwarded verbatim
to api.anthropic.com
- bedrock_invoke: CLAUDE_CODE_USE_BEDROCK=1 against {proxy}/bedrock;
the router resolves the alias in /model/{alias}/invoke-with-response-stream
- vertex_ai: CLAUDE_CODE_USE_VERTEX=1 against {proxy}/vertex_ai/v1;
alias, project, location and credentials resolve from the deployment,
which now sets use_in_pass_through: true (and the canonical
vertex_project/vertex_location param names) in test_config.yaml
- azure: CLAUDE_CODE_USE_FOUNDRY=1 against {proxy}/azure via the
AZURE_API_BASE/AZURE_API_KEY fallback (documented in the cron env
example)
- bedrock_converse: not_applicable; Claude Code has no Converse-wire
client
The shared cell body lives in _passthrough.py with injectable runner
and env (no monkeypatching), unit-covered in
_driver_unit_tests/test_passthrough.py including pins on the per-mode
CLI env contracts captured from a real claude CLI (2.1.210) run
against a request-logging sink.
34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
"""passthrough x Bedrock (Converse).
|
|
|
|
Structurally not applicable. In bedrock mode the `claude` CLI speaks
|
|
only the InvokeModel wire (`/model/{id}/invoke-with-response-stream`);
|
|
it has no Converse-wire client, so there is no Claude Code traffic a
|
|
Converse passthrough could serve. LiteLLM's `/bedrock` route does
|
|
accept `/model/{id}/converse-stream`, but exercising it would test a
|
|
wire no Claude Code user can produce, which is out of scope for this
|
|
matrix.
|
|
|
|
The (feature, provider) for this cell is inferred from the file path by
|
|
`tests/e2e/claude_code/conftest.py`:
|
|
|
|
tests/e2e/claude_code/passthrough/test_bedrock_converse.py
|
|
^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
|
|
feature_id provider
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def test_passthrough_bedrock_converse(compat_result):
|
|
"""Report not_applicable: Claude Code has no Converse-wire mode."""
|
|
compat_result.set(
|
|
{
|
|
"status": "not_applicable",
|
|
"reason": (
|
|
"Claude Code's bedrock mode speaks only the InvokeModel wire "
|
|
"(/model/{id}/invoke-with-response-stream); it has no "
|
|
"Converse-wire client, so there is no Claude Code surface "
|
|
"for Converse passthrough."
|
|
),
|
|
}
|
|
)
|