Batoi AIF is a standalone PHP framework for provider abstraction, prompt governance, policy checks, audit evidence, evaluations, and application integration. It gives AI-enabled applications a governed execution boundary instead of scattering provider calls through product code.
AIF keeps provider choice, prompts, policy decisions, audit evidence, and evaluations in a governed framework layer.
Route AI calls through provider contracts instead of binding applications to one vendor SDK.
Apply context, policy, prompts, provider routing, response validation, and audit evidence through one execution boundary.
Keep prompt templates, versions, rendering inputs, and approval behavior separate from page code.
Evaluate allowed providers, model choices, data boundaries, human review, and runtime constraints before execution.
Capture request context, provider selection, policy outcomes, response metadata, and review signals for accountable AI use.
Attach checks for quality, safety, cost, latency, and acceptance before AI outputs move into operational workflows.
AIF core is not tied to RAD, UIF, Laravel, Symfony, or any database. Host applications own routing and persistence. AIF owns the governed AI execution contract.
Read the framework boundaryRAD can persist AIF providers, prompts, policies, executions, and audit events through an integration profile.
UIF can render provider management, prompt review, policy settings, execution review, and audit surfaces.
AIF uses consistent REST envelopes so host apps can expose governed inference without coupling UI to providers.
Async execution should preserve correlation IDs, policy context, tenant boundaries, and audit continuity.
Retrieval integrations should remain adapter-driven with explicit metadata, tenant isolation, and source evidence.
Framework adapters should wire AIF to host routing, configuration, persistence, and jobs without changing AIF core.
Use Composer where possible. ZIP/drop-in installation is available for deployments that do not use Composer, with the bundled autoloader from the repository.
composer require batoi/aif
use Batoi\Aif\Gateway\AifGateway;
use Batoi\Aif\Providers\InMemoryProviderRegistry;
use Batoi\Aif\Providers\MockProvider;
use Batoi\Aif\Gateway\InferenceRequest;
$registry = new InMemoryProviderRegistry();
$registry->register(new MockProvider('mock'));
$gateway = new AifGateway(providerRegistry: $registry);
$response = $gateway->infer(new InferenceRequest(
prompt: 'Summarize the control review notes.',
provider: 'mock',
model: 'mock-model'
));
Review the source, install the package, and use the public docs to plan governed AI execution inside your applications.