In this section · 6 articles

How AI Manager works

AI Manager is the one place your Laramin talks to AI providers. Add-ons ask it for work, and it picks a provider and model, retries and falls back when one fails, and records what every call cost.

Applies to
AI Manager 2.2 and later
Who can do this
Platform owner, Administrator
On this page

In short

AI Manager connects your Laramin to AI providers such as OpenAI, Google Gemini and Anthropic. You give it an API key for each provider you use, and it keeps a list of each provider's models and prices.

AI Manager doesn't do anything with AI on its own. Other add-ons use it. Today that's Question Bank, which uses AI to read question papers, analyze questions and write explanations. See Import questions from an exam paper. An add-on never names a provider or a model. It asks for a kind of work at a level of difficulty, and AI Manager decides which provider and model answer, tries again when a call fails, and records what each call cost.

How it works

The parts

PartWhat it isWhere you manage it
ProviderAn AI company's service, with your API key for it. AI Manager can talk to seven: Google Gemini, OpenAI, Anthropic Claude, xAI (Grok), DeepSeek, Alibaba Qwen and Moonshot Kimi.AI Manager › AI Providers
ModelOne of a provider's models, with its tier, what it can do, and its price per million tokens.A provider's Models & rates link
TierHow capable, and how costly, a model is: Simple, Medium, High or Very high.Tier on each model
CapabilityA kind of work a model can do, such as Text generation or Image understanding.Capabilities on each model
Usage recordOne row for each attempt to call a provider, with tokens, cost and outcome.AI Manager › Usage & Cost

When AI Manager is installed, it adds one provider for each of the seven, Inactive and with no key, and fills in each provider's models and prices. You connect a provider by giving it a key and setting it to Active. See Connect an AI provider.

What happens when an add-on asks for AI

  1. The add-on asks for a capability at a tier, for example Image understanding at High, and sends the instructions and content for the job.
  2. AI Manager lists every Active model at exactly that tier with that capability, from Active providers. It doesn't use a model from another tier. If there's none, nothing is sent, and the usage record says Skipped.
  3. It puts them in order: the Default provider first, then the others by Priority, lowest number first. Within one provider, the model marked Default for its tier comes first.
  4. It skips any provider that's over its daily or monthly spend limit, or its requests per minute. Each skip is recorded.
  5. It sends the job to the first model. If the call fails for a reason that may pass, such as a timeout, a rate limit or the provider being down, it tries the same provider again, up to Retry attempts times. A rejected key or a refused request isn't retried.
  6. If that provider still fails, it moves to the next model in the list, unless Try the next provider on failure is off. This is called failover.
  7. Each attempt, failed or not, becomes a usage record with its tokens and cost.
Flow of an AI request: list matching Active models, order them, skip providers over a limit, call the first model with retries, fail over to the next, and record each attempt.

The model's Max output tokens caps how long each answer may be, so one call can't run up a large bill. The settings for steps 5 and 6 are in AI Manager › Routing Settings. See AI Manager settings and permissions.

How cost is worked out

Providers report how many tokens each call used. AI Manager multiplies them by the model's rates, which are in US dollars per million tokens, and stores the figure on the usage record with the rates it used. Changing a rate affects later calls only. These figures are estimates from your own rate cards, not the provider's bill. See Track AI usage and cost.

Checks in the background

Two jobs run on your Laramin's scheduler while AI Manager is on:

  • Every hour, it reads the usage records and spend limits, and raises an alert when, for example, spend nears a limit or requests keep failing over.
  • Every day at 04:10, it asks each active provider for its list of models, and marks models the provider no longer lists, or whose published details differ from yours.

Neither job sends any of your content. If the scheduler isn't running, they don't run. See Set spending limits and alerts.

How it relates to

Next steps