Skip to content

Text generation

Generating text autoregressively: feed the context, take the next-token logits, sample (greedy, temperature, or top-k), append, and repeat.

  • @node-llm/core → src/model/gpt.ts — GptModel.generate