---
symbol: oracle
signature: "(oracle ...)"
package: oracle/core
---

# Oracle — LLM Provider Adapters

The oracle system manages LLM calls via pluggable adapters. Providers register
into a plugin registry and are selected automatically or by explicit model spec.

## Primitives

| Primitive | Signature | Description |
|-----------|-----------|-------------|
| `infer` | `(infer prompt)` | Call the default LLM with a prompt string |
| `with-model` | `(with-model "model" expr)` | Evaluate expr using a specific model |
| `smart-infer` | `(smart-infer prompt models validator)` | Route to best model, validate, escalate |
| `cached-infer` | `(cached-infer prompt)` | LLM call with semantic caching |

## Registered Plugins

| Plugin | Provider | Models |
|--------|----------|--------|
| `anthropic` | Anthropic | claude-sonnet-4-20250514, claude-opus-4-20250514, claude-3-* |
| `openai` | OpenAI | gpt-4o, o1, o3, gpt-4-turbo |
| `ollama` | Ollama (local) | llama3.1, codellama, mistral |
| `piai` | Pi-AI (multi) | Any provider via @mariozechner/pi-ai |

## Model Selection

```lisp
;; Default model
(infer "What is 2+2?")

;; Explicit model
(infer {:model "gpt-4o" :payload "What is 2+2?"})

;; Explicit plugin:model
(infer {:model "anthropic:claude-3-opus" :payload "Deep question"})
```
