# Mixed Multi-Vendor Model Stack: Opus Plans, Qwen / DeepSeek Execute

> AI gateway mixes multi-vendor models per agent role: planning on Claude Opus, routine execution on Qwen3.8-Max / DeepSeek V4.1 Flash, identity-scoped model mapping + cross-protocol translation, zero client change.

Canonical: https://www.gatellm.io/use-cases/mixed-model-stack/

Pin top models from different vendors per agent role — planning keeps Anthropic Opus, execution lands on Qwen3.8-Max / DeepSeek V4.1 Flash, with zero client change and automatic cross-protocol translation.

## What the community actually complains about
Running Claude Code on Claude Opus end-to-end is too expensive; a blanket drop to Sonnet visibly degrades planning and architectural judgment, and rework gets more costly. Developers want to mix top models from other vendors (Qwen, DeepSeek), but the client only speaks the Anthropic protocol and claude-* model names, and changing config means touching every dev machine.
Worse, the plan loop, the main execution loop, and batch subtasks have genuinely different needs for capability vs. price — a single model switch on the client cannot match that.

## How GateLLM does it
GateLLM rewrites the model name by identity after the ingress gate and before routing — zero client change. Planning and architectural judgment keep claude-opus-5 going straight to Anthropic; the main execution loop's claude-sonnet-* maps to DashScope's qwen3.8-max; batch subtasks (formatting, commit messages, retrieval summaries) map to deepseek-flash via an OpenAI-compatible upstream. Cross-protocol translation is handled by the gateway, with SSE streams and tool_call_id preserved on the round trip.
Rules attach to access keys or key groups and take effect per team; the egress gate verifies the target is in the identity's allowlist — configuring a mapping is not granting permission.

## 5 levers that actually land
- Identity-scoped model mapping: from → to on access keys / key groups, rewritten after ingress and before routing; supports a single * capturing a middle segment, hot-reloaded
- Cross-protocol translation: Claude Code on Anthropic, Codex / OpenAI SDK on OpenAI, the gateway translates to DashScope / OpenAI / Gemini / Bedrock upstreams; :keep-alive on long upstream inference, _gateway_warning on stream break
- Request-header conditional routing: the same from routes to different targets by X-Tenant etc. (exact / prefix / regex / exists / absent); conditional rules first, unconditional fallback, first-match-wins — usable for canary
- Plan-mode detection: Claude Code's plan mode injects Plan mode is active / Exited Plan Mode markers; a script comparing the last position switches routing — planning on Opus, execution on the cost-efficient model
- Permission & observability: the egress gate verifies the target is in the identity allowlist (mapping ≠ permission); the log model column shows an MM tag with the original → mapped name on hover; stats and billing attribute by the post-mapping real model name, so the mixed stack's cost is comparable at a glance

## FAQ
### Do I have to change the client config?
Only point ANTHROPIC_BASE_URL at the gateway and swap ANTHROPIC_API_KEY for a gateway access key; model-name rewriting happens on the gateway, so no per-machine config changes. Note that /v1/models does not reflect mapping source names — you won't see them in the dropdown, but the client can request that name directly; this is expected.

### How do I prove the mixed stack is actually cheaper?
Billing and stats record the post-mapping target model name, billable by model / key / tenant. First map a portion of requests over via a request-header condition, compare cost and rework rate over the same window, then widen the share — the egress gate keeps targets in the allowlist, so the canary is safe.

- [Full how-to: Configure identity-scoped model mapping (docs)](https://docs.gatellm.io/en/howto/configure-identity-model-mapping)

## Related use cases
- [How one client protocol reaches every vendor in the stack](https://www.gatellm.io/use-cases/one-protocol-any-model.md)

## Related
- [Home](https://www.gatellm.io/index.md)
- [Pricing](https://www.gatellm.io/pricing.md)
- [Cost Calculator](https://www.gatellm.io/calculator.md)
- [About](https://www.gatellm.io/about.md)
- [Book a Demo](https://www.gatellm.io/demo.md)
- [FAQ](https://www.gatellm.io/faq.md)
- [Compare AI Gateways](https://www.gatellm.io/compare.md)
- [Compare LiteLLM](https://www.gatellm.io/compare/litellm.md)
- [Compare OpenRouter](https://www.gatellm.io/compare/openrouter.md)
- [Compare Alibaba Cloud AI Gateway](https://www.gatellm.io/compare/alibaba-cloud.md)
- [Compare Azure API Management](https://www.gatellm.io/compare/azure-apim.md)
- [Compare Apigee](https://www.gatellm.io/compare/apigee.md)
- [Compare Cloudflare AI Gateway](https://www.gatellm.io/compare/cloudflare.md)
- [Compare Kong AI Gateway](https://www.gatellm.io/compare/kong.md)
- [Compare Portkey](https://www.gatellm.io/compare/portkey.md)
- [LiteLLM vs Kong AI Gateway](https://www.gatellm.io/compare/litellm-vs-kong.md)
- [LiteLLM vs OpenRouter](https://www.gatellm.io/compare/litellm-vs-openrouter.md)
- [LiteLLM vs Portkey](https://www.gatellm.io/compare/litellm-vs-portkey.md)
- [Use Cases](https://www.gatellm.io/use-cases.md)
- [Reduce LLM Cost](https://www.gatellm.io/use-cases/reduce-cost.md)
- [High Availability](https://www.gatellm.io/use-cases/high-availability.md)
- [Multi-Tenant Isolation](https://www.gatellm.io/use-cases/multi-tenant.md)
- [Compliance & Audit](https://www.gatellm.io/use-cases/compliance-audit.md)
- [Troubleshooting by Symptom](https://www.gatellm.io/use-cases/troubleshooting.md)
- [Self-Host AI Inside Office](https://www.gatellm.io/use-cases/self-hosted-office-ai.md)
- [Token Usage Visibility & Attribution](https://www.gatellm.io/use-cases/token-ops.md)
- [Token FinOps: AI Cost Allocation & Control](https://www.gatellm.io/use-cases/token-finops.md)
- [MCP Tool Governance](https://www.gatellm.io/use-cases/mcp-tool-governance.md)
- [Web Search for Every Model](https://www.gatellm.io/use-cases/web-search-grounding.md)
- [Multi-Key Rotation & Standby](https://www.gatellm.io/use-cases/multi-key-pooling.md)
- [Admission Control for Connected Clients](https://www.gatellm.io/use-cases/client-admission-control.md)
- [Enforce Which Model Agents Actually Run](https://www.gatellm.io/use-cases/enforce-model-policy.md)
- [No Model Choice on the Client](https://www.gatellm.io/use-cases/automatic-model-tiering.md)
- [One Protocol, Any Model](https://www.gatellm.io/use-cases/one-protocol-any-model.md)
- [Office / Microsoft 365 Add-in](https://www.gatellm.io/office-addin.md)
- [Glossary](https://www.gatellm.io/glossary.md)
- [Model Catalog](https://www.gatellm.io/models.md)
- [SDK & Framework Integrations](https://www.gatellm.io/integrations.md)
- [AI Coding Agents & Harnesses](https://www.gatellm.io/coding-agents.md)
- [Security & Compliance](https://www.gatellm.io/security.md)
- [Privacy Policy](https://www.gatellm.io/privacy-policy.md)
- [Terms of Service](https://www.gatellm.io/terms.md)
- [Cookie Policy](https://www.gatellm.io/cookies.md)
- [Data Processing Agreement (DPA)](https://www.gatellm.io/dpa.md)
- [Sub-processor List](https://www.gatellm.io/subprocessors.md)
- [Security Questionnaire (CAIQ/SIG/VSA)](https://www.gatellm.io/trust.md)
- [Incident Response & Support](https://www.gatellm.io/sla.md)
- [Vulnerability Disclosure Policy](https://www.gatellm.io/vulnerability-disclosure.md)
- [Open Source License Notice](https://www.gatellm.io/open-source-licenses.md)
- [Version Support & Lifecycle (EOL)](https://www.gatellm.io/lifecycle.md)
- [Engineering Blog](https://www.gatellm.io/blog.md)
- [Your Agents Have More Permissions Than Your Employees: Governing MCP Tools at the Gateway](https://www.gatellm.io/blog/mcp-tool-governance.md)
- [The $10k Invoice Problem: Five Ways to Cut LLM Spend Without Dumbing Down Your App](https://www.gatellm.io/blog/reduce-cost.md)
- [Your Vendor's List Price Is Not Your Cost: Applying Real FinOps to Token Spend](https://www.gatellm.io/blog/token-finops.md)
- [llms.txt](https://www.gatellm.io/llms.txt)
