
I Turned CloudCode into a Model-agnostic Engine with AnyModel Proxy
Table of Contents
TL;DR:
- CloudCode can now call GPT, Gemini, DeepSeek, Gemma 4, and local Ollama models.
- AnyModel strips incompatible fields, retries automatically, and translates formats without external dependencies.
- Start with npx anymodel and point CloudCode to http://localhost:9090.
- Run multiple proxies on different ports or terminals.
- Use SpecWith and Verified Skill Project to keep your skills secure and structured.
Why this matters
I used to struggle with CloudCode’s single Anthropic model. I needed more options, had to rewrite requests for each provider, and ended up with a bloated editor.
- Limited model options in CloudCode (only Anthropic) → AnyModel gives 600+ models via OpenRouter and local Ollama.
- Incompatible request fields across providers → AnyModel strips them automatically.
- Handling retries and failures → AnyModel retries failed requests.
- Translating formats between providers → AnyModel translates request/response to match each provider.
- Dependency bloat in code editors → AnyModel has no external dependencies.
- Paying high costs for proprietary models → Use free models or local Ollama.
- Securing skills against vulnerabilities → Use Verified Skill Project registry.
- Managing large projects with many product increments → Use SpecWith for structure.
- Difficulty running multiple proxies and terminals → AnyModel supports multiple ports.
Core concepts
AnyModel is a lightweight Node.js proxy that sits between the client and the model provider. It redirects requests to OpenRouter by default, strips incompatible fields, retries automatically, and translates request/response formats. The proxy uses only Node.js built-ins, so you can drop it into any environment without installing extra packages. It is MIT-licensed and open source, so you can audit the code yourself.
| Feature | AnyModel Proxy | OpenRouter | DeepSeek |
|---|---|---|---|
| No external dependencies | ✅ | ❌ | ❌ |
| Handles incompatible fields | ✅ | ❌ | ❌ |
| Automatic retries | ✅ | ❌ | ❌ |
| Rate limit handling | ✅ | ✅ | ❌ |
| Local model support (Ollama) | ✅ | ❌ | ❌ |
| Multiple proxies on different ports | ✅ | ❌ | ❌ |
OpenRouter hosts more than 600 models, including open source, proprietary, and open-weight models OpenRouter — 600+ Models (2026). Gemma 4 was released today, offering advanced reasoning and 256K context Gemma 4 Release (2026). The Verified Skill Project’s registry contains over 100,000 secure skills Verified Skill Project — Registry (2026). Agent Swarm lets you spawn a team of expert agents that coordinate autonomously Agent Swarm — Repo (2026). Ollama allows offline, local model inference Ollama — Official Site (2026).
How to apply it
Prerequisites
- Node.js ≥16.
- CloudCode set up.
- OpenRouter API key (create one at https://openrouter.ai).
- Export the key: export OPENROUTER_API_KEY=sk-or-… OpenRouter — API Key Auth (2026).
Install AnyModel
npx anymodelThe command downloads the binary, uses only Node.js built-ins, and starts the proxy on port 9090 by default AnyModel — Documentation (2026).
Start the proxy
npx anymodel --port 9090 --model openai/gpt-5.4Replace openai/gpt-5.4 with any supported model ID: gemma-4, deepseek/deepseek-r1-0528, llama, or an Ollama local model like ollama/llama3.1. AnyModel will strip incompatible fields, retry failures, and translate formats automatically.
Configure CloudCode
Point CloudCode’s model endpoint to http://localhost:9090. CloudCode will now send every request to AnyModel, which forwards it to the chosen provider.Run multiple proxies
Open a new terminal and start another instance on a different port:npx anymodel --port 1992 --model deepseek/deepseek-r1-0528You can now use http://localhost:1992 in a separate CloudCode project or terminal.
Integrate SpecWith
SpecWith provides a spec-driven workflow for large projects. Initialize it:specwith initThen generate specs, have agents write code, and use the SpecWith registry to keep everything organized. SpecWith is open source and complements AnyModel’s lightweight design.
Secure your skills
Import verified skills from the registry:anyskill fetch https://verified-skill.comAnyModel will only accept calls to verified skills, reducing the attack surface.
Monitor and rate-limit
AnyModel automatically respects provider rate limits. If a model hits its limit, the proxy will retry with exponential backoff. You can also set custom limits in anymodel.json.
Pitfalls & edge cases
- Free vs. paid models: Free models may have stricter limits; paid models give you higher quota.
- Rate limits: Some providers impose daily caps; anymodel retries but will eventually fail if the cap is exceeded.
- Performance overhead: Adding a proxy introduces a tiny latency (~5 ms), negligible for most tasks.
- Field incompatibility: If a new provider adds a required field, AnyModel will drop it, possibly changing the response.
- Multiple terminals: Running many proxies can exhaust ports; choose distinct ports.
- Local model availability: Ollama models must be installed locally; AnyModel just forwards to the local endpoint.
- Security: Never commit your API key; store it in environment variables or secret managers.
Quick FAQ
Which models can I use with AnyModel?
GPT-5.4, Gemini, DeepSeek-R1-0528, Gemma 4, Llama, Qwen, and any local Ollama model.Does AnyModel require external dependencies?
No, it uses only Node.js built-ins.Can I run local Ollama models?
Yes, just point AnyModel to the local Ollama endpoint.How does AnyModel handle rate limiting?
It retries failed requests with exponential backoff and logs the limit.Can I run multiple proxies on different ports?
Absolutely; just use the –port flag.Is my OpenRouter API key safe?
Keep it in an environment variable and never commit it to code.What about cost?
Free models cost $0; paid models charge per token.
Conclusion
AnyModel gives developers a fast, no-dependency way to turn CloudCode into a multi-model hub. With OpenRouter’s 600+ models, local Ollama support, and built-in retries, you can focus on building features, not wiring providers. Combine it with SpecWith for structured workflows and the Verified Skill Project for secure skills, and you have a complete, future-proof AI development stack. Try it today with npx anymodel and watch your productivity skyrocket.
References
- AnyModel — Documentation (2026) (https://anymodel.dev)
- OpenRouter — Overview (2026) (https://openrouter.ai)
- OpenRouter — API Key Auth (2026) (https://openrouter.ai/docs/api/reference/authentication)
- OpenRouter — 600+ Models (2026) (https://grokipedia.com/page/OpenRouter)
- DeepSeek — Official Site (2026) (https://deepseek.com)
- DeepSeek-R1-0528 Release (2025) (https://api-docs.deepseek.com/news/news250528)
- Gemma 4 Release (2026) (https://blog.google/innovation-and-ai/technology/developers-tools/gemma-4/)
- Verified Skill Project — Registry (2026) (https://verified-skill.com/)
- Agent Swarm — Repo (2026) (https://github.com/desplega-ai/agent-swarm)
- Ollama — Official Site (2026) (https://ollama.ai)





