Kitty Bridge — launch coding agents through a local API bridge
Project description
kitty-bridge
Use your favorite coding agent with any LLM provider.
Claude Code with MiniMax. Codex with GLM. Gemini CLI with OpenRouter. One command.
pip install kitty-bridge
Quick Start
1. Install
pip install kitty-bridge
Requires Python 3.10+.
2. Set up a profile
kitty setup
An interactive wizard walks you through picking a provider, a model, and entering your API key. Takes 30 seconds.
3. Launch your agent
kitty claude # Claude Code → your provider
kitty codex # Codex CLI → your provider
kitty gemini # Gemini CLI → your provider
kitty kilo # Kilo Code → your provider
That's it. Your coding agent now talks to the LLM you chose — not the one it was built for.
Example: Use GLM with Claude Code
$ pip install kitty-bridge
$ kitty setup
? Provider: openai
? Model: glm-4-plus
? API key: ********
$ kitty claude
✓ Bridge running on port <random_port>
✓ Claude Code launched
> Hello! How can I help you today?
Balanced Profiles
A balanced profile combines multiple providers into one. Each request is sent to a randomly chosen healthy provider. If one provider goes down, the others pick up the slack automatically.
Why use it:
- Cost savings — spread requests across cheaper providers
- Rate limit resilience — never hit a single provider's limit
- Fault tolerance — if one provider is down, the others keep working
How to create one:
kitty profile
# → "Create balancing profile" → select 2+ member profiles
Example: Combine MiniMax, Novita, and Z.AI into one balanced profile called my-pool, then use it with any agent:
kitty my-pool claude
kitty my-pool codex
When you run this, each request goes to a random healthy member. If MiniMax returns an error, kitty silently retries on Novita or Z.AI — your agent never sees the failure.
Bridge Mode
Bridge mode starts a standalone OpenAI-compatible API server on your machine. Use it when you want to connect tools that speak the OpenAI API — IDEs, custom scripts, anything that accepts a base URL.
kitty bridge # use default profile
kitty my-profile bridge # use a specific profile
Point your tool at http://localhost:<port> and it just works.
Available endpoints:
| Endpoint | Protocol | Used by |
|---|---|---|
POST /v1/chat/completions |
Chat Completions | General purpose |
POST /v1/messages |
Anthropic Messages | Claude Code |
POST /v1/responses |
OpenAI Responses | Codex |
POST /v1/gemini/generateContent |
Gemini | Gemini CLI |
GET /healthz |
Health check | Monitoring |
Supported Agents
| Agent | Command | What it is |
|---|---|---|
| Claude Code | kitty claude |
Anthropic's coding agent |
| Codex CLI | kitty codex |
OpenAI's coding agent |
| Gemini CLI | kitty gemini |
Google's coding agent |
| Kilo Code | kitty kilo |
Open-source coding agent |
Supported Providers
| Provider | Type ID | Notes |
|---|---|---|
| OpenAI | openai |
|
| Anthropic | anthropic |
Direct Anthropic Messages API |
| OpenRouter | openrouter |
Multi-provider router |
| MiniMax | minimax |
|
| Novita | novita |
|
| Z.AI (regular) | zai_regular |
General-purpose endpoint |
| Z.AI (coding) | zai_coding |
Coding-optimized endpoint |
| Fireworks | fireworks |
|
| Ollama | ollama |
Local LLM deployment |
| OpenCode | opencode_go |
|
| AWS Bedrock | bedrock |
Uses boto3 SigV4 auth |
| Azure OpenAI | azure |
Requires deployment name |
| Google Vertex AI | vertex |
Requires project and location |
Commands
| Command | Description |
|---|---|
kitty setup |
Create your first profile (interactive wizard) |
kitty profile |
Manage profiles (create, delete, set default, list) |
kitty doctor |
Diagnose installation issues |
kitty cleanup |
Restore agent config files after a crash |
kitty bridge |
Start a standalone API server |
kitty claude |
Launch Claude Code with default profile |
kitty codex |
Launch Codex with default profile |
kitty gemini |
Launch Gemini CLI with default profile |
kitty kilo |
Launch Kilo Code with default profile |
kitty <profile> <agent> |
Launch an agent with a specific profile |
kitty <profile> bridge |
Start bridge with a specific profile |
kitty --no-validate <profile> <agent> |
Skip API key validation |
kitty --version |
Print version |
kitty --help |
Print help |
Technical Details
How it works
kitty sits between your coding agent and the upstream LLM provider:
Agent (Claude Code / Codex / Gemini / Kilo) → kitty bridge → upstream provider
When you run kitty claude:
- kitty reads your profile (provider, model, API key)
- Starts a local HTTP bridge on a random port
- Configures the agent to send requests to the bridge instead of its default endpoint
- The bridge translates each request to the provider's format and forwards it
- Responses are translated back to the agent's native format
- When the agent exits, kitty restores the agent's config files
Profiles
A profile binds a provider, model, and API key together. Stored in ~/.config/kitty/profiles.json.
kitty setup # create a profile interactively
kitty profile # manage existing profiles
kitty my-profile claude # use a specific profile
Profile names must be 1-32 characters, lowercase letters, numbers, dashes, or underscores. Reserved words like setup, claude, codex, gemini, kilo, profile, bridge cannot be used as profile names.
Pre-flight validation
Before launching, kitty validates your API key with a lightweight test request. If the key is invalid, you get a clear error immediately — not a cryptic failure inside the agent.
kitty --no-validate my-profile claude # skip validation (e.g. air-gapped/offline environments)
Cleanup
kitty restores agent config files after the agent exits. Three layers of cleanup:
- Normal exit —
finallyblock - Crash /
SIGTERM—atexithandler SIGKILL/ kernel OOM — runkitty cleanupmanually
Project structure
src/kitty/
├── bridge/ # HTTP bridge + protocol translation
├── cli/ # Command-line interface
├── credentials/ # API key storage
├── launchers/ # Agent-specific adapters
├── profiles/ # Profile management
├── providers/ # Upstream provider adapters
├── tui/ # Terminal UI components
└── types.py # Shared types
FAQ
"API Error: Unable to connect to API (ConnectionRefused)"
The agent is trying to connect to a bridge that isn't running. Usually caused by a stale config from a previous crashed session:
kitty cleanup
"API Error: 401" or "token expired or incorrect"
Your API key has expired or been revoked. Run setup again:
kitty setup
"Prompt exceeds max length" (Z.AI error 1261)
The conversation has grown beyond the model's context window. Use /clear in the agent to reset.
Can I use kitty with Cursor, Windsurf, or other IDEs?
Yes — start a bridge, then point your IDE's "OpenAI base URL" setting at http://localhost:<port>:
kitty bridge
# Then configure your IDE to use http://localhost:<port>/v1/chat/completions
Can I run a local model?
Yes. Install Ollama, pull a model, then create a profile with provider ollama:
kitty setup
# Provider: ollama
# Base URL: http://localhost:11434/v1
# Model: llama3
Development
pip install -e ".[dev]"
pytest
ruff check .
mypy src/kitty
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kitty_bridge-0.1.9.tar.gz.
File metadata
- Download URL: kitty_bridge-0.1.9.tar.gz
- Upload date:
- Size: 193.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f598c868594b65787a84c7aa41adb6afc1fe53e6b6bd9d04f60d6e8d9fc2ee37
|
|
| MD5 |
46ff63890fafb5240611f6e4ccd41594
|
|
| BLAKE2b-256 |
9a9a3a6ca00ebb1bd29a26af03c4faa7e5c1a302ce3cdc0a9813f53f1418236f
|
Provenance
The following attestation bundles were made for kitty_bridge-0.1.9.tar.gz:
Publisher:
publish.yml on Shelpuk-AI-Technology-Consulting/kitty-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kitty_bridge-0.1.9.tar.gz -
Subject digest:
f598c868594b65787a84c7aa41adb6afc1fe53e6b6bd9d04f60d6e8d9fc2ee37 - Sigstore transparency entry: 1311663803
- Sigstore integration time:
-
Permalink:
Shelpuk-AI-Technology-Consulting/kitty-bridge@64606ca91ed46e2c950f07b5f5d4368fb8ea3a73 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/Shelpuk-AI-Technology-Consulting
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64606ca91ed46e2c950f07b5f5d4368fb8ea3a73 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kitty_bridge-0.1.9-py3-none-any.whl.
File metadata
- Download URL: kitty_bridge-0.1.9-py3-none-any.whl
- Upload date:
- Size: 120.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d87c11144ce5ad346223da3f3efe1e75b3ae62bb1ba37389ade340a83426915
|
|
| MD5 |
d08cab120945dcdeecc66c32a2059810
|
|
| BLAKE2b-256 |
4dd2126cb36701b75f0df67d6f4d1e0f667e3d1a73021482244bcfa471f8aa57
|
Provenance
The following attestation bundles were made for kitty_bridge-0.1.9-py3-none-any.whl:
Publisher:
publish.yml on Shelpuk-AI-Technology-Consulting/kitty-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kitty_bridge-0.1.9-py3-none-any.whl -
Subject digest:
6d87c11144ce5ad346223da3f3efe1e75b3ae62bb1ba37389ade340a83426915 - Sigstore transparency entry: 1311663847
- Sigstore integration time:
-
Permalink:
Shelpuk-AI-Technology-Consulting/kitty-bridge@64606ca91ed46e2c950f07b5f5d4368fb8ea3a73 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/Shelpuk-AI-Technology-Consulting
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@64606ca91ed46e2c950f07b5f5d4368fb8ea3a73 -
Trigger Event:
push
-
Statement type: