Metadata-Version: 2.4
Name: llmux-sdk
Version: 0.1.0
Summary: Scriptable LLM multiplexer — unified interface to Claude and OpenAI via subscription OAuth
Author-email: Lorenzo Guideri <lorenzoguideri@duck.com>
License-Expression: MIT
Project-URL: Homepage, https://gitlab.com/grisus/llmux
Project-URL: Repository, https://gitlab.com/grisus/llmux
Keywords: llm,claude,openai,multiplexer,ai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# 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:

```bash
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:

```bash
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

```python
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

```bash
pip install llmux
```

**From git:**

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

**Locally (development):**

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

## Run tests

```bash
pytest
```
