fabro/lib
Scott Werner af99acc811 feat(llm): add dedicated OpenRouter adapter on the openai_chat module
Introduces AdapterKind::OpenRouter and a new providers/openrouter.rs
adapter that sits on top of the shared openai_chat module via ChatHooks:

- mutate_request: translates the typed Request.reasoning_effort field
  into OpenRouter's {reasoning: {effort: ...}} JSON shape, unless the
  caller has already set a reasoning value explicitly via
  provider_options.openrouter.
- enrich_response: pulls OpenRouter's inline usage.cost into
  Response.cost_usd with CostSource::Authoritative, overriding any
  catalog-estimated value.

The catalog's adapter_defaults table now recognizes OpenRouter (it
shares the OpenAI billing policy and agent profile at the wire level)
and the existing builtin_openrouter_provider_is_opt_in test is updated
to assert AdapterKind::OpenRouter. A new family-allowlist test asserts
the per-vendor family rename that lands in the next commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 17:05:08 -04:00
..
crates feat(llm): add dedicated OpenRouter adapter on the openai_chat module 2026-05-28 17:05:08 -04:00
packages/fabro-api-client feat(llm): add Response.cost_usd and CostSource across all adapters 2026-05-28 17:05:08 -04:00