About Instructor Php
Instructor for PHP is a software development kit that brings large language model features to PHP applications. It is distributed through Composer as a Composer package under the cognesy vendor name and is described as framework agnostic and production ready.
The toolkit is organized into four packages that can be used alone or together. Polyglot provides one fluent API across more than 25 LLM providers, including OpenAI, Anthropic, Gemini, Groq and Ollama, covering inference, embeddings and streaming, with YAML presets for switching providers. Instructor extracts typed PHP objects from model responses, with automatic validation, configurable retry policies, partial object updates while streaming, and several output modes such as JSON, tool calling and Markdown with JSON. The Agents package supplies a composable agent loop with immutable state, pluggable drivers including ToolCalling and ReAct, lifecycle hooks, subagents, and session persistence across HTTP requests. AgentCtrl lets a PHP program orchestrate external coding agents such as Claude Code, Codex, OpenCode, Pi and Gemini, with blocking or streaming execution and normalized responses covering text, usage, cost and tool calls.
It is intended for PHP developers who want structured outputs, multi provider model access or agent workflows without leaving their existing stack. The site links to the source on GitHub and to documentation for each package. No paid plans or prices are published; the kit is installed directly with Composer.