Provider architecture
T3AF discovers provider adapters from the Symfony service container. Each adapter describes its type, display name, default endpoint, supported capabilities, connection test, and runtime platform object. Built-in bridge packages are auto-registered when available. T3AF also provides the built-in Custom / Other OpenAI-compatible adapter undernst3af.openai_compatible. Use a custom adapter only when the provider is not OpenAI-compatible or needs a custom SDK/protocol.
When to create a provider
- You use a private or on-premise LLM.
- Your vendor has a custom API that is not OpenAI-compatible.
- Your company routes AI requests through an internal gateway.
- You need capabilities or connection behavior that the built-in adapters do not provide.
Implementation steps
- Add a Composer dependency or suggestion on
nitsan/ns-t3af. - Create an adapter class in your extension.
- Implement
NITSAN\NsT3AF\Provider\Contract\AdapterInterface. - Tag the service with
nst3af.adapterin your extension. - Flush TYPO3 caches.
- Create a provider row in T3AF > AI Providers and select your adapter.
- Run the connection test.
Minimal adapter shape
Service registration
The_instanceof rules inside EXT:ns_t3af do not tag services from your extension. Register the adapter in your own Configuration/Services.yaml.
Credentials
Provider API keys are stored encrypted on provider records. If your SDK needs the plaintext key, decrypt it through T3AF’s credential service and never write the value to logs, exceptions, or frontend output.Best practices
- Use the
custom.{vendor}prefix for custom adapter types. - Keep adapter type values stable after release.
- Return connection failures through
VerifyResult::failure()instead of throwing fromtestConnection(). - Advertise only the capabilities your adapter really supports.
- Reuse T3AF provider rows instead of adding your own provider configuration table.
Verification
- Flush caches.
- Open T3AF > AI Providers.
- Create or edit a provider row and select your adapter.
- Save the row.
- Run the connection test and confirm the status updates.
- Trigger a feature that uses
AiServiceInterfacewith that provider.