Skip to content

feat(zenmux): route models through protocol-specific SDKs#1254

Merged
rekram1-node merged 2 commits intoanomalyco:devfrom
llc1123:dev
Mar 30, 2026
Merged

feat(zenmux): route models through protocol-specific SDKs#1254
rekram1-node merged 2 commits intoanomalyco:devfrom
llc1123:dev

Conversation

@llc1123
Copy link
Copy Markdown
Contributor

@llc1123 llc1123 commented Mar 23, 2026

Summary

  • switch ZenMux's default SDK route from the Anthropic path to the OpenAI-compatible path
  • add per-model provider overrides for Anthropic, MiniMax, and OpenAI model families where a protocol-specific SDK works better
  • clean up ZenMux model metadata by correcting limits/capabilities and removing deprecated or unnecessary entries

Why

  • The biggest change in this PR is switching ZenMux's default routing to the OpenAI-compatible path. This affects every ZenMux model that does not define its own [provider] override.
  • In practice, the Anthropic Messages path tends to give worse cache behavior for many non-Anthropic models. We observed this clearly on GLM-5, and that behavior was one of the main reasons for moving the default route back to OpenAI-compatible.
  • The other reason is protocol compatibility. Some reasoning models, especially Kimi/GLM-style models, need interleaved reasoning_content to be preserved across turns. Interleaved reasoning_content lost for non-Claude models on Anthropic SDK opencode#14638 documents the concrete failure mode for Kimi K2.5 on the Anthropic SDK path: prior assistant reasoning_content is dropped on replay because @ai-sdk/anthropic only serializes Anthropic thinking blocks. Using the OpenAI-compatible path for these models avoids that incompatibility.
  • Anthropic and MiniMax models are explicitly routed through @ai-sdk/anthropic, while OpenAI models are explicitly routed through @ai-sdk/openai, so each family uses the SDK/API path that best matches its protocol and feature set.
  • This PR also fixes incorrect model metadata (for example Kimi K2.5 and Claude Opus 4), removes Claude 3.5 Sonnet because ZenMux has already taken it offline, and removes Gemini 3 Pro Image Preview because opencode does not need image generation support here.

Validation

  • I manually tested all updated model configurations and confirmed they work correctly.

Copilot AI review requested due to automatic review settings March 23, 2026 15:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ZenMux provider and model metadata so models are routed through protocol-appropriate SDKs/endpoints (notably Anthropic + MiniMax), while aligning capabilities/limits with observed runtime behavior.

Changes:

  • Switch ZenMux’s default SDK configuration to OpenAI-compatible (@ai-sdk/openai-compatible) using https://zenmux.ai/api/v1.
  • Add per-model [provider] overrides to route OpenAI models via @ai-sdk/openai and Anthropic/MiniMax models via @ai-sdk/anthropic (with the /api/anthropic/v1 endpoint).
  • Adjust/clean up model metadata (e.g., add interleaving where needed, tweak a capability flag, remove deprecated/unsupported model entries, update limits).

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.

Show a summary per file
File Description
providers/zenmux/provider.toml Changes ZenMux default SDK + base API to OpenAI-compatible /api/v1.
providers/zenmux/models/z-ai/glm-4.7.toml Adds interleaving config for reasoning output (reasoning_content).
providers/zenmux/models/z-ai/glm-4.7-flash-free.toml Adds interleaving config for reasoning output (reasoning_content).
providers/zenmux/models/openai/gpt-5.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.4.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.4-pro.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.4-nano.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.4-mini.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.3-codex.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.3-chat.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.2.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.2-pro.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.2-codex.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.1.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.1-codex.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.1-codex-mini.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5.1-chat.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/openai/gpt-5-codex.toml Adds per-model provider override to use @ai-sdk/openai with ZenMux /api/v1.
providers/zenmux/models/moonshotai/kimi-k2.5.toml Updates capability flag (temperature = false) to match runtime behavior.
providers/zenmux/models/minimax/minimax-m2.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/minimax/minimax-m2.7.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/minimax/minimax-m2.7-highspeed.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/minimax/minimax-m2.5.toml Removes interleaving and adds provider override to @ai-sdk/anthropic on /api/anthropic/v1.
providers/zenmux/models/minimax/minimax-m2.5-lightning.toml Removes interleaving and adds provider override to @ai-sdk/anthropic on /api/anthropic/v1.
providers/zenmux/models/minimax/minimax-m2.1.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/google/gemini-3-pro-image-preview.toml Removes unsupported/deprecated model entry from ZenMux catalog.
providers/zenmux/models/anthropic/claude-sonnet-4.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-sonnet-4.6.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-sonnet-4.5.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-opus-4.toml Updates output limit and adds provider override to @ai-sdk/anthropic on /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-opus-4.6.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-opus-4.5.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-opus-4.1.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-haiku-4.5.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-3.7-sonnet.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.
providers/zenmux/models/anthropic/claude-3.5-sonnet.toml Removes deprecated model entry from ZenMux catalog.
providers/zenmux/models/anthropic/claude-3.5-haiku.toml Adds per-model provider override to use @ai-sdk/anthropic with ZenMux /api/anthropic/v1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rekram1-node
Copy link
Copy Markdown
Contributor

Can u provide a bit more info for this change, evidence it works, etc

Kinda a big pr and idk this provider

@llc1123
Copy link
Copy Markdown
Contributor Author

llc1123 commented Mar 24, 2026

@rekram1-node Added more detail to the PR description, but the short version is:

  • The biggest change here is switching ZenMux's default SDK route back to the OpenAI-compatible path. That affects every ZenMux model without its own [provider] override.
  • The reason is mostly a mix of cache behavior and protocol compatibility. In practice, the Anthropic Messages path has been worse for many non-Anthropic models, and I observed the difference especially clearly on GLM-5.
  • There is also a concrete compatibility issue for reasoning models like Kimi/GLM-style models: anomalyco/opencode#14638 documents that Kimi K2.5 breaks on the Anthropic SDK path because prior assistant reasoning_content gets dropped on replay.
  • Anthropic and MiniMax are explicitly routed through @ai-sdk/anthropic, and OpenAI models are explicitly routed through @ai-sdk/openai, so each family uses the SDK/API path that matches its protocol better.
  • The rest of the PR is metadata cleanup: fixing incorrect limits/capabilities, removing Claude 3.5 Sonnet because ZenMux already took it offline, and removing Gemini 3 Pro Image Preview because opencode does not need image generation support here.

For validation: I manually tested all updated model configs and confirmed they work correctly.

@llc1123
Copy link
Copy Markdown
Contributor Author

llc1123 commented Mar 28, 2026

Is there anything blocking this PR? Hope this one can be merged asap.

@rekram1-node rekram1-node merged commit 798538f into anomalyco:dev Mar 30, 2026
4 of 5 checks passed
LYY added a commit to LYY/models.dev that referenced this pull request Mar 31, 2026
…MiniMax M2.1/M2.5

- Add [provider] npm = "@ai-sdk/anthropic" to match -free variants
- Remove incorrect [interleaved] section per PR anomalyco#1254 design decision

MiniMax models should route through @ai-sdk/anthropic with per-model
provider overrides, not rely on [interleaved] for reasoning content handling.
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.

3 participants