Skip to content

Add OpenRouter support (--tool openrouter)#132

Open
valentt wants to merge 1 commit intosnarktank:mainfrom
valentt:feature/openrouter-support
Open

Add OpenRouter support (--tool openrouter)#132
valentt wants to merge 1 commit intosnarktank:mainfrom
valentt:feature/openrouter-support

Conversation

@valentt
Copy link
Copy Markdown

@valentt valentt commented Mar 29, 2026

Summary

Adds OpenRouter as a third tool option alongside amp and claude. This enables running Ralph with cloud LLMs via the OpenRouter API — no local AI coding tools required.

Usage

# Set your API key
export OPENROUTER_API_KEY=sk-or-...

# Run with default free model (nemotron)
./ralph.sh --tool openrouter 10

# Or specify a model
OPENROUTER_MODEL=qwen/qwen3-235b-a22b:free ./ralph.sh --tool openrouter 5

Changes

  • ralph.sh: Added openrouter as valid --tool option with model selection via OPENROUTER_MODEL env var
  • openrouter_call.py: Lightweight OpenRouter API caller using only stdlib (urllib), no dependencies needed

Why

Not everyone has Amp or Claude Code installed. OpenRouter provides access to powerful free models (Nemotron, Qwen, Llama) via a simple API key, making Ralph accessible to more developers.

Adds OpenRouter as a third tool option alongside amp and claude.
This enables running Ralph with cloud LLMs via OpenRouter API,
no local AI tools needed.

Usage:
  OPENROUTER_API_KEY=sk-... ./ralph.sh --tool openrouter 10
  OPENROUTER_MODEL=qwen/qwen3-235b-a22b:free ./ralph.sh --tool openrouter

New files:
- openrouter_call.py: OpenRouter API caller (reads prompt.md, calls API)

Supports any OpenRouter model including free tier models like
nvidia/llama-3.1-nemotron-ultra-253b:free.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant