How-To Guides

Connect a model

Choose which AI powers your agents, from Claude to OpenAI to a local model.

Connect a model

A provider is where the AI comes from. NT supports Claude (Anthropic), OpenAI, and any service that works like OpenAI (such as a local model). This guide shows how to set one up.

The built-in providers

Two providers are built in: anthropic (Claude) and openai. You still list the one you use in your config so NT knows your key:

config.nt
config
  providers:
    anthropic:
      api: anthropic
      api_key: env(ANTHROPIC_API_KEY)

Picking a model

An agent's model is written as provider/model-name:

agent age
  model: anthropic/claude-sonnet-5

The part before the slash (anthropic) is the provider. The part after is the model.

Using a local or custom model

If you run a model on your own machine (for example with Ollama), add it as a provider that speaks the OpenAI style, and give it a web address:

config
  providers:
    ollama:
      api: openai-completions
      base_url: http://localhost:11434/v1
      api_key: env(OLLAMA_API_KEY, ollama)

Then point an agent at it:

agent local
  model: ollama/llama3.1

What a provider needs

SettingWhat it does
apiThe style to use: anthropic or openai-completions.
api_keyYour key, read from your environment with env(...).
base_urlThe web address, for local or custom services.

Keeping your key safe

Notice the key is written as env(ANTHROPIC_API_KEY), not the real key. This reads it from your environment instead of saving it in the file.

export ANTHROPIC_API_KEY=sk-ant-...

Never paste a real key into a file

Always use env(NAME). NT will warn you if it spots a real key written directly in a file. The one exception is a dummy placeholder, like Ollama's ollama fallback above, which is not a secret.

Next