Nine package families · PHP reference · TypeScript + Python ports · v0.138.0

One interface for every provider.
A harness for everything you build on it.

Prism is a cross-language provider API ecosystem. PHP and Laravel are the mature reference implementation across eighteen providers; TypeScript and Python carry the same contract, measured against one shared corpus. Build agents that carry conversations across requests, recall relevant context, and work with files, browsers and shared interfaces.

PHP / Laravel reference

Prism Harness · separate package

Agents that survive the request.

Laravel workers boot, serve, and disappear. Harness reconstructs durable sessions from storage, so a later request—or a different queue worker—finds the same thread, selected mode and model, and run state.

Shipped: durable sessions, Eloquent threads, persisted mode/model selection, guarded state stores, exclusive locking, faithful tool-loop history, and a Fancy Flow seam.

Still design: mode classes, permission-policy orchestration, pending-approval workflows, and nested subagent execution.
01

Resolve

Address a session by participant and scope; no long-lived PHP object required.

02

Rehydrate

Recover conversation history and session state in a fresh worker.

03

Lock

Serialize overlapping work; one run finishes before the next starts, and a timeout throws.

04

Continue

Record the complete exchange, including every tool step, for faithful replay.

One contract · more languages

Prism speaks three languages.

TypeScript and Python ports implement every capability the PHP reference has — text, structured output, streaming, embeddings, media, audio and more — across Anthropic, Mistral and OpenAI. Both install from their own registry.

TypeScript

Node 20+, strict types, native promises.

Python

Python 3.10+, zero runtime dependencies.

prism-parity keeps the shared behavior measurable: one language-independent corpus runs the same fixture through all three languages and compares the bytes, and its manifest is built to admit the next port.

See how parity is measured →

Capabilities

Everything an AI feature needs, Laravel-shaped.

01

One API, every provider

One request shape across 18 providers — Anthropic, OpenAI, Gemini, Ollama and more. Switch provider, keep your application code.

02

Fluent text generation

A chainable, Laravel-native interface for prompts, system messages, conversations, and multi-step generation.

03

Tools & function calling

Define typed tools the model can call — with automatic argument coercion, error handling, and multi-step loops.

04

Structured output

Schema-validated responses mapped to type-safe objects, with native JSON Schema support per provider.

05

Streaming, batches & files

First-class streaming events, the Batches API for bulk workloads, and provider file management.

06

Testing built in

Fake any provider response, assert on requests, and ship AI features with a green test suite.

08NEW

Reasoning, dialed in

Provider-agnostic withReasoning(), Anthropic adaptive thinking with output effort, and reasoning-token visibility in every Usage.

09NEW

Self-hosted & gateway ready

Point the OpenAI provider at vLLM, LiteLLM, or any compatible backend via api_format — or route through OpenRouter and Requesty.

10NEW

Observability & telemetry

Opt-in lifecycle events for every generation — token usage, cost, latency, and step/tool spans. Subscribe a Laravel listener for cost tracking, or drop in the OpenTelemetry bridge for traces in Arize Phoenix and any OTLP backend.

The fork

Keep building on Prism with maintained provider integrations and tested fixes. The [un]official takeover carries the project forward after its original maintainers went quiet in March 2026.

0.138.0

current core release

18

providers supported

1,800+

tests, phpstan clean

Pparticle-academy/prism is a drop-in replacement for prism-php/prism — the Prism\Prism namespace is unchanged. Security-patched, actively released, and documented right here, always in sync with the installed version.