API Reference

This page contains the API reference for public objects and functions in Guidance.

functions

guidance.gen([name, max_tokens, ...])

Generate a set of tokens until a given stop criteria has been met.

guidance.select(options[, name, ...])

context blocks

guidance.instruction([text])

guidance.system([text])

guidance.user([text])

guidance.assistant([text])

models

guidance.models.Model(engine[, echo])

The base guidance model object, which represents a model in a given state.

guidance.models.Instruct(engine[, echo])

The base class for all instruction-tuned models.

guidance.models.Chat(engine[, echo])

The base class for all chat-tuned models.

guidance.models.LlamaCpp([model, echo, ...])

guidance.models.Transformers([model, ...])

guidance.models.VertexAI(model[, tokenizer, ...])

guidance.models.GoogleAI(model[, tokenizer, ...])

guidance.models.OpenAI(model[, tokenizer, ...])

guidance.models.LiteLLM(model[, tokenizer, ...])

guidance.models.Cohere(model[, tokenizer, ...])

guidance.models.Anthropic(model[, ...])

Represents an Anthropic model as exposed through their remote API.