cordance-llm
Bounded candidate-prose adapters for local LLM endpoints (Ollama, …). Every claim must cite a source-ID from the input pack. Hard rules cannot originate here.
Part of the Cordance workspace.
Discoverability
Search terms: Cordance LLM, Ollama adapter, grounded candidate prose, LLM source citations, AI agent summaries, no LLM authority, local model adapter.
What it does
ADR 0002 of Cordance forbids LLM-laundered authority. This crate enforces that at the adapter level:
- Local-only by default. The Ollama adapter rejects non-loopback URLs
unless
CORDANCE_ALLOW_REMOTE_LLM=1is set in the operator's environment. - Schema-bounded responses. Outputs deserialise into a fixed
LlmCandidateshape; arbitrary text never escapes the adapter. - 4-gram source grounding. Every claim's text is split into 4-grams and must match a 4-gram in one of its cited source bodies; ungrounded claims are rejected before the candidate leaves the adapter.
- Hard rules are filtered out. Claims tagged
hard_ruleorproject_invariantare dropped regardless of grounding — those classes can only come from doctrine, ADRs, or schemas.
LLM output is never authority. It is candidate_only evidence that the
operator can review and discard.
Install
[]
= "0.1"
Quick start
use ;
use HashMap;
;
let adapter = from_config;
if !adapter.is_available
let prompt = "Summarise this project's main purpose in one paragraph as a candidate observation.";
let cited_ids = vec!;
let source_bodies: = new; // populate with the cited source contents
let candidate = adapter.generate_with_grounding
.expect;
println!;
See also
- Cordance project README
- ADR 0002 — the authority boundary this crate enforces.
cordance-cli—cordance pack --llm ollamawires this crate behind a feature flag.
License
Dual-licensed under MIT OR Apache-2.0.