Examples
Every inferlet listed in this section is a complete, runnable project under inferlets/ in the repo. Click the name on any sub-page to jump to the source.
Build and run any of them locally:
bakery build inferlets/text-completion -o text-completion.wasm
pie run --path ./text-completion.wasm --manifest inferlets/text-completion/Pie.toml -- --prompt "Write one sentence about Pie."
For a published version: pie run text-completion -- --prompt "Write one sentence about Pie.".
Categories
- Chat and generation. Minimal text generation in Rust, Python, and JavaScript.
- Samplers and probes. Sampler outputs, scoring, watermarking.
- Structured output. Grammar, JSON Schema, and template-driven generation.
- Context and KV cache. Forking, prefix sharing, sliding windows.
- Speculative decoding. Custom drafters.
- Reasoning patterns. Tree, graph, and recursion of thought.
- Agents. ReAct, CodeACT, multi-agent swarms.
- I/O and integration. HTTP, MCP, OpenAI Responses, concurrency tests.
Each sub-page is a small table of inferlets plus a pointer to the Guide section that teaches the underlying primitive.
What you'll see
- Length. Most inferlets are 50–300 lines. Read end-to-end in a few minutes.
- Languages. Rust is the canonical SDK. Python and JavaScript variants exist where the surface differs (constrained decoding, MCP, basic chat).
- Status. Some inferlets are demos, some are microbenchmarks. Each entry's "What it shows" makes the role clear.