Skip to main content

Scriptable LLM multiplexer — unified interface to Claude and OpenAI via subscription OAuth

Project description

llmux

Scriptable LLM multiplexer — unified interface to Claude and OpenAI via subscription OAuth (no API keys needed).

Getting tokens

Claude

llmux reuses the token from an existing Claude Code (CLI) session.

  1. Install Claude Code: npm install -g @anthropic-ai/claude-code
  2. Log in: claude login
  3. Done — llmux reads ~/.claude/.credentials.json automatically.

Or set the env var manually:

export CLAUDE_OAUTH_TOKEN=your_token_here

The token is at .claudeAiOauth.accessToken inside ~/.claude/.credentials.json.


OpenAI (Codex)

llmux reuses the token from an existing Codex CLI session.

  1. Install Codex: npm install -g @openai/codex
  2. Log in: codex login
  3. Done — llmux reads ~/.codex/auth.json automatically.

Or set env vars manually:

export CODEX_OAUTH_TOKEN=your_access_token
export CODEX_ACCOUNT_ID=your_account_id

Both values are in ~/.codex/auth.json under .tokens.access_token and .tokens.account_id.


Quick start

from llmux import Agent, Claude, GPT

# Claude (default)
agent = Agent(Claude.sonnet46)
print(agent("Hello!"))

# OpenAI
agent = Agent(GPT.gpt55)
print(agent("Hello!"))

# Streaming
with Agent(Claude.sonnet46) as agent:
    for chunk in agent.stream("Tell me a joke"):
        print(chunk, end="", flush=True)

Install

pip install llmux

From git:

pip install git+ssh://git@gitlab.com/grisus/llmux.git

Locally (development):

pip install -e ".[dev]"   # editable + pytest
pip install -e .           # runtime only

Run tests

pytest

Project details


Download files

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

Source Distribution

llmux_sdk-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

llmux_sdk-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for llmux_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b47ef549e304b19b9b45746edcd4cb8b7ad943549a25ffee3f06c9f117ba170d
MD5 ec4cb60cfa9f6cf97885cb6237a43987
BLAKE2b-256 920b7b5c705e4892bb8ed89fdeb559b42d91693842692fd5861345e1494e47cb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for llmux_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d0a3aed754c05bc3c0d251e260ca2a61d154a322c5387f0072faaba43a5de07
MD5 d9b63f48ab9cf9cb6e762a3c542e8906
BLAKE2b-256 943e54bad5c2ec84e031fa215e678ad9552126b30f6a3f76352b5a2c8525a3f6

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 Pingdom Monitoring Sentry Error logging StatusPage Status page