openrouter-performance-tuning
Installation
SKILL.md
OpenRouter Performance Tuning
Overview
OpenRouter adds minimal overhead (~50-100ms) to direct provider calls. Most latency comes from the upstream model. Key levers: model selection (smaller = faster), streaming (lower TTFT), parallel requests, prompt size reduction, and provider routing to faster infrastructure. This skill covers benchmarking, streaming optimization, concurrent processing, and connection tuning.
Prerequisites
- An OpenRouter API key (
sk-or-v1-...) exported asOPENROUTER_API_KEY— see theopenrouter-install-authskill for setup - Python 3.8+ with the OpenAI SDK (
openaipackage) — the examples use both the syncOpenAIclient andAsyncOpenAIfor parallel processing - Credits on the key if you benchmark paid models like
anthropic/claude-3.5-sonnet; a:freemodel is enough to validate the benchmark harness itself HTTP-Referer/X-Titleheader values for your app (set in every client constructor here)