Skip to main content

llm-zenmux

LLM plugin for ZenMux.ai — access every model available through ZenMux (OpenAI, Anthropic, Google, Moonshot, and more) from a single unified API key.

ZenMux exposes two API surfaces, both supported by this plugin:

  • OpenAI Chat Completions (zenmux/openai/…, zenmux/google/…, zenmux/moonshotai/…, …)
  • Anthropic Messages (zenmux/anthropic/claude-…)

The plugin auto-discovers the live model list from https://zenmux.ai/api/v1/models (cached for one hour) and registers every model under the zenmux/ namespace.

Installation

pip install llm-zenmux

Or with uv:

uv pip install llm-zenmux

API key setup

llm keys set zenmux

Paste your ZenMux API key when prompted. The key is stored in llm's encrypted key store and sent as the Authorization: Bearer … header (OpenAI surface) or x-api-key header (Anthropic surface).

Usage

List available models:

llm zenmux models

Prompt any model — the -m flag takes the full zenmux/<provider>/<model> ID:

llm -m zenmux/openai/gpt-4o "What is ZenMux?"
llm -m zenmux/anthropic/claude-sonnet-4 "Explain prompt caching"
llm -m zenmux/google/gemini-2.5-flash "Summarize this file" -f README.md

Options

OpenAI Chat Completions models inherit llm's built-in OpenAI options (temperature, top_p, max_tokens, json_object, etc.) and add:

Option Description
-o reasoning_effort none|minimal|low|medium|high|xhigh Constrain reasoning effort
-o verbosity low|medium|high Control response verbosity
-o logprobs true Return log probabilities
-o top_logprobs N Top N tokens per position (0–20)
-o stop '["END1","END2"]' Up to 4 stop sequences
-o parallel_tool_calls true Enable parallel tool calls
-o metadata '{"tenant":"acme"}' Business metadata (JSON object)
-o web_search_options '{"search_context_size":"low"}' Web search tool config
-o provider '{"routing":{"type":"priority"}}' ZenMux provider routing config
-o model_routing_config '{"available_models":["openai/gpt-4o"]}' Model routing within a provider
-o reasoning '{"enabled":true,"effort":"high"}' Fine-grained reasoning config
-o json_object true JSON mode
--schema '{"type":"object",...}' Structured output via JSON schema

Anthropic Messages models support:

Option Description
-o max_tokens 8192 Max output tokens (default 8192)
-o temperature 0.0-1.0 Sampling temperature
-o top_p 0.0-1.0 Nucleus sampling
-o top_k 40 Top-K sampling
-o stop_sequences '["END"]' Stop sequences
-o thinking true -o thinking_budget 2000 Enable extended thinking
-o thinking false Explicitly disable thinking

Examples

JSON mode:

llm -m zenmux/openai/gpt-4o-mini -o json_object true "Return a JSON list of planets"

Structured output:

llm -m zenmux/openai/gpt-4o \
  --schema '{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}}}' \
  "Dr Who is 900 years old"

Extended thinking (Claude):

llm -m zenmux/anthropic/claude-sonnet-4 \
  -o thinking true -o thinking_budget 4000 -o max_tokens 8000 \
  "Prove there are infinitely many primes"

Reasoning effort (OpenAI o-series):

llm -m zenmux/openai/o3 -o reasoning_effort high "Design a B-tree index"

Streaming reasoning capture: When a model returns chain-of-thought, the plugin surfaces it as llm reasoning events — visible with llm -m zenmux/openai/o3 -t reasoning "…".

Image input:

llm -m zenmux/openai/gpt-4o -a photo.jpg "What's in this picture?"

Provider routing:

llm -m zenmux/openai/gpt-4o \
  -o provider '{"routing":{"type":"priority","providers":["openai","azure"]},"fallback":true}' \
  "Hello"

Features

  • Unified access to all ZenMux-hosted models via OpenAI Chat Completions or Anthropic Messages APIs
  • Automatic model discovery — live model list fetched and cached hourly; fallback list included if ZenMux is unreachable
  • OpenAI surface extras: reasoning_effort, verbosity, logprobs/top_logprobs, stop, parallel_tool_calls, metadata, web_search_options, ZenMux provider routing, model_routing_config, reasoning
  • Anthropic surface extras: extended thinking with configurable thinking_budget, top_k, stop_sequences, automatic prompt caching (5-minute ephemeral cache_control on system prompt and last user message)
  • Extended thinking / chain-of-thought capture surfaced as llm reasoning stream events and persisted to response.response_json
  • Attachment support derived from ZenMux input_modalities — vision models get image types, file-capable models get PDF, audio models get wav/mpeg; unknown modalities (e.g. video) are ignored
  • Tool calling (function calling) support on both API surfaces
  • Structured output — JSON mode and --schema-based structured output
  • Async support — all model classes have AsyncChat / AsyncKeyModel counterparts
  • llm zenmux models CLI command to list or refresh the cached model directory

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_zenmux-0.1.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_zenmux-0.1.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_zenmux-0.1.0.tar.gz.

File metadata

  • Download URL: llm_zenmux-0.1.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for llm_zenmux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6e2d39a624429d5549da0c010ccb152bda0a6aeb2d516edb281e57ca94696591
MD5 69082a0bb9c8550f7dd2c43b929aab22
BLAKE2b-256 1537a8b76fea8ec72c713eb18356d0b066ac952053e71ac427cff58c8fec5a54

See more details on using hashes here.

File details

Details for the file llm_zenmux-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llm_zenmux-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for llm_zenmux-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d38daa90cbc31d92df7f8943346328c73604c3879e8b7d3d082684ea3aa3fd71
MD5 6d6720dbe55333ac8d8e7f9651ff677f
BLAKE2b-256 20ac9c1e4318571a3b663dcbe622e7d0b5bd7737e64436cecf0236e0b994c5ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page