openrouter-performance-tuning
Skill by jeremylongshore
Optimizes OpenRouter request latency and throughput. It covers model benchmarking, streaming for lower time-to-first-token, and concurrent requests. Aimed at developers building real-time apps on OpenRouter.
Install openrouter-performance-tuning
Built from the published package, never by AI.
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/openrouter-performance-tuning ~/.claude/skills/openrouter-performance-tuningRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install openrouter-performance-tuning in Claude Code
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/openrouter-performance-tuning ~/.gemini/antigravity-cli/skills/openrouter-performance-tuningAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install openrouter-performance-tuning in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill is a guide with Python code for tuning OpenRouter performance. It explains that OpenRouter adds about 50-100ms of overhead to direct provider calls, and that most latency comes from the upstream model. The examples cover measuring p50 and p95 latency per model, streaming responses to reduce time-to-first-token, and processing many prompts concurrently with an asyncio semaphore.
It also includes a model speed tier table, a connection reuse pattern, and a checklist of levers such as max_tokens, smaller models, :nitro variants, and provider routing. The skill is for developers building real-time applications, reducing TTFT, or scaling request volume through OpenRouter.
Written from the project's SKILL.md and checked against it.
What it can do
- benchmark_model()Measures latency over N requests and reports p50, p95, average, min and max.
- stream_completion()Streams a response and reports time-to-first-token and total time.
- parallel_completions()Runs multiple prompts concurrently, capped by an asyncio semaphore.
- Connection optimizationShows how to reuse one shared client with timeout and retry settings.
- Performance optimization checklistLists levers such as streaming, max_tokens, :nitro variants and provider routing.
- Model speed tiersGives typical TTFT ranges for fastest, fast, standard and slow model groups.
What you need
- OpenRouter API key exported as OPENROUTER_API_KEY
- Python 3.8 or later
- The openai Python package
- Credits on the key for paid models
Try asking
- Benchmark gpt-4o-mini against claude-3-haiku and report p50 and p95.
- Stream a chat reply and show me the time to first token.
- Summarize these 20 documents in parallel with a concurrency limit of 5.
Good to know
- Speed figures in the source are typical ranges, not guarantees.
- Reasoning models such as openai/o1 can take 5-30 seconds.
- Examples are written in Python with the OpenAI SDK.
Security check
B- Allowed to use Write, Edit without limitsIn
SKILL.md
Checked automatically: skills/.curated/openrouter-performance-tuning/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: ReadWriteEditGrepBash(python3:*)
Alternatives to openrouter-performance-tuning
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
openrouter-performance-tuning: common questions
How much latency does OpenRouter add?
The source says OpenRouter adds minimal overhead, about 50-100ms, to direct provider calls. Most latency comes from the upstream model.
Can I test the benchmark code without paying?
Yes. The source says a :free model is enough to validate the benchmark harness itself.
What is the fastest way to cut perceived latency?
The source recommends streaming for user-facing requests, which it says can drop TTFT by 2-10x.
How do I install openrouter-performance-tuning?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is openrouter-performance-tuning free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is openrouter-performance-tuning safe to use?
It scores 75 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.
What are alternatives to openrouter-performance-tuning?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
