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:
- Extend the engine base class used by the built-in engines.
- Implement building the request, streaming and parsing the reply.
- Report token usage so Insights can count it.
- Return clear exceptions for errors.
Look at an existing engine for a pattern before writing yours.