Skip to main content

MCP server that routes mechanical dev tasks to a local LLM

Project description

pedalpoint

Route mechanical development tasks to a local LLM (Ollama, LM Studio, Jan) via Claude Code. Automatically falls back to local-only mode when Claude quota is exhausted.

What it does

  • Hybrid routing: Claude classifies each task. Mechanical work (scaffolding, CRUD, test stubs) goes to your local LLM. Judgment work (architecture, debugging, integration) stays with Claude.
  • Three-tier quota fallback: When Claude Pro returns a quota error, pedalpoint first routes judgment and structural tasks to Claude API (pay-per-token) while mechanical tasks continue on local LLM. If the API key is absent or Claude API quota is also exhausted, all tasks fall back to local LLM. Restores to normal when quota recovers.
  • Context Courier: Before sending any task to the local LLM, pedalpoint greps your codebase for existing patterns and injects them into the prompt. Local LLMs only get tasks they have templates for.
  • Single install: One script installs the MCP server, pulls the default model, and registers the companion skill.

Requirements

  • Claude Code
  • Python 3.11+
  • Ollama (or any OpenAI-compatible inference server)

Install

curl -fsSL https://raw.githubusercontent.com/EMSwank/pedalpoint/main/install.sh | sh

With a custom model or endpoint:

curl -fsSL https://raw.githubusercontent.com/EMSwank/pedalpoint/main/install.sh | \
  sh -s -- --model llama3 --base-url http://localhost:11434/v1

Restart Claude Code after install.

Note: If installing without the script, use uv tool install pedalpoint — not pip install -e .. The tool install puts pedalpoint-server in PATH where Claude Code can find it.

Usage

Ollama must be running before you open Claude Code:

ollama serve          # or open Ollama.app on macOS

Then in any Claude Code session:

/route-tasks

pedalpoint handles routing automatically. No manual flagging needed.

To verify the MCP server connected:

claude mcp get pedalpoint

Should show Status: ✓ Connected. If disconnected, run pedalpoint-server directly to see the error.

Modes

Mode Set via Behavior
hybrid default Claude classifies each task into mechanical (local LLM direct), structural (local LLM draft + Agent review), or judgment (Agent only)
local-only PEDALPOINT_MODE=local-only All tasks → local LLM (use when quota exhausted preemptively)
passthrough PEDALPOINT_MODE=passthrough All tasks → Claude Agent (disables pedalpoint)

Configuration

Variable Default Description
PEDALPOINT_BASE_URL http://localhost:11434/v1 OpenAI-compatible endpoint
PEDALPOINT_MODEL gemma4:e4b Default local model
PEDALPOINT_MODE hybrid Routing mode
PEDALPOINT_TIMEOUT 120 Read timeout in seconds
PEDALPOINT_INITIAL_FALLBACK_MINUTES 60 Initial circuit-open duration (doubles on each probe failure)
PEDALPOINT_API_MODEL claude-sonnet-4-6 Claude model used for API fallback
ANTHROPIC_API_KEY (unset) Anthropic API key for Claude API fallback tier. Optional — if unset, circuit skips api_fallback and goes directly to open.

Uninstall

curl -fsSL https://raw.githubusercontent.com/EMSwank/pedalpoint/main/install.sh | sh -s -- --uninstall

Troubleshooting

Symptom Fix
local_llm calls fail with "Ollama not reachable" ollama serve (or open Ollama.app on macOS)
local_llm fails with "Model gemma4:e4b not found" ollama pull gemma4:e4b
/route-tasks says local_llm tool not available claude mcp get pedalpoint (check status; if missing, re-run install)
claude_api returns "ANTHROPIC_API_KEY not set" — api_fallback tier disabled export ANTHROPIC_API_KEY=sk-ant-... then restart Claude Code
All tasks route to local LLM even after Claude quota resets echo '{"circuit":"closed"}' > ~/.pedalpoint/state.json

Development

git clone https://github.com/EMSwank/pedalpoint
cd pedalpoint
uv sync --extra dev   # or: pip install -e ".[dev]"
pytest tests/unit/ -v

Integration tests (requires Ollama running):

PEDALPOINT_INTEGRATION=true pytest tests/integration/ -v

Install script tests (requires bats-core):

brew install bats-core   # macOS; use apt-get install bats on Linux
bats tests/install/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pedalpoint-0.2.0.tar.gz (62.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pedalpoint-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file pedalpoint-0.2.0.tar.gz.

File metadata

  • Download URL: pedalpoint-0.2.0.tar.gz
  • Upload date:
  • Size: 62.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pedalpoint-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d881618364e8d5a949354763d2fb28d512417fa0da61ea3ecd7ceba6cdf4083c
MD5 201f75508528aad70e44c3ab5915c4a6
BLAKE2b-256 acb89bfa503f761f4158269d743a8498ea1eb7152f15202af5427b94926250ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pedalpoint-0.2.0.tar.gz:

Publisher: release.yml on EMSwank/pedalpoint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pedalpoint-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pedalpoint-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pedalpoint-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5956f18ac973785c1b3aa16df543a8be6b64a1e6f38ca74cfaf3b112a656846
MD5 bac4b539746ec4985f59092c4ac624fe
BLAKE2b-256 94ae2f5d697f3974e6b6e4b3f97f1885133a395c5409b4c93a37262c0bb08de5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pedalpoint-0.2.0-py3-none-any.whl:

Publisher: release.yml on EMSwank/pedalpoint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page