Skip to content

Add an engine

An engine is the code that talks to one AI provider. Most providers are OpenAI-compatible, so you often do not need a new engine.

First try the Custom connector

Point the Custom (OpenAI-compatible) environment at the provider's base address and key. See Custom Model.

A real engine

Register a class through ogaie_engines, and list its models with ogaie_engine_models. Adjust endpoints with the per-provider filters, such as ogaie_custom_endpoint.

Outline:

  1. Extend the engine base class used by the built-in engines.
  2. Implement building the request, streaming and parsing the reply.
  3. Report token usage so Insights can count it.
  4. Return clear exceptions for errors.

Look at an existing engine for a pattern before writing yours.