Skip to main content

Chat and generation

The starting point. Each of these is a small inferlet that loads a model, builds a chat prompt, and streams a reply.

InferletWhat it shows
helloworldMinimal #[inferlet::main] with typed JSON input/output.
text-completionChat-style generation via Context::system / user / cue, the per-step Generator, and chat::Decoder.
text-completion-specSame shape, but exercises the speculative-decoding path (Speculation::Default → backend NGRAM).
python-exampleText completion in Python.
js-exampleText completion in JavaScript.