Skip to main content
Create a custom AI provider when your extension needs to connect T3AF to a proprietary gateway, an on-premise model, or a cloud provider that is not covered by an installed Symfony AI bridge.

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 under nst3af.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

  1. Add a Composer dependency or suggestion on nitsan/ns-t3af.
  2. Create an adapter class in your extension.
  3. Implement NITSAN\NsT3AF\Provider\Contract\AdapterInterface.
  4. Tag the service with nst3af.adapter in your extension.
  5. Flush TYPO3 caches.
  6. Create a provider row in T3AF > AI Providers and select your adapter.
  7. 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 from testConnection().
  • Advertise only the capabilities your adapter really supports.
  • Reuse T3AF provider rows instead of adding your own provider configuration table.

Verification

  1. Flush caches.
  2. Open T3AF > AI Providers.
  3. Create or edit a provider row and select your adapter.
  4. Save the row.
  5. Run the connection test and confirm the status updates.
  6. Trigger a feature that uses AiServiceInterface with that provider.