Overview
Integration details
| Class | Package | Local | Serializable | JS support | Downloads | Version |
|---|---|---|---|---|---|---|
| ChatOutlines | langchain-community | ✅ | ❌ | ❌ |
Model features
| Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
|---|---|---|---|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |
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
Streaming
ChatOutlines supports streaming of tokens:Chaining
Constrained Generation
ChatOutlines allows you to apply various constraints to the generated output:Regex Constraint
Type Constraints
Pydantic and JSON Schemas
Context Free Grammars
LangChain’s Structured Output
You can also use LangChain’s Structured Output with ChatOutlines: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.htmlFull Outlines Documentation
dottxt-ai.github.io/outlines/latest/Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.