Overview
Integration details
| Class | Package | Local | Serializable | JS support | Downloads | Version |
|---|---|---|---|---|---|---|
| Outlines | langchain-community | ✅ | beta | ❌ |
Setup
To access Outlines models you’ll need to have an internet connection to download the model weights from huggingface. Depending on the backend you need to install the required dependencies (see Outlines docs)Credentials
There is no built-in auth mechanism for Outlines.Installation
The LangChain Outlines integration lives in thelangchain-community package and requires the outlines library:
Instantiation
Now we can instantiate our model object and generate chat completions:Invocation
Chaining
Streaming
Outlines supports streaming of tokens:Constrained generation
Outlines allows you to apply various constraints to the generated output:Regex constraint
Type constraints
JSON schema
Grammar constraint
API reference
For detailed documentation of all ChatOutlines features and configurations head to the API reference: python.langchain.com/api_reference/community/chat_models/langchain_community.chat_models.outlines.ChatOutlines.htmlOutlines documentation
dottxt-ai.github.io/outlines/latest/Connect these docs to Claude, VSCode, and more via MCP for real-time answers.