I Turned CloudCode into a Model-agnostic Engine with AnyModel Proxy | Brav

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.

FeatureAnyModel ProxyOpenRouterDeepSeek
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

  1. Prerequisites

  2. Install AnyModel

    npx anymodel
    

    The command downloads the binary, uses only Node.js built-ins, and starts the proxy on port 9090 by default AnyModel — Documentation (2026).

  3. Start the proxy

    npx anymodel --port 9090 --model openai/gpt-5.4
    

    Replace 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.

  4. 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.

  5. Run multiple proxies
    Open a new terminal and start another instance on a different port:

    npx anymodel --port 1992 --model deepseek/deepseek-r1-0528
    

    You can now use http://localhost:1992 in a separate CloudCode project or terminal.

  6. Integrate SpecWith
    SpecWith provides a spec-driven workflow for large projects. Initialize it:

    specwith init
    

    Then 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.

  7. Secure your skills
    Import verified skills from the registry:

    anyskill fetch https://verified-skill.com
    

    AnyModel will only accept calls to verified skills, reducing the attack surface.

  8. 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

  1. Which models can I use with AnyModel?
    GPT-5.4, Gemini, DeepSeek-R1-0528, Gemma 4, Llama, Qwen, and any local Ollama model.

  2. Does AnyModel require external dependencies?
    No, it uses only Node.js built-ins.

  3. Can I run local Ollama models?
    Yes, just point AnyModel to the local Ollama endpoint.

  4. How does AnyModel handle rate limiting?
    It retries failed requests with exponential backoff and logs the limit.

  5. Can I run multiple proxies on different ports?
    Absolutely; just use the –port flag.

  6. Is my OpenRouter API key safe?
    Keep it in an environment variable and never commit it to code.

  7. 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

Last updated: April 3, 2026

Recommended Articles

Derivatives: The Hidden Engine of Financial Fragility | Brav

Derivatives: The Hidden Engine of Financial Fragility

Discover how derivatives—futures, options, swaps, and CDOs—can destabilize the financial system and learn to spot hidden systemic risks.
How AI Agents Turn Into Threats: Guarding Your Code From Prompt Injection | Brav

How AI Agents Turn Into Threats: Guarding Your Code From Prompt Injection

Secure your AI agents: learn why prompt injection remains a hard problem, how to isolate agents, and real-world examples of malware, malvertising, and data leaks.
The 5-Page Funnel Blueprint That Turned My Simple Funnels into $300,000 | Brav

The 5-Page Funnel Blueprint That Turned My Simple Funnels into $300,000

Discover the step-by-step 5-page funnel that turned a simple idea into $300,000. Learn how to capture phone numbers, use VSLs, start with organic traffic, and scale to $10K+ months.
Logarithms: The Spark That Turned Astronomical Calculations into Lightning | Brav

Logarithms: The Spark That Turned Astronomical Calculations into Lightning

Discover how John Napier’s logarithm tables and Kepler’s genius turned tedious 7-digit multiplication into simple addition, leading to the first accurate star catalog and the discovery of planetary laws. Read this practical guide for history of science and math students.
Linux Hardening 101: My 10 Underrated Tools That Turn a Weak Server Into a Fortress | Brav

Linux Hardening 101: My 10 Underrated Tools That Turn a Weak Server Into a Fortress

Discover 10 underrated Linux hardening tools that boost security. From Lynis audits to eCryptfs encryption, this guide shows real-world steps and metrics.
Preflight Checks: My Step-by-Step Engine Start Playbook | Brav

Preflight Checks: My Step-by-Step Engine Start Playbook

Learn the essential preflight checklist that ensures a smooth engine start. Follow our step-by-step guide and avoid costly delays.