CPU-LLM: Evidence-Based AI Engine
Answer questions from your documents and explicit rules, with source evidence and CPU-first execution.
Use it for private credit covenant monitoring, document verification and deterministic financial calculations on premises. A bounded document-and-rule engine. It does not establish that a source is true or make clinical decisions.
See the healthcare sample chat · Inspect the sourceApplication guide · 1.11.2
What can you build with CPU LLM?
Start with the output your reader needs: a sourced answer, a document they can share, or a rule check they can inspect. These workflows require ingested records or explicit inputs.
Manual and policy lookup
Answer a named question from an ingested manual or policy and show the passage behind it. If the attribute is missing, return a nonanswer.
Record and label review
Look up a recorded allergy, ingredient, storage instruction or label strength. The fictional pharmacy examples distinguish reading a record from diagnosing, prescribing or choosing a safe dose.
Evidence and conflict review
Inspect source IDs, quotations and stored spans. Flag recognized attribute conflicts or ask for clarification; arbitrary contradictions in prose are outside the contract.
Reports and articles
Turn permitted records on a named topic into a brief, detailed article or sectioned report. Continue through additional evidence without padding to meet a word count.
Design documentation
Organize documented requirements, interfaces, architecture and validation into a design document. Mark sections missing when the sources do not support them.
Tables, lists and summaries
Present selected evidence as a table, bullets, a numbered list, Markdown or HTML. Use the quotation view when readers need the original wording.
Arithmetic and financial checks
Evaluate supported arithmetic and compare supplied figures with explicit rules. RefundProof, LedgerCovenant and Ledgerlock expose inputs and decision traces; they do not authenticate documents or authorize financial actions.
Historical and scoped retrieval
Inspect eligible records as of a specified time and restrict document selection to sources the caller may access. Continued reports recheck permissions.
Tone and application dialogue
Produce friendlier technical wording from supported predicates while retaining the evidence, or use reviewed replies for greetings and capability questions. Strict reports remain quotation-only.
See a recorded article · Compare a supported lookup with a refusal · Read the implementation guide
Choose the answer contract
- Strict evidence
- Use recognized attribute questions for label or manual lookup. Inspect quoted chunks, spans and hashes; arithmetic follows supplied rules. Unrecognized requests return a nonanswer. Strict mode bypasses learned answer generation.
- Ordinary graph
- For self-hosted document search or a Python RAG application, combine retrieval, planning and selected math or finance producers. Ordinary mode can use optional self-hosted FLAN-T5.
- Conversation and tone
- Explicit prompt tone is separated from topic retrieval. Python style takes precedence; strict mode bypasses tone. Single-fact replies retain companion-only behavior.
From knowledge-base records to a verified article
- Source recordsEncrypted backups + PostgreSQL metadata
- Verified wordingTwo predicates joined; both checked
- Evidence viewOriginal quotes and record IDs retained
Recorded fictional demonstration · cpu-llm 1.11.0
Prompt: Write a detailed article about Helios in a friendly tone.
Helios stores encrypted backups and uses PostgreSQL for metadata. It stores backup files in object storage and verifies backup checksums. It retains backups for 30 days and runs backups every night.
The article also preserves a negative fact: “Helios doesn't support automatic regional failover.”
Inspect the source records and verification receipts
The first three sentences use records rerun-manual-p0002 through rerun-manual-p0007; the failover statement uses rerun-manual-p0011. None supplied friendly wording. All twelve claims passed the bounded inverse grammar in this run.
Read the article, report, JSON and receiptsReports, articles and design documents share section planning, coverage, evidence budgets and continuation. Choose Markdown, HTML, tables, bullets or numbered lists. Missing design sections stay explicit. Unsupported conditionals stay quoted. Strict reports use quotations only.
Ordinary document reply.text can publish new verified sentences. Inspect original quotations and proofs alongside rendered_response.canonical_text. Broader aliases, joins, typed object-category queries, arbitrary prose conflicts and novel designs remain unsupported.
Recorded fictional demo output
Two requests from the same pharmacy evaluation illustrate the boundary. This is recorded output, not a live patient service.
What is the strength of Fictional Luma?
Source quotations (not clinically validated):
[demo-label-luma-p0001] The strength of Fictional Luma is 0.75 mg.
[demo-secondary-luma-p0001] Fictional Luma's strength is 750 mcg.
Status: evidence_quote
Which antibiotic should Case Birch receive?
Unsupported strict request; use explicit named attribute questions.
Status: unsupported
Read all 12 healthcare exchanges · Inspect recorded tone responses
A financial rule with an inspectable result
Divide 9,000,001 by 2,000,000. Under the supplied six-place half-up policy, the stored result exceeds the inclusive ceiling by one millionth:
LedgerCovenant: BREACH. The computed value is 4.500001x and the test is lte 4.500000x.
This checks arithmetic and precedence; it does not authenticate a certificate, establish legal default or authorize payment.
Install and reproduce the examples
python -m pip install --upgrade "cpu-llm==1.11.2"Use Python 3.11 or newer. Configure PostgreSQL with pgvector and cache the external pretrained encoder first. The retrieval projection and demo data ship with the package; optional NLP and decoder assets are separate. Choose new output directories.
python -m pip check
cpu-llm-demo healthcare --out healthcare-demo-new-run
cpu-llm-demo conversation --out conversation-demo-new-run
From ingestion to an API response
In Python, ingest a source with ingest() and query with ask(); the HTTP service exposes POST /v1/ask. The 27 graph nodes include retrieval, source spans, planning and finance. Six retrieval signals—dense, relational, disentangled, hyperbolic, identity and causal—are distinct from output tone. Only dense and identity trained heads are bundled.
Read the full whitepaper · Download PDF (14 pages)
Browse the developer guide by section
- 1 Executive overview
- 2 Suitable workflows and boundaries
- 3 Install and run the packaged examples
- 4 Ingestion and the first Python integration
- 5 Execution paths and the six retrieval channels
- 6 Node reference and request controls
- 7 Strict evidence mode
- 8 Consume results as contracts
- 9 Evidence-backed documents and verified sentence generation
- 10 Financial component example
- 11 HTTP service and authorization
- 12 Python API reference
- 13 Evidence and reproducibility
- 14 Deployment checklist and next steps
- References and implementation authority
Document verification: two execution contracts
A generative RAG application can add citations and calculators. Without an enforced verification step, a generated answer needs separate support checks. CPU-LLM strict mode returns quotations, recognized calculations, conflicts or a nonanswer. A stored hash shows consistency, not source truth. This comparison concerns behavior, not measured accuracy, speed or cost.
Hardening released in 1.11.2
- Ordinary learned-writer fallback requires
CPU_LLM_ALLOW_LEARNED_WRITER=1. Strict mode bypasses it. - Explicit child-safety controls warn that the pipeline applies no gate. The standalone gate is unvalidated.
- HTTP rejects unsupported framing, caps bodies at 1 MiB and sets a 10-second socket inactivity timeout. This is not a total deadline or a TLS gateway.
- Bounded numeric equivalence and explicit mass/volume aliases reduce false conflicts while retaining source quotations. Different dimensions and qualifiers stay distinct.
PyPI published the earlier 1.11.2 candidate. Both distribution hashes match the publication receipt. All 113 wheel Python files and the source archive’s Python sources match the validated implementation. The public wheel differs from the final candidate in METADATA and RECORD: its README retains the historical 1.11.1 test count and two relative badge links. The prepared 1.11.2 default source suite completed in 116.81 seconds: 925 passed, 56 skipped, three existing expected failures and six existing NumPy warnings. A fresh native PostgreSQL database resolved the earlier connection stall. The skips include 54 disabled opt-in integration cases and two missing optional extractor checkpoints. Separately, 72 focused checks passed. The exact prepared wheel installed and passed pip check; all 113 packaged Python files matched source after newline normalization. Both distributions passed strict Twine checks, and the wheel includes the reviewed README metadata and third-party notice. These are engineering checks, not a full-live benchmark or clinical validation. Read the hardening specification or the prepared build validation receipt.
Running the HTTP service
Upgrade if strict calls succeed but ordinary clients disconnect on 1.11.0. The patch keeps SQLite-backed appliances on their serving thread and closes idle keepalive connections after each response. Requests run serially. Embedded Entry factories must construct the appliance on that thread.
Prepare and verify an offline encoder cache · Configure PostgreSQL and pgvector · Read the four-route OpenAPI 3.1 contract
Release evidence · November 3, 2026
For the earlier 1.11.1 release, both published artifacts matched the tested hashes. The source suite recorded 905 passes, 56 skips, three existing expected failures and six existing NumPy warnings. Nineteen service and schema checks passed. The installed patch served the strict call and all three ordinary HTTP clients. The packaged healthcare demo passed 12/12 authored checks on native PostgreSQL 18/pgvector with prepared encoder assets. Compose configuration validated; Docker startup remains unverified. These checks do not measure clinical accuracy or throughput.
The earlier comparison at revision 26a5215 used 16 fictional medication and 16 record cases, scored against authored contracts with ordinary, strict and literal/calculator arms. It did not compare hosted LLMs or clinicians.
Release verification and scope · Historical fixtures and scoring method
Developer questions
Does the patch change HTTP request fields?
No. The authenticated routes and strict-floor precedence are unchanged. Tone belongs in the message text. OpenAPI is checked-in documentation, not a server endpoint.
Is cpu-llm a general-purpose LLM?
It is an Evidence-Based AI Engine for bounded document question answering and rule checks. A pretrained encoder and projection support retrieval.
Can strict mode guarantee accuracy?
No. It quotes recognized source facts, performs bounded checks or declines. A citation identifies stored evidence; it does not authenticate the source.
Can I use it for pharmacy questions?
Evaluate the fictional label and record demos. The package is not validated for diagnosis or prescribing.
Do I need a GPU?
The documented CPU-first strict examples require no GPU. They do require PostgreSQL, pgvector and encoder assets.
Can it run offline?
Yes, after provisioning and caching the required assets. Air-gapped deployment requires prepared Python, database and encoder assets plus operator-enforced network isolation.
Can it give friendlier answers?
Yes. Ask for a friendly article in the prompt. Supported technical predicates can become new, independently verified sentences. Complex records stay quoted; strict reports are quotation-only.
Must I train a model?
No retraining is needed for the packaged demos. You still need to ingest the relevant documents.
Related research: VectorPrism · Python libraries · LedgerCovenant.
Evaluate an enterprise pilot
Bring an explicit covenant policy, an on-premises deployment requirement or a workflow adapter to evaluate with Insight IT Solutions. Code is Apache-2.0; bundled WikiText-2 data has separate CC BY-SA 3.0/GFDL terms.
Discuss a commercial pilot