Skip to main content

Run Claude Code (and any Anthropic SDK client) on NVIDIA NIM models via a local proxy.

Project description

nvd-claude-proxy

PyPI Python License: MIT Code Style: Ruff

Run Claude Code — and any Anthropic SDK client — on enterprise-grade NVIDIA NIM models.

nvd-claude-proxy is a production-hardened local HTTP proxy that translates between the Anthropic Messages API and the NVIDIA NIM (OpenAI-compatible) API. It enables you to run Claude Code, the Anthropic SDK, and other clients using high-performance NVIDIA-hosted models with official-grade resilience and scaling.


🚀 Key Features

  • Architectural Excellence: Fully decoupled core translation logic from the transport layer.
  • Enterprise Resilience: Built-in Circuit Breakers and automated failover chains to protect against upstream outages.
  • Idempotency Support: Request deduplication and safe retries via anthropic-idempotency-key across Redis, SQLite, and Memory backends.
  • Scalable State: Distributed session management via Redis (with SQLite and In-Memory fallbacks).
  • Official-Grade Security: Unified AuthMiddleware protecting all endpoints with global API key enforcement.
  • Claude Code Optimized: Specifically tuned for Claude Code's complex tool-calling and reasoning patterns.
  • Vision & Progressive Streaming: Fine-grained progressive tool streaming and real-time multimodal (image_url) parity.
  • Modular Pipeline: Event-driven streaming architecture for deterministic state management.

🛠 Deployment & Configuration

Environment Variables

Variable Default Description
NVIDIA_API_KEY (Required) Your NVIDIA NIM API key.
PROXY_API_KEY None Optional key to protect the proxy itself.
STORAGE_ENGINE sqlite Persistence backend: redis, sqlite, or memory.
REDIS_URL None Required if STORAGE_ENGINE=redis (e.g., redis://localhost:6379).
PROXY_PORT 8788 Local port for the proxy.
RATE_LIMIT_RPM 0 Global rate limit (requests per minute). 0 to disable.

Quick Start

# Install the proxy
pip install nvd-claude-proxy[full]

# Export your API key
export NVIDIA_API_KEY=nvapi-...

# Run the proxy
ncp run

Then point your Claude Code at the proxy:

export ANTHROPIC_BASE_URL=http://localhost:8788
claude

🏗 Architecture

The proxy uses a Chain of Responsibility pattern for streaming events: MetadataProcessor -> TextProcessor -> ToolProcessor -> SafetyProcessor -> FinalizerProcessor

This ensures that even complex interleaved reasoning and parallel tool calls are correctly reconstructed for the Anthropic SDK.


Official-Grade Infrastructure for the AI Era.


Production Claude Code + NVIDIA NIM configuration

Use this proxy as the Anthropic-compatible endpoint for Claude Code:

export NVIDIA_API_KEY=nvapi-...
export PROXY_PORT=8788
export MAX_REQUEST_BODY_MB=32
export REQUEST_TIMEOUT_SECONDS=600
export STORAGE_ENGINE=redis
export REDIS_URL=redis://127.0.0.1:6379

# Optional but strongly recommended for shared/devbox usage
export PROXY_API_KEY=replace-with-a-long-random-secret

Run the proxy:

uv run ncp run
# or: ncp run

Point Claude Code at the proxy:

export ANTHROPIC_BASE_URL=http://127.0.0.1:8788
export ANTHROPIC_AUTH_TOKEN=dummy
claude

Recommended production notes

  • Prefer STORAGE_ENGINE=redis for stable rate limiting, idempotency, and multi-session behavior.
  • Keep MAX_REQUEST_BODY_MB=32 to avoid pathological payloads while still supporting large Claude Code tool catalogs.
  • Use the default streaming path; it emits early message_start and periodic ping events to reduce apparent latency and prevent idle timeouts.
  • If tool calls appear slow or malformed upstream, start with claude-sonnet-4-6 or claude-haiku-4-5 mappings before moving to larger reasoning models.
  • This proxy is translation-only: Claude Code executes tools locally; the proxy must preserve tool ordering, streamed JSON fragments, and Anthropic-compatible SSE grammar.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

nvd_claude_proxy-1.3.4.tar.gz (120.6 kB view details)

Uploaded Source

Built Distribution

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

nvd_claude_proxy-1.3.4-py3-none-any.whl (146.4 kB view details)

Uploaded Python 3

File details

Details for the file nvd_claude_proxy-1.3.4.tar.gz.

File metadata

  • Download URL: nvd_claude_proxy-1.3.4.tar.gz
  • Upload date:
  • Size: 120.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for nvd_claude_proxy-1.3.4.tar.gz
Algorithm Hash digest
SHA256 0791971d4fb76deb5311425f535a213d9babf67f4c0ccb83dcbc8e3ae8dee4a2
MD5 672dc15faaa57213d9fe3d6605bbb66f
BLAKE2b-256 6826ea272517497ad3a61efb28819e1a04757f48371f9887534103d13086f726

See more details on using hashes here.

File details

Details for the file nvd_claude_proxy-1.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nvd_claude_proxy-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3a19f4134becd31ae1c219587c448394dc6970226997b8cb80037e4b9dbd26bb
MD5 f776f05fb5b45a69b38cf6c09c7a773a
BLAKE2b-256 5d31b18f09091a29f95fb59a1dd91f7d8a1d84e35456209ad8e18eeb274d103a

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