Repository navigation
Releases: korozcolt/ai-gateway
Releases · korozcolt/ai-gateway
Release list
v0.1.0
First public release. Extracted from the AI layer of a KOR Bytes production project and generalized.
Added
- Provider connections stored in the database (
ai_providers) with tokens encrypted by a dedicated AES-256-GCM key (key id, rotation with retired keys,php artisan ai:generate-key). - Drivers:
openai_compatible(OpenRouter, NVIDIA Build, OpenAI, Azure OpenAI v1, Mistral, Groq...),geminiandfake; closed driver list inconfig/ai-gateway.php. - Multimodal messages:
AiContentPart::text(),::image(),::file()for OpenAI-compatible APIs and Gemini. - Structured output (
response_formatJSON Schema or schema-in-prompt) with decoded JSON on the response. - Usage metering:
MeteredProvider+ append-onlyai_usage_eventsledger (tokens, thinking/cached tokens, price snapshot, cost, provider-reported cost, latency, outcome, optionalcontext_type/context_id), retention purge function. - Closed failure taxonomy (
AiFailure) andAiProviderExceptionthat never carries prompt, response or key text. AiGatewayfacade,AiProviderManager,ai:providers:importcommand,AiProvidersSeederandProviderImporter(idempotent, transactional, keeps settings the file omits).- Per-model options (
max_tokens_param,temperature) for reasoning models;request_optionswith a denylist of app-controlled fields and credentials. - Pest test suite on PostgreSQL (Orchestra Testbench), Larastan level 6, Pint, GitHub Actions.
Security
- Calls for models not declared in the connection are rejected before any request is sent.
- Key/decryption errors surface as
AiProviderException(credentials_unavailable); the usage ledger job ignoresafter_commitand over-long labels are truncated so a billed call is never left unmetered.