# Providers

> How Lobu separates inference providers, models, credentials, and sandbox environments.

export const providerConfigEntries = (providersConfig.providers || []).map(
  (provider) => ({ id: provider.id, providers: provider.providers })
);

Lobu separates **inference** from **execution**.

- An inference provider supplies models.
- An environment selects where commands run.
- A runtime provider implements that sandbox backend.
- Credentials stay gateway-side.

See [Concepts and architecture](/getting-started/architecture/) for the complete agent model.

## Provider terms

| Term | Meaning |
| --- | --- |
| Provider catalog entry | Built-in metadata from `config/providers.json` |
| Inference provider | A configured credential, optionally with organization-specific upstreams and defaults |
| Model | The text, image, speech, or embedding model selected for a run |
| Auth profile | A reusable OAuth, device-code, or API-key credential |
| Environment | A named execution target selected by an agent |
| Runtime provider | The implementation behind a remote sandbox environment |

Inference and sandbox compute are independent layers.

## Model selection

The text model resolves in this order:

1. automation or run override
2. agent default model
3. organization default inference provider

This lets one agent use a cheap model for routine watches and a stronger model for a sensitive workflow without changing its identity or environment.

## Organization-defined inference

An organization-defined provider has a stable slug, a provider kind, one gateway-held credential, and optional per-modality configuration.

Supported modality blocks are:

- `text`
- `image`
- `stt`
- `tts`
- `embedding`

Each block may define its own base URL, model, and model-discovery endpoint.

## Credentials

Credential sources include API keys, OAuth, device-code authentication, declared project secrets, user-scoped auth profiles, and organization-owned provider credentials.

The gateway resolves the selected credential. Workers and remote sandboxes receive scoped access or placeholders rather than durable raw secrets.

## Inference is not the sandbox

An agent also selects an environment:

| Environment | Execution |
| --- | --- |
| Builtin | Local embedded runtime |
| Device | An authorized user device |
| Provider-backed | A named organization or private remote sandbox |

A runtime provider handles sandbox creation, workspace mapping, network policy, and command execution. The same agent can use an Anthropic model while executing in a Vercel-backed environment, or use an organization-defined OpenAI-compatible endpoint while running on a device.

## Configure an agent

```ts
const support = defineAgent({
  id: "support",
  providers: [
    {
      id: "openrouter",
      model: "anthropic/claude-sonnet-4",
      key: secret("OPENROUTER_API_KEY"),
    },
  ],
  // environment selection is separate
});
```

Use the [`lobu.config.ts` reference](/reference/lobu-config/) for the exact schema. Organization-defined providers and environments can also be managed through the UI and API.

## Built-in provider registry


## Source of truth

- Local file: `config/providers.json`
- GitHub source: [config/providers.json](https://github.com/lobu-ai/lobu/blob/main/config/providers.json)

<details>
  <summary>View provider entries</summary>
  <pre>
    <code>{JSON.stringify(providerConfigEntries, null, 2)}</code>
  </pre>
</details>

## Read next

- [Agent workspace](/guides/agent-prompts/)
- [Skills](/getting-started/skills/)
- [Guardrails](/guides/guardrails/)
- [Evaluations](/guides/evaluate-agents/)
- [`lobu.config.ts` reference](/reference/lobu-config/)
