local-inference

Route LLM requests to local MLX or Ollama models with cloud fallback.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/escotilha/claude-public --skill local-inference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: local-inference
Source: https://github.com/escotilha/claude-public/tree/main/skills/local-inference
Command: npx skills add https://github.com/escotilha/claude-public --skill local-inference

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of paying for (and depending on) cloud LLM calls for small, repetitive tasks by routing lightweight requests to local models first and automatically falling back to cloud when needed.

Core Features & Use Cases

  • Unified OpenAI-compatible gateway: Exposes local and cloud models behind a single API endpoint at http://localhost:4000/v1 so your tools don’t need provider-specific integrations.
  • Multi-backend inference with automatic fallback: Uses LiteLLM to try local tiers (MLX and/or Ollama) and then fall back to cloud backends like OpenRouter and Anthropic.
  • Practical model routing for real workflows: Supports different model “names” (e.g., local, code, claude) to map tasks like summarization/formatting vs. code generation vs. complex reasoning.

Quick Start

Ask an AI assistant to configure and start LiteLLM so your local endpoint http://localhost:4000/v1 routes the model name local to MLX and/or Ollama with cloud fallback to OpenRouter or Anthropic.

Frequently Asked Questions about local-inference

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

FAQPage Schema
How do I run local LLM inference with automatic cloud fallback?

To run local LLM inference with automatic cloud fallback, route your requests through a unified gateway that tries local MLX or Ollama models first, then falls back to cloud providers like OpenRouter or Anthropic when local fails.

Can I use an OpenAI-compatible API for local model routing?

Yes, you can use an OpenAI-compatible API for local model routing by mapping different model names to specific tasks. This exposes local and cloud backends behind a single endpoint so your tools avoid provider-specific integrations.

How do I configure LiteLLM proxy for MLX and Ollama backends?

To configure the LiteLLM proxy for MLX and Ollama, set up a local endpoint at localhost:4000/v1 that maps model names like 'local' or 'code' to your local tiers, establishing a fallback chain to cloud backends.

What is the best way to reduce cloud LLM costs for small repetitive tasks?

The best way to reduce cloud LLM costs for small tasks is routing lightweight requests to local models first. By using a gateway with automatic fallback, you only pay for cloud calls when local tiers cannot handle the request.

Does LiteLLM support fallback routing to OpenRouter and Anthropic?

LiteLLM supports fallback routing to OpenRouter and Anthropic by configuring a fallback chain. When local MLX or Ollama tiers fail or are unavailable, the gateway automatically routes the request to these cloud backends.

When should I not use a local inference gateway for LLM requests?

You should not use a local inference gateway for complex reasoning tasks that exceed local model capabilities. While it handles chat, summarization, and bounded code generation, heavy workloads may immediately fall back to cloud providers.