Batoi AIF

Governed AI Execution Framework

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.

Framework Capabilities

What AIF Provides

AIF keeps provider choice, prompts, policy decisions, audit evidence, and evaluations in a governed framework layer.

Provider Abstraction

Route AI calls through provider contracts instead of binding applications to one vendor SDK.

Governed Gateway

Apply context, policy, prompts, provider routing, response validation, and audit evidence through one execution boundary.

Prompt Governance

Keep prompt templates, versions, rendering inputs, and approval behavior separate from page code.

Policy Enforcement

Evaluate allowed providers, model choices, data boundaries, human review, and runtime constraints before execution.

Audit Evidence

Capture request context, provider selection, policy outcomes, response metadata, and review signals for accountable AI use.

Evaluation Hooks

Attach checks for quality, safety, cost, latency, and acceptance before AI outputs move into operational workflows.

Architecture Boundary

Framework Independent, Platform Ready

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 boundary

Batoi RAD Profile

Defined

RAD can persist AIF providers, prompts, policies, executions, and audit events through an integration profile.

Batoi UIF Contract

Defined

UIF can render provider management, prompt review, policy settings, execution review, and audit surfaces.

REST API Contract

Defined

AIF uses consistent REST envelopes so host apps can expose governed inference without coupling UI to providers.

Queue Adapters

Planned

Async execution should preserve correlation IDs, policy context, tenant boundaries, and audit continuity.

Vector Store Adapters

Planned

Retrieval integrations should remain adapter-driven with explicit metadata, tenant isolation, and source evidence.

Laravel and Symfony

Planned

Framework adapters should wire AIF to host routing, configuration, persistence, and jobs without changing AIF core.

Quick Start

Start With Composer Or ZIP

Use Composer where possible. ZIP/drop-in installation is available for deployments that do not use Composer, with the bundled autoloader from the repository.

Minimal Gateway Example
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'
));
Public Source

Batoi AIF Is Public On GitHub

Review the source, install the package, and use the public docs to plan governed AI execution inside your applications.