Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 75
  • 3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-tuning

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install openrouter-performance-tuning in Claude Code

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 →

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.

openrouter-performance-tuning Install

Add to stack

Loading.