Run Any LLM from Claude Code (GPT-5.1, Gemini, Grok,) (github.com)

🤖 AI Summary
Claude Code can now call external LLMs (Kimi, Grok, Gemini, GLM, GPT‑5 and any OpenRouter-accessible model) directly from your prompts. Mention a model in your prompt (e.g., "Use kimi to write a blog post…") and include the tag "external-llm" if it doesn’t trigger; the agent detects the model reference, extracts the user request, calls the chosen model via the OpenRouter API, saves the response to llm-outputs/ (or a custom path), and shows the file location. Setup is simple: add OPENROUTER_API_KEY=your-key-here to .env, copy provided files (openrouter.sh, models.conf, CLAUDE.md) and the .claude agent config into your project, and optionally select auto-approve on first run. A CLI wrapper (openrouter.sh) supports --model, --query, --output, --context-file, --system-prompt, --temperature, and --max-tokens. This is significant because it gives Claude Code users a unified, reproducible way to experiment and combine models across providers without leaving their dev environment—useful for model comparison, fallback routing, or chaining specialized LLMs. Technical caveats: model names are case-sensitive, you need an OpenRouter key/credits, watch for API errors and token limits, and you can extend models.conf with any OpenRouter model IDs (e.g., mistralai/mixtral-8x22b-instruct). Default configured models include kimi (Moonshot K2), grok (Grok 4), glm (GLM‑4.6), gemini (Gemini 2.5 Pro) and gpt‑5.
Loading comments...
loading comments...