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.1.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.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_zenmux-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0c73e61a37916b61f4416b9657882aef78f54cc707b48982a2d5ffef661f60f0
MD5 f9ee08fb2a4f500fa8a0655238f5ebde
BLAKE2b-256 2d13d02d052aa0a914914f2d293a27a5168136acc9e5dea33ce609b5a014e2d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llm_zenmux-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2029f8c7e3a4fbf5758e4ec117204d3d1ac32a4dce983a9fe092c889ee1b24de
MD5 36a5aa7f49f8e90910f1a2428e61ce0c
BLAKE2b-256 ab65f0b51544f4dd5aef6d9e48840a46891651258089c3d0e1d40e02bec4ce54

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