LLMDB.Sources.Zenmux (LLM DB v2026.3.0)

Copy Markdown View Source

Remote source for Zenmux models (https://zenmux.ai/api/v1/models).

  • pull/1 fetches data from Zenmux API and caches locally
  • load/1 reads from cached file (no network call)

Options

  • :url - API endpoint (default: "https://zenmux.ai/api/v1/models")
  • :api_key - Zenmux API key (required, or set ZENMUX_API_KEY env var)
  • :req_opts - Additional Req options for testing

Configuration

Cache directory can be configured in application config:

config :llm_db,
  zenmux_cache_dir: "priv/llm_db/remote"

Default: "priv/llm_db/remote"

Usage

# Pull remote data and cache (requires API key)
mix llm_db.pull --source zenmux

# Load from cache
{:ok, data} = Zenmux.load(%{})

Summary

Functions

Transforms Zenmux API response to canonical Zoi format. Zenmux is OpenAI compatible, so the structure mirrors OpenAI's.

Functions

transform(content)

Transforms Zenmux API response to canonical Zoi format. Zenmux is OpenAI compatible, so the structure mirrors OpenAI's.

Input Format (Expected)

{
  "object": "list",
  "data": [
    {
      "id": "gpt-4",
      "object": "model",
      "created": 1686935002,
      "owned_by": "openai"
    }
  ]
}

Output Format (Canonical Zoi)

%{
  "zenmux" => %{
    id: :zenmux,
    name: "Zenmux",
    models: [
      %{
        id: "gpt-4",
        provider: :zenmux,
        extra: %{
          created: 1686935002,
          owned_by: "openai"
        }
      }
    ]
  }
}