openrouter-advisor-pattern

Delegate ambiguous decisions from a cheap primary model to a senior advisor model via OpenRouter.

10|2|Updated May 6, 2026
One-click install
npx skills add https://github.com/jcrabapple/hermes-skills --skill openrouter-advisor-pattern-jcrabapple
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: openrouter-advisor-pattern
Source: https://github.com/jcrabapple/hermes-skills/tree/main/openrouter-advisor-pattern
Command: npx skills add https://github.com/jcrabapple/hermes-skills --skill openrouter-advisor-pattern-jcrabapple

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Running large-context analysis tasks like log audits or content moderation entirely on expensive senior models is costly, while cheap models alone make poor judgments on ambiguous cases. This Skill implements the OpenRouter Advisor pattern so a fast primary model processes bulk context and escalates only borderline decisions to a senior model mid-inference. ## Core Features & Use Cases - Mid-Inference Delegation: Configure the openrouter:advisor tool so a primary model (e.g. deepseek-v4-flash) consults a senior advisor (e.g. claude-opus) for targeted judgments within a single API call. - Robust Response Parsing: Handle NDJSON and chunked streamed responses with fallback line-by-line JSON parsing, retry logic, and debug dumps for truncated bodies. - Cost Tracking & Routing: Log advisor call costs to a spend JSONL file and control provider routing with order, sort, latency, throughput, and price parameters. - Use Case: Audit 80K characters of application logs at Flash-tier prices, escalating only ambiguous error classifications to Opus, cutting costs by over 95% while keeping senior-model accuracy on hard cases. ## Quick Start Use the OpenRouter advisor pattern to analyze these logs with a cheap primary model and escalate ambiguous error classifications to a senior advisor model.

Frequently Asked Questions about openrouter-advisor-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use the OpenRouter advisor tool in a chat completion request?▼

Add a tool of type openrouter:advisor to the tools array with parameters specifying the advisor model, instructions, and forward_transcript flag. The primary model invokes it mid-inference when it encounters ambiguous cases, and OpenRouter handles the delegation in a single API call.

How to reduce LLM costs for large log analysis tasks?▼

Process bulk context with a cheap primary model like deepseek-v4-flash and delegate only ambiguous judgments to a senior model via the advisor tool. This keeps 95% or more of tokens at Flash prices while senior models handle few-token decisions.

Why does OpenRouter return NDJSON instead of a single JSON response?▼

Advisor calls can emit chunked or line-delimited JSON even without stream:true when the server tool produces intermediate streams. Parse by scanning lines in reverse for an object containing choices or usage, and retry once for genuinely truncated bodies.

Can I control which provider serves my OpenRouter model request?▼

Yes, use the provider object with parameters like order, allow_fallbacks, sort, max_price, only, and ignore. A strict pin sets order to one provider with allow_fallbacks false, while a preferred pin lists fallbacks in priority sequence.

How do I track OpenRouter advisor costs outside a Hermes session?▼

Log each call's cost, model, and token counts as a JSON entry appended to ~/.hermes/spend/fusion_costs.jsonl. The spend dashboard reads this file so pre-run script usage appears in daily spend totals.

When should I use bounded parallel review instead of the advisor tool?▼

Use bounded parallel review for offline, batched second opinions on multi-file code changes where mid-inference delegation does not fit. Split content into slices under roughly 15K characters and fire them as parallel background API calls.