Lattice.
Capability runtime SDK for multimodal AI applications.
Describe a job, attach artifacts, declare outputs, set policy constraints. Lattice returns typed outputs, an inspectable execution plan, optional signed receipts, and the provider evidence to understand what happened.

One runtime, a small public API
Add Lattice and zod to your project: a small public API behind one runtime.
$ pnpm add @full-self-browsing/lattice zod$ pnpm add -g @full-self-browsing/lattice-cliInstall the CLI only when you need receipt verification, replay, eval, or diagnostics from a terminal. The full runtime targets Node 24; several facades are validated Node 20 compatible.
What Lattice handles
Every AI flow rebuilds the same machinery. Lattice puts it behind one runtime so you describe intent, not plumbing.
Artifacts
Text, JSON, files, URLs, images, audio, video, documents, and tool results, normalized into one model.
Outputs
Plain text, Standard Schema and Zod-compatible structured data, citations, and generated artifact refs.
Routing
Deterministic provider and model selection from capability metadata, policy, cost, latency, privacy, and fallback.
Context
Artifact refs, summaries, token estimates, and inspectable context-pack plans for every run.
Providers
OpenAI, Anthropic, Gemini, xAI, OpenRouter, LiteLLM, LM Studio, AI SDK style, and fakes for tests.
Audit
JCS canonical receipts, DSSE envelopes, Ed25519 signatures, CIDs, replay envelopes, redaction, and verification.
Tools
Tool definitions and execution, MCP-shaped resources and prompts, tool results as artifacts, call validation.
Agents
Opt-in single-agent loops and structured crew runs, built on the same provider, tool, policy, and receipt primitives.
Describe the job. Get typed outputs.
Attach artifacts, declare the shape of what you want, set policy. Lattice plans, routes, executes, validates, and returns the full run.
- Standard Schema and Zod at the public boundary
- Privacy and cost ceilings enforced per run
- Runs with the fake provider. No API keys needed
import { z } from "zod";
import { artifact, createAI, output } from "@full-self-browsing/lattice";
const ai = createAI({ providers });
const result = await ai.run({
task: "Resolve this support case",
artifacts: [
artifact.text(caseText, { privacy: "sensitive" }),
],
outputs: {
answer: "text",
action: z.object({
kind: z.enum(["refund", "escalate"]),
reason: z.string(),
}),
citations: output.citations(),
},
policy: { maxCostUsd: 2, privacy: "sensitive" },
});
// → result.outputs.action.kind "refund"
// → result.plan.status inspectableAdopt one slice at a time
The full runtime targets Node 24. Several facades are validated Node 20 compatible, so you can adopt Lattice incrementally.
Adapters behind one contract
Run them through the full runtime or use them directly from the provider facade, with native structured output, tool definitions, and streaming.
Anthropic
Gemini
xAIVerifiable receipts, replay-friendly records
When a signer is configured, terminal results include a receipt you can verify offline. Even when another executor performs the model call, Lattice can provide the receipt, replay envelope, and verification.
- JCS canonical form, signed with Ed25519
- DSSE envelopes and content-addressed CIDs
- Redaction and replay built into the record
Execution receipt
verifiedVerify, replay, and eval from a terminal
The CLI package installs the lattice command for receipt verification, offline replay, eval gates, receipt inspection, and local diagnostics.
$ lattice --help
$ lattice verify --help # check receipt signatures
$ lattice repro --help # offline replay of a run
$ lattice eval --help # regression gates
$ lattice receipt --help # inspect a receipt
$ lattice diagnostics lm-studio --helpHow Lattice is built
Put the machinery behind one runtime
TypeScript-first, ESM, MIT-licensed. Published under the @full-self-browsingnpm scope.