Harn providers
Use this skill when wiring or debugging LLM providers, model routes, structured
output, connector providers, or provider readiness.
Pair it with [[harn-orchestration]] for workflow behavior and [[harn-testing]] for deterministic provider fixtures.
Start here
docs/llm/harn-quickref.mddocumentsllm_callandllm_stream_call.- The quickref also covers
provider: "auto", schemas, and retries. docs/llm/harn-triggers-quickref.mddocuments connector provider manifests.- LLM configuration and routing live under
crates/harn-vm/src/. - Package resolution lives under
crates/harn-package/src/package/. - Provider manifest contracts live under
crates/harn-vm/src/connectors/manifest/. - Provider capability rows are surfaced by CLI matrix commands.
- Mock providers are the default for deterministic tests.
- Never require live credentials in ordinary CI.
`llm_call` options
- Keep
providerexplicit when behavior depends on a vendor. - Use
provider: "auto"only when capability-based routing is acceptable. - Keep
modeloptional only when routing policy can choose safely. - Express structured output through
output:"json", a schema, or
{schema, strict?, validation?, stream_abort?}.
- Preserve
schema_retriesandrepairbehavior. - Compose system text with the single
systemstring-or-fragment-list option. - Use
effortandspeedfor provider-neutral intent. - Use
timeout_msandidle_timeout_ms; both are milliseconds. - Put wire-specific fields below
provider_options.<provider>. - Treat portable generation options as required caller intent. An authored
capability denial is a terminal invalid_request; adapters must not drop it.
- Unknown custom generation routes remain open-world. Explicit
cache: true
and prompt_cache_ttl require authored support because cache lowering is
provider-specific; TTL values must be listed in prompt_cache_ttls.
- Let
cache_breakpoint_stylechoose the request marker location. Provider
adapters must use the canonical lowering and preserve explicit caller markers.
- Keep provider tool execution distinct with
provider_tools. - Preserve tool-call format negotiation and cost controls.
- Preserve mock-provider determinism.
Capability routing
- Model capabilities should be data-driven.
- Avoid hardcoding provider quirks in caller code.
- Read provider identity,
classification(localorhosted), and nested
auth from harness.llm.provider_catalog().providers. These are projections
of the authoritative catalog artifact; do not infer them from provider names.
- Resolve
message_wire_formatandlive_endpoint_familyas one dialect for
request, stream, response, and error handling. Do not choose a builder or
parser independently from provider strings or response headers.
- Put route-specific reasoning behavior in capability rows and resolve it with
harness.llm.apply_reasoning_policy; do not branch on model IDs, providers,
families, or lineages in stdlib policy.
- Put reusable ordered routes in catalog
[model_ladders.<name>]rows. Use
ladder: "<name>" for calls and harness.llm.model_ladder(name) when policy
or tooling needs to inspect the steps.
- Capability checks should describe both positive and negative support.
- JSON schema support is not the same as native JSON support.
- Keep capability-field names such as
reasoning_effort_supporteddistinct
from the public call option effort; capability data may describe a wire
mechanic that callers never spell directly.
- Keep provider continuation metadata private and byte-exact. The capability
field reasoning_round_trip defaults to strip; use echo_signed only for
signed blocks and echo_same_key only with a typed history wire field.
- Vision, PDF, audio, tools, cache, and streaming support vary independently.
- Prompt scaffolding may differ by provider.
- Tool prompting may differ by provider.
- Assistant prefill support may differ by provider.
- Developer-role support may differ by provider.
- When routing changes, update the matrix tests or docs that expose it.
- Check every routed attempt after its link-specific model and option overrides
resolve; admission belongs before rate limiting and provider transport.
Connector providers
- Connector packages should declare provider ids.
- Connector packages should declare supported event kinds.
- Connector packages should declare payload schemas.
- Inbound normalization should be deterministic.
- Optional polling should be explicit.
- Connector
callbehavior should be capability-gated. - Keep OAuth and secret handling out of docs and fixtures.
- Do not embed tokens in package manifests.
- Use package validation tests for manifest shape.
- Use trigger quickref examples for user-facing behavior.
Cost and reliability
- Cost ceilings should be caller-visible.
- Retry behavior should be bounded.
- Provider fallback should be explicit and auditable.
- Do not silently change the chosen provider after a partial tool exchange.
- Record enough provider metadata for debugging.
- Avoid logging secrets or raw private prompts in public traces.
- Keep failure messages actionable.
- Map provider failures to stable diagnostics where possible.
- Preserve transcript shape when provider calls are replayed.
- Use [[harn-tracing]] for transcript and receipt implications.
Review checklist
- Does this change affect
provider: "auto"? - Does this change structured-output behavior?
- Does this affect streaming?
- Does this affect tool calls?
- Does this affect provider catalogs?
- Does this affect connector manifests?
- Does this affect offline behavior?
- Does this require docs or CLI help updates?
- Does this need conformance or mock-provider fixtures?
- Does this remain deterministic without network access?
Catalog and matrix commands
- Update pinned model facts:
harn provider catalog update-source --live, or
--input <response.json> for a downloaded Models.dev v2.0 response.
- Keep imported facts in source-only
models_devbindings; don't also author
their values locally. Generation reads the committed cache without network.
- Keep unsupported conditional pricing, provider mechanics, defaults, and
measured tool behavior in Harn. Upstream tool flags aren't live-loop proof.
- Refresh provider observations with fixtures:
harn provider catalog refresh --check. - Refresh provider observations live:
harn provider catalog refresh --live --json. - Regenerate catalog artifacts:
harn provider catalog generate. - Validate catalog artifacts:
harn provider catalog generate --check. - Regenerate capability matrix docs:
harn provider catalog matrix. - Validate capability matrix docs:
harn provider catalog matrix --check.
Maintain the live catalog
- Run the exact-source Harn CLI with authorized provider keys in its process
environment. Never put key values in arguments, source, reports, or a remote
file. Read the JSON coverage summary from refresh --live --json and the
full .harn-runs/provider_catalog/refresh.json evidence. A partial run
names skipped, empty, and failed adapters; zero observations is unmeasured, not a
clean catalog.
- Review the typed drift and source provenance. A model-index omission is a
retirement lead, not proof of deprecation. Verify identity and successor
against first-party release notes or the provider's current rate card.
Use provider list prices for the actual route; do not copy an aggregator's
floating cheapest-host price into a direct-provider row.
For a trusted release or pricing notice, run
harn run scripts/provider_catalog_notice.harn -- --notice <json> --provider <inference-provider> --model <inference-model>
with a configured own-key route. Harn's schema-constrained model extraction
produces a reviewable receipt and refuses ambiguous identities. A new model
becomes an incomplete proposal, with the original extraction in the receipt.
Each run extracts one change; split multi-change announcements into focused
notice records and track every residual fact.
Keep --apply off until the candidate is independently verified.
- For each new chat route with available credentials, run
harn provider tool-probe <provider> --model <id> --tool-format native --mode non-streaming --json true
and save its JSON report. Validate it with
harn provider tool-scorecard --tool-probe-report <report> --json.
Require live provider-adapter provenance and native_tool_probe in the exact
route's passed_probes before advertising native tools; saved responses,
legacy reports, and explicit --base-url overrides cannot certify that route.
Pass the report to the notice workflow with --tool-probe-report <report>;
missing or mismatched evidence leaves an incomplete proposal. Record
usage.cost_usd and keep an inaccessible route
explicitly unverified instead of treating an aggregator mirror as proof of
its direct adapter.
- Change the owning catalog fragments. Record
deprecatedand
superseded_by, preserve aliases, and move defaults off deprecated rows.
Pin curated support recommendations before generating projections. Check
downstream Burin overlays after the next Harn repin; Burin supplies its
credentials and product-specific aliases, while Harn owns route semantics.
- Regenerate the catalog, matrix, and support projections, run their checks
and the repository audit gate, then open a reviewable PR. Put measured
coverage, probe costs, skipped adapters, and unverified claims in its
summary. Never treat a file's existence or a green inventory count as proof
that a route served a tool call.
Verify
- Provider config: targeted
make test-onechecks inharn-vm. - LLM behavior: targeted VM provider tests.
- Provider matrix:
harn provider catalog matrix --check. - Connector manifests: package validation tests.
- Connector package:
harn package verify . --provider <id>. - Mock-provider fixtures: targeted conformance or CLI tests.
- JSON surfaces:
harn --json-schemas --command <command>. - Docs snippets:
make check-docs-snippetswhen examples change. - Broad VM changes:
make test ARGS='-p harn-vm'. - Cross-crate provider changes:
make test.