Registry / llm-agents / lmnr-claude-code-proxy

lmnr-claude-code-proxy

JSON →
library0.1.24pypypi✓ verified 22d ago

A thin proxy server designed to route requests from Claude Code to various Large Language Model (LLM) providers, while incorporating Laminar tracing for observability. It is currently at version 0.1.19 and appears to follow an as-needed release cadence for updates and bug fixes.

pip install lmnr-claude-code-proxy
INSTALL
IMPORT
SIG · LMNR-CLAUDE-CODE-P
L
lmnr-claude-code-proxy
llm-agentspythonv0.1.24
Install
2.4s avg
Import
225ms
Disk
23MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.24 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 2.7s
py 3.11
✓ —
✓ 2.5s
py 3.12
✓ —
✓ 2.2s
py 3.13
✓ —
✓ 2.1s
py 3.9
✕ build_error
✕ build_error
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

run_server
from lmnr_claude_code_proxy import run_server
from lmnr_claude_code_proxy import run_proxy_server
ProxyServer
from lmnr_claude_code_proxy import ProxyServer
run
from lmnr_claude_code_proxy import run

This quickstart demonstrates how to set up the necessary environment variables and conceptually run the proxy server. Typically, such a proxy is run as a standalone process, often via a CLI command or a simple Python script that calls a blocking `run` function. Users would then configure their Claude Code client to point to the proxy's address (e.g., `export ANTHROPIC_BASE_URL="http://localhost:8082"`).

import os from lmnr_claude_code_proxy import run_proxy_server # Set required environment variables os.environ['OPENAI_API_KEY'] = os.environ.get('OPENAI_API_KEY', 'YOUR_OPENAI_API_KEY_HERE') # Or other target LLM API key os.environ['ANTHROPIC_BASE_URL'] = 'http://localhost:8082' # Point Claude Code to the proxy # In a real scenario, you would run this in a separate process or via a CLI command. # For demonstration, we simulate starting the server. This function typically blocks. # run_proxy_server(host='0.0.0.0', port=8082)
Debug
Known issues
breakingBreaking changes in the official Claude API or Claude Code client (e.g., Anthropic Messages API format) can render the proxy non-functional, requiring updates to the proxy implementation. Historically, Claude Code has had frequent updates to its internal workings.
fix
Monitor official Claude Code and Anthropic API documentation for changes and update the `lmnr-claude-code-proxy` library to the latest compatible version.
affects: All versions
gotchaProperly securing API keys and environment variables is critical. Proxies handle sensitive credentials, and misconfigurations (e.g., in `.env` files or project settings) have led to API key exfiltration vulnerabilities in related proxy projects (CVE-2026-21852).
fix
Store API keys securely using environment variables, secrets management systems, or `.env` files that are properly excluded from version control. Ensure any client-side `ANTHROPIC_BASE_URL` or similar configurations do not inadvertently expose credentials.
affects: All versions
gotchaClaude Code's internal token consumption and session management can be complex, leading to unexpected rate limit hits or high costs, even when using a proxy. Recent changes in Claude Code's behavior regarding prompt caching and session resume have exacerbated these issues.
fix
Monitor token usage closely. Consider setting cost controls or usage limits on the backend LLM providers. Be aware that features like `--resume` in Claude Code might still incur significant token usage through the proxy. Downgrading Claude Code to older, more stable versions (e.g., v2.1.34) has been a community workaround for some issues.
affects: All versions, particularly with newer Claude Code client versions (v2.1.69+)
gotchaThe functionality and reliability of proxying Claude Code to non-Anthropic models (e.g., OpenAI, Gemini) heavily depend on the proxy's ability to accurately translate between API formats (Anthropic Messages API to target provider's API and back). Incomplete or incorrect translation can lead to reduced functionality or unexpected model behavior.
fix
Thoroughly test model behavior when routed through the proxy, especially for complex tasks involving tool use, thinking blocks, or specific model features. Verify that expected responses are maintained across translation layers.
affects: All versions
Upgrade
Version history
0.1.24latest on PyPI · released Aug 5, 2026
Audit
Dependencies
uvicornrequiredCommon ASGI server for Python web applications; likely used internally to run the proxy server.
fastapioptionalA common framework for building API servers in Python, often used with uvicorn for proxy implementations.
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources