Skip to content

Releases: korozcolt/ai-gateway

Release list

v0.1.0

Choose a tag to compare

@korozcolt korozcolt released this 06 Oct 15:31

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...), gemini and fake; closed driver list in config/ai-gateway.php.
  • Multimodal messages: AiContentPart::text(), ::image(), ::file() for OpenAI-compatible APIs and Gemini.
  • Structured output (response_format JSON Schema or schema-in-prompt) with decoded JSON on the response.
  • Usage metering: MeteredProvider + append-only ai_usage_events ledger (tokens, thinking/cached tokens, price snapshot, cost, provider-reported cost, latency, outcome, optional context_type/context_id), retention purge function.
  • Closed failure taxonomy (AiFailure) and AiProviderException that never carries prompt, response or key text.
  • AiGateway facade, AiProviderManager, ai:providers:import command, AiProvidersSeeder and ProviderImporter (idempotent, transactional, keeps settings the file omits).
  • Per-model options (max_tokens_param, temperature) for reasoning models; request_options with 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 ignores after_commit and over-long labels are truncated so a billed call is never left unmetered.