Measure your inference calls
See how your inference calls behave before choosing what to change. Run them through a local benchmark to inspect response timing, usage and failure signals.
-
With Node.js 22 or newer installed, start the local benchmark with the first command. Leave it running and run the second command in another terminal. Use the OpenRouter connection example in the next step.
Read the benchmark quickstartnpx inferock-bench npx inferock-bench init -
Save your OpenRouter API key with the setup command, then restart the benchmark to load it. Use the local bench key printed by the next command as your app's API key, and the local base URL shown below to route calls to pinned OpenRouter endpoints through the benchmark. See docs/integrations/openrouter.md in the benchmark repository for the current pinned set.
npx inferock-bench setup openrouter npx inferock-bench key revealimport OpenAI from "openai"; const openrouter = new OpenAI({ apiKey: process.env.INFEROCK_BENCH_KEY ?? "ibl_your_local_bench_key", baseURL: "http://127.0.0.1:4318/openrouter/v1", }); await openrouter.chat.completions.create({ model: "meta-llama/llama-4-maverick", messages: [{ role: "user", content: "Draft a five-bullet checklist for reviewing an AI invoice." }], }); -
The Hugging Face router is compatible by wire shape, not measured live. Save your Hugging Face API key locally with the setup command below, then restart the benchmark to load it. Or set INFEROCK_BENCH_HUGGINGFACE_API_KEY; HF_TOKEN is not read. This path is excluded from the default coverage test.
npx inferock-bench setup huggingface -
After routing calls through the benchmark, run this command in another terminal to read the result. Review any failure signals alongside the timing and usage for those calls.
npx inferock-bench receipt --compact
What the result shows
The result summarizes timing, reported usage and failure signals for calls that passed through your local benchmark. It separates observed events from estimates and shows which checks were exercised. It describes that run; calls outside the benchmark are not measured.