Skip to content

pass Anthropic requests natively to SGLang and LMDeploy - #242

Merged
thushan merged 14 commits into
mainfrom
feature/sglang-lmdeploy-anthropic-native
Oct 27, 2026
Merged

thushan merged 14 commits into
mainfrom
feature/sglang-lmdeploy-anthropic-native

Conversation

@thushan

@thushan thushan commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Depends on #240. Merge that first.

Summary

SGLang (0.5.9+) and LMDeploy (0.13.0+) serve the Anthropic Messages API themselves, but their profiles had no anthropic_support, so /olla/anthropic/v1/messages always translated through /v1/chat/completions.

sglang.yaml and lmdeploy.yaml now carry anthropic_support, so requests pass through with X-Olla-Mode: passthrough. LMDeploy 0.13.0 to 0.17.x reject Anthropic tools, so its profile declares no_tool_use and requests carrying tools (or a bare tool_choice) are still translated. The handler_translation.go change treats a bare tool_choice as tool use.

Behaviour change

Native passthrough is now on by default for SGLang 0.5.9+ and LMDeploy 0.13.0+. Older versions answer 404 on /v1/messages, and min_version is informational, so Olla does not enforce it. To switch back to translation, copy the profile to config/profiles/zz-sglang.yaml or zz-lmdeploy.yaml and set api.anthropic_support.enabled: false in the copy, or set translators.anthropic.passthrough_enabled: false to translate for every backend. Steps, including the Docker single-file mount, are in docs/content/integrations/backend/sglang.md and docs/content/integrations/backend/lmdeploy.md under "Switching SGLang or LMDeploy back to translation".

Type of change

  • New feature
  • Behaviour change
  • Documentation

How was this tested?

New tests:

  • TestShippedProfiles_NativeAnthropicDefaults
  • TestShippedProfiles_NativeAnthropicLocalOverrideDisables
  • TestTranslationHandler_NativeAnthropic_SGLangAndLMDeployPassThrough
  • TestTranslationHandler_NativeAnthropic_ToolRequests
  • TestTranslationHandler_NativeAnthropic_LMDeployToolChoiceWithoutTools

Tested together with the other October follow-up branches on a local integration branch at 0c25e0a:

  • make ready and make test-race pass at 0c25e0a
  • /olla-validate --quick: 42 pass, 0 fail (warnings and skips are nightly-only items)
  • tei-routing validation area: Section A 12/12, Section B B1 to B6 pass
  • /test-sticky-sessions: no new failures (the 7 provider-route 404s are the known shared-mock-URL limitation)
  • /claude-code-e2e against real Ollama: Tier A 16/0 on both the passthrough and translation legs, same as main
  • curl checks per feature against real Ollama and ollamock; log scan shows no panics, races or per-request WARN floods

Checklist

  • make ready passes at 72479f4
  • Tests added or updated for the change
  • Documentation updated: SGLang and LMDeploy backend pages, api-translation.md, profile-system.md, anthropic.md, readme.md, v0.0.30 release note
  • No new dependencies added

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between e8ef6af and 72479f4.

Files selected for processing: 29
  • CLAUDE.md
  • config/profiles/dmr.yaml
  • config/profiles/lemonade.yaml
  • config/profiles/litellm.yaml
  • config/profiles/llamacpp.yaml
  • config/profiles/lmdeploy.yaml
  • config/profiles/lmstudio.yaml
  • config/profiles/ollama.yaml
  • config/profiles/openai-compatible.yaml
  • config/profiles/sglang.yaml
  • config/profiles/vllm-mlx.yaml
  • config/profiles/vllm.yaml
  • docs/content/about/release-notes.md
  • docs/content/api-reference/anthropic.md
  • docs/content/api-reference/overview.md
  • docs/content/concepts/api-translation.md
  • docs/content/concepts/profile-system.md
  • docs/content/configuration/examples.md
  • docs/content/integrations/api-translation/anthropic.md
  • docs/content/integrations/backend/lmdeploy.md
  • docs/content/integrations/backend/sglang.md
  • docs/content/integrations/overview.md
  • internal/adapter/inspector/path_inspector_test.go
  • internal/adapter/registry/profile/loader.go
  • internal/adapter/registry/profile/native_anthropic_override_test.go
  • internal/app/handlers/handler_proxy_profile_paths_test.go
  • internal/app/handlers/handler_translation.go
  • internal/app/handlers/handler_translation_native_anthropic_test.go
  • readme.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thushan
thushan merged commit e0a2191 into main Oct 27, 2026
6 checks passed
@thushan
thushan deleted the feature/sglang-lmdeploy-anthropic-native branch October 27, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant