Skip to main content

Overview

Outlines provides structured generation and control for models run locally or via SGLang, using the Outlines library. There is no API key or base URL; you build an OutlinesModel from a concrete backend (Transformers, LlamaCpp, MLXLM, SGLang, or vLLM offline). Tool calls are not supported; JSON schema and JSON object output are supported. Model Class: OutlinesModel

Authentication

No API key or environment variables are required. For SGLang, configure base_url and optional api_key in OutlinesModel.from_sglang().

Examples

From Transformers (local):
From SGLang (remote server):

Model Settings

You can set model parameters on the model or on the Agent. Supported parameters depend on the backend (Transformers, LlamaCpp, SGLang, vLLMOffline). On the model:
On the Agent:

Parameters

Supported settings vary by backend. Base options: