claude-code-custom-models

Configure Claude Code to run OpenAI-compatible models through a LiteLLM translation gateway.

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/TylerSimons1127/vibe --skill claude-code-custom-models-tylersimons1127
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: claude-code-custom-models
Source: https://github.com/TylerSimons1127/vibe/tree/main/skills/devops/claude-code-custom-models
Command: npx skills add https://github.com/TylerSimons1127/vibe --skill claude-code-custom-models-tylersimons1127

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires litellm, and includes references (resource) components.

What problem does it solve? Claude Code natively speaks the Anthropic /v1/messages protocol, which prevents direct use of OpenAI-compatible providers like NVIDIA NIM, Ollama, LM Studio, vLLM, or OpenRouter. This Skill bridges that gap by routing Claude Code through a LiteLLM proxy that translates between the two protocols. ## Core Features & Use Cases - Protocol Translation Gateway: Sets up a LiteLLM proxy exposing an Anthropic-compatible endpoint that forwards to any OpenAI-compatible backend. - Verified Configuration: Provides a known-good config.yaml mapping friendly model names (e.g., glm-5.2) to upstream provider IDs, plus curl commands to verify the bridge independently. - Pitfall Documentation: Covers PYTHONPATH hijacking, missing websockets extras, NIM rate limiting (HTTP 429), and Windows/MSYS path quirks. - Use Case: You have a free NVIDIA NIM API key and want to drive Claude Code with GLM 5.2 instead of an Anthropic model. This Skill walks you through installing LiteLLM in an isolated venv, starting the gateway on port 4000, and pointing Claude Code at it via ANTHROPIC_BASE_URL. ## Quick Start Ask the agent to set up a LiteLLM gateway on localhost port 4000 and configure Claude Code to use the glm-5.2 model from NVIDIA NIM.

Frequently Asked Questions about claude-code-custom-models

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use custom models in Claude Code?▼

Point Claude Code at any backend implementing the Anthropic /v1/messages protocol by setting ANTHROPIC_BASE_URL and a non-empty ANTHROPIC_API_KEY. For OpenAI-compatible providers, run a LiteLLM proxy that translates between the two protocols.

Can Claude Code use models other than Anthropic?▼

Yes, Claude Code is not locked to Anthropic models. It speaks the /v1/messages protocol, so any gateway exposing that protocol works. LiteLLM bridges OpenAI-compatible providers like NVIDIA NIM, Ollama, and OpenRouter.

How to connect Claude Code to NVIDIA NIM?▼

Create a LiteLLM config.yaml with model nvidia_nim/z-ai/glm-5.2, api_base https://integrate.api.nvidia.com/v1, and your nvapi key. Start the proxy on port 4000, then set ANTHROPIC_BASE_URL=http://127.0.0.1:4000 and run claude --model glm-5.2.

Why does LiteLLM fail with ModuleNotFoundError: websockets?▼

The bare litellm package lacks proxy dependencies. Install with the proxy extras using 'litellm[proxy]', which includes websockets. Also run the litellm CLI directly rather than python -m litellm.proxy, which cannot be executed as a package.

Why does Claude Code hang when using NVIDIA NIM models?▼

Free NIM API keys are heavily rate-limited and return HTTP 429, causing runs to hang or return empty output after showing the build line. This is throttling, not a configuration bug; wait and retry between calls.

What is the alternative to LiteLLM for running custom models?▼

OpenCode speaks OpenAI-compatible protocols natively, so no gateway is needed. Configure it via opencode.json with the @ai-sdk/openai-compatible provider, but cap per-model maxTokens since OpenCode defaults to 32000 completion tokens.