Skip to content
Open
Prev Previous commit
Next Next commit
Update docs
  • Loading branch information
plpxsk authored and RobinPicard committed Mar 26, 2026
commit 2bb60dec76f8f1b823cf25cb6f6a4d8fb1da9b83
24 changes: 12 additions & 12 deletions docs/features/core/exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ title: Error Handling

# Error Handling

Outlines maps provider SDK exceptions (Mistral, OpenAI, etc) to a common typed hierarchy under `OutlinesError` so you can catch specific error types without inspecting raw SDK exceptions.
Native runtime exceptions are preserved for the following in-process local
runtimes:

* `LlamaCpp`
* `MLXLM`
* `transformers`
* `LMStudio`

But for the remaining **API-backed integrations** (Mistral, OpenAI, Ollama,
etc), Outlines provides a common exception hierarchy under `OutlinesError`, as
follows.

## Exception hierarchy

Expand Down Expand Up @@ -42,17 +52,7 @@ OutlinesError

## Usage

!!! note

The exception normalization in this page happens inside Outlines model wrappers
(for example, `outlines.models.mistral.Mistral` and
`outlines.models.openai.OpenAI`), which call
`normalize_provider_exception(...)` before re-raising.
If you call a provider SDK client directly, you should expect provider-native
exceptions.
Local in-process runtimes (`Transformers`, `MLXLM`, and `VLLMOffline`) do not
wrap exceptions into `APIError`, but intentionally **propagate native runtime
exceptions**.
Normalized `APIError` subclasses are raised by Outlines model wrappers; if you call a provider SDK directly, you should expect provider-native exceptions instead.

```python
from outlines.exceptions import (
Expand Down