← Back to directory
L

Lm

Community
Offload routine tasks from Claude Code to local or cloud LLMs to save token spend.
GitHub source repository ↗
★ 112 Stars Category · Dev Tools Very popular Source revision 1a0d97c20a20
52FMRS · D
Reliability
6/20
Security and permissions
9/20
Maintenance
9/20
Documentation
15/20
Setup experience
13/20

Houtini LM offers a practical token-saving solution for Claude Code users by offloading bounded tasks to local or cloud LLMs. It provides automatic model routing, performance tracking, and structured output support, significantly reducing Claude token consumption. It is a valuable tool for developers looking to control costs, but careful attention is needed regarding security risks and proper configuration.

Read the FMRS scoring method →

Houtini LM is an MCP server that connects Claude Code to any OpenAI-compatible LLM endpoint (such as LM Studio, Ollama, vLLM, DeepSeek, Groq, Cerebras) and saves Claude tokens by delegating bounded tasks—like generating boilerplate, code review, commit messages, format conversion—to a cheaper local or cloud model. Claude keeps doing the hard reasoning (architecture, planning, multi-file changes), while the local model handles the grunt work. It provides automatic model routing, performance tracking, structured JSON output, and model discovery.

Tools

chat
Send a task to the local/cloud LLM and get an answer; the primary offload tool.
custom_prompt
Use a three-part prompt (system, context, instruction) to reduce context bleed.
code_task
For code analysis with a pre-configured system prompt and output constraints.
code_task_files
Have the local LLM read files directly from disk for analysis; source never passes through the MCP client's context.
embed
Generate text embeddings via an OpenAI-compatible embedding endpoint.
discover
Health check and speed readout: model name, context window, connection latency, measured tok/s.
list_models
List all loaded and downloaded models on the LLM server with metadata including HuggingFace enrichment.
stats
Compact markdown dump of offload statistics, session and lifetime totals.

Setup

  1. Ensure Node.js >= 22.5 (>= 22.13 recommended).
  2. For Claude Code, run: claude mcp add houtini-lm -- npx -y @houtini/lm
  3. For other clients, add a configuration similar to the example in your MCP client config (e.g., claude_desktop_config.json).
  4. Optionally, if the LLM is on a different machine, set the environment variable HOUTINI_LM_ENDPOINT_URL to your LLM server URL (e.g., http://192.168.1.50:1234).
  5. If the endpoint requires auth, set HOUTINI_LM_API_KEY.
  6. For OpenRouter, optionally set HOUTINI_LM_MODEL to pin a specific model.
claude_desktop_config.json
{
  "mcpServers": {
    "houtini-lm": {
      "command": "npx",
      "args": [
        "-y",
        "@houtini/lm"
      ],
      "env": {
        "HOUTINI_LM_ENDPOINT_URL": "http://localhost:1234"
      }
    }
  }
}

Fit and risk

Best for

  • Developers using Claude Code for large refactors who want to reduce token bills.
  • Users with a local GPU server who want to leverage local models for repetitive tasks.
  • Those needing to offload bounded, well-defined tasks from Claude to a cheaper model.
  • Developers familiar with MCP and OpenAI-compatible APIs.

Not for

  • Tasks requiring strong reasoning or tool access should stay on Claude.
  • Latency-sensitive interactive scenarios, as local inference can be 3-30x slower than frontier models.
  • Users who do not need an MCP server but want to call LLM APIs directly.
  • Users not using Claude Code or Claude Desktop as an MCP client.

Required permissions

  • Read local files on the system (when using the code_task_files tool).
  • Create and read a local SQLite database file (~/.houtini-lm/model-cache.db).
  • Make network requests to the LLM endpoint (local or cloud).
  • Run Node.js processes.

Risks and side effects

  • Sending code or data to a local or cloud LLM may lead to information leakage, especially with cloud APIs.
  • Running untrusted code on local models may introduce security vulnerabilities.
  • Over-reliance on local models may degrade output quality because local models can be less capable.
  • The MCP server may inadvertently expose local file system paths, so use code_task_files with caution.
  • Token savings may be overestimated, as local inference can take more time or resources.

Troubleshooting

  1. If you cannot connect to the LLM endpoint at startup, check HOUTINI_LM_ENDPOINT_URL and ensure the LLM server is running.
  2. If you get empty responses or timeouts, check whether the model is loaded and the context window is sufficient.
  3. If using reasoning models, ensure HOUTINI_LM_THINKING is set appropriately, or check if the backend supports separate reasoning.
  4. If code_task_files rejects files, check if the file size exceeds HOUTINI_LM_MAX_FILE_MB or if the path is within allowed roots.
  5. Run 'npm run shakedown' for an end-to-end self-test to verify the installation and model capabilities.

Use cases

Generate test stubs, code review, commit messages, format conversions, mock data, type definitions, and other bounded tasks.
Save token costs by using local inference, especially when running local models with LM Studio or Ollama.
Use cloud APIs (DeepSeek, Groq, Cerebras) and OpenRouter's 300+ models through one endpoint.
Generate embeddings for semantic search or RAG pipelines.

Supported clients

Claude DesktopFull support
Claude CodeFull support