model-routing

Generate code on-device with Ollama while routing planning and review to cloud models.

2|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/Benja-Pauls/SerpentStack --skill model-routing-benja-pauls
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-routing
Source: https://github.com/Benja-Pauls/SerpentStack/tree/main/.skills/model-routing
Command: npx skills add https://github.com/Benja-Pauls/SerpentStack --skill model-routing-benja-pauls

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps developers save on API costs by delegating token-heavy code generation tasks to on-device local models, while still using cloud models for planning and review.

Core Features & Use Cases

  • Cost Reduction: Save 10-50x on API costs for coding-heavy sessions.
  • On-Device Code Generation: Utilizes Ollama to delegate code generation tasks.
  • Cloud Model for Planning & Review: Leverages cloud models like Sonnet or Opus for orchestration and review.
  • Use Case: Ideal for scenarios where the user wants to save on API costs and can benefit from local model code generation.

Quick Start

Use the model-routing skill to generate code for a service layer using the local-coder subagent.

Frequently Asked Questions about model-routing

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

FAQPage Schema
How do I reduce cloud API costs for code generation?

To reduce cloud API costs for code generation, you can delegate token-heavy coding tasks to on-device local models using Ollama, saving 10-50x on API expenses while reserving cloud models for planning and review.

Can I use local models for code generation while keeping cloud API for planning?

Yes, you can use local models for code generation while keeping cloud API for planning by routing token-heavy generation tasks to Ollama on-device, leveraging cloud models like Sonnet or Opus strictly for orchestration and review.

How does on-device code generation with Ollama work to minimize API usage?

On-device code generation with Ollama minimizes API usage by executing token-heavy code generation locally on your device, which prevents expensive cloud API calls during extensive coding, planning, and review sessions.

Do I need Ollama installed to route code generation tasks locally?

Yes, you need Ollama installed to route code generation tasks locally, as it acts as the on-device execution engine that handles the token-heavy code generation to minimize your cloud API costs.

What is the best way to save on API costs during coding-heavy sessions?

The best way to save on API costs during coding-heavy sessions is routing code generation to local models via Ollama, achieving 10-50x cost reduction while retaining cloud APIs only for high-level planning and review.

When should I avoid using local models for code generation?

You should avoid using local models for code generation when your hardware cannot support on-device inference via Ollama, or when your workflow requires the advanced orchestration capabilities of cloud APIs for every task including generation.