Instructor Php
PHP SDK that unifies 25+ LLM providers, extracts typed objects, and runs agents.
If you build LLM features in PHP, Instructor for PHP is the most complete native SDK available: Polyglot's 25+ provider abstraction, Instructor's typed-object extraction with retry policies, Agents' immutable-state loop, and AgentCtrl's control of Claude Code and Codex cover the full lifecycle. It plays a different game than Python-centric tools. LangChain and the Python Instructor target Python teams; PHP shops otherwise stitch together raw provider SDKs and hand-rolled JSON parsing. Choose it when you need structured outputs and agent orchestration inside a PHP codebase. Skip it if you are not on PHP or you want a no-code tool.
Verified 1d ago · liveness 64/100 · cite: rightaichoice.com/tools/instructor-php
- PHP developers building LLM-powered applications
- Laravel and Symfony teams needing structured outputs
- Developers creating multi-step agent workflows in PHP
- Projects needing one API across multiple LLM providers
- Non-PHP developers
- Teams wanting a no-code LLM tool
- Applications requiring real-time audio or multimodal inputs
We scan live Reddit threads, YouTube comments, X posts, G2 reviews and other communities — and hand you an honest verdict in under a minute.
- Honest verdict, not marketing
- Real pros & cons from real users
- Attributed quotes with receipts
3 free scans · no card needed
Skip Instructor for PHP if your stack is not PHP, or if you want a no-code LLM tool — this is a code-first SDK that installs via Composer and expects you to write PHP classes for your response models.
The SDK is free, but every LLM call it makes bills against your own provider accounts — OpenAI, Anthropic, Gemini, or your Ollama hardware — so your real spend is whatever your usage and provider rate cards add up to.
Instructor for PHP is free open-source software installed through Composer — there is no license, plan tier, or seat fee. The cost equation is entirely your LLM usage: a solo PHP developer on Ollama pays essentially nothing, while a team routing high-volume structured extraction and agent loops through OpenAI or Anthropic pays those providers' token rates. Compared with no-code LLM platforms that charge per seat plus usage, this is cheaper for teams with engineering capacity; compared with raw
In short
Instructor Php — PHP SDK that unifies 25+ LLM providers, extracts typed objects, and runs agents. Best for PHP developers building LLM-powered applications, Laravel and Symfony teams needing structured outputs, Developers creating multi-step agent workflows in PHP. Free to use.
What people actually say about Instructor Php — is it worth it?
We ran a structured research pass across product reviews, community discussions, and post-purchase forum threads to surface the patterns vendors won't publish themselves. Below: the recurring strengths, the hidden costs people mention most, and the cohort that consistently regrets adopting this tool.
32 mentions across 2 sources (YouTube, Lemmy) · researched Aug 29, 2026.
Average across the 2 sources that answered — each source counts once, not each post.
- +Unified API for 25+ LLM providers from PHP
- +Structured output into typed PHP objects
- +Built-in validation with configurable retries
- +Streaming responses with partial object updates
- +Agent loops with composable, immutable state
- −Zero community feedback to verify any claim
- −No public benchmarks or performance evidence
- −No reviews on Reddit, HN, GitHub, or Stack Overflow
- −Support availability and quality completely unknown
- −Documentation and real-world examples not independently assessed
- • No hidden costs reported (but no user reports exist)
- • Potential time cost of validating the tool without community feedback
Viability Score
How well maintained and how widely used is Instructor Php? Built from what the vendor actually publishes (docs, changelog, tutorials, integrations, pricing), whether the site is live, and how much real users discuss it. How we calculate this
Last calculated: September 2026
How we score →Key Features
- Unified API for 25+ LLM providers via Polyglot
- Embeddings interface covering OpenAI, Azure, Gemini, Cohere, Jina, and Ollama
- Structured data extraction into typed PHP objects
- Automatic validation with configurable retry policies
- Streaming with partial object updates and deltas
- Multiple output modes: JSON, tool calling, Markdown+JSON
- Composable agent loop with immutable state
- Pluggable agent drivers: ToolCalling, ReAct, Fake for testing
- Lifecycle hooks, tools, subagents, and capability packs
- Session persistence across HTTP requests
- Coding agent control for Claude Code, OpenAI Codex, OpenCode, Pi, and Gemini CLI
- Blocking execution or real-time streaming with callbacks
- Normalized responses: text, usage, cost, tool calls
- YAML preset system for switching providers by changing a string
- Framework-agnostic: plain PHP, Laravel, Symfony, or custom structure
About Instructor Php
Instructor for PHP is an SDK that brings LLM features into the PHP ecosystem through four composable packages: Polyglot, Instructor, Agents, and AgentCtrl. Polyglot gives you one fluent API for 25+ providers — OpenAI, Anthropic, Gemini, Azure OpenAI, AWS Bedrock, Groq, Mistral, Cohere, Deepseek, Fireworks, Ollama, Together, OpenRouter, Perplexity, xAI, Cerebras, SambaNova, Hugging Face, Qwen, MiniMax, Moonshot, GLM, A21, Inception, and Meta — plus an embeddings interface covering OpenAI, Azure, Gemini, Cohere, Jina, and Ollama. Instructor extracts typed PHP objects from model responses with automatic validation and configurable retry policies, supporting JSON, tool-calling, and Markdown+JSON output modes with streaming partial-object updates. Agents provides a composable agent loop with immutable state, pluggable drivers (ToolCalling, ReAct, and a Fake driver for deterministic testing), lifecycle hooks, tools, subagents, capability packs, and session persistence across HTTP requests. AgentCtrl drives external coding agent CLIs — Claude Code, OpenAI Codex, OpenCode, Pi, and Gemini CLI — with blocking execution or real-time streaming callbacks and session continuity. Install with `composer require cognesy/instructor-php`, set a provider API key, and start either with a single package or the whole stack. It is framework-agnostic: plain PHP, Laravel, Symfony, or your own structure, with no framework lock-in and no port from Python or JavaScript.
Behind the Verdict
Strengths: Instructor for PHP is PHP-native rather than a port, which shows in idioms PHP developers actually use — `composer require cognesy/instructor-php` installs it, typed properties on a `final class Person` define the extraction shape, and `StructuredOutput::using('openai')->with(messages: 'Jason is 28 years old.', responseModel: Person::class)->get()` returns a validated `Person` object. Validation and configurable retry policies are built into the extraction flow, so malformed model output is caught and re-requested without you writing the retry loop. The four packages have clean boundaries: Polyglot owns all LLM communication (inference and embeddings), Instructor and Agents build on top of it, and AgentCtrl talks directly to external coding agent CLIs. That means you can adopt just structured outputs today and add agents later. The FakeAgentDriver is a genuinely useful engineering decision — you can script scenarios and verify agent behavior deterministically without hitting an API. Session persistence across HTTP requests matters for web apps that lose state between requests. AgentCtrl is unusual: driving Claude Code, OpenAI Codex, OpenCode, Pi, and Gemini CLI from PHP with blocking execution or real-time streaming callbacks and normalized text/usage/cost/tool-call responses is a capability most PHP toolkits simply do not have. Weaknesses and fit: the documentation does not publish rate limits or plan tiers, and context limits and model availability vary by underlying provider — that is inherent to being a unified API, but it means you must know your provider's constraints. Agents and coding agents need additional configuration, and AgentCtrl requires the external CLIs (Claude Code, Codex, OpenCode, Pi, Gemini) to be installed and reachable. The scope is deliberately PHP-only, so it is not relevant to Python, Node, or Go teams, and it is code-first — there is no no-code layer. Where it fits: production PHP applications that need reliable structured extraction, multi-provider routing without rewrites, and multi-step agents. Where it does not: simple chatbot projects with no structured-output requirement, applications needing real-time audio or multimodal input, and teams that want a point-and-click tool.
Researching Instructor Php? Get your full AI stack in 60 seconds.
Free, no signup — tell us your goal and get tools matched to your budget & existing stack.
Real-world workflow fit
Concrete scenarios for the personas Instructor Php actually fits — and what changes day-one when you adopt it.
They install the package with composer require cognesy/instructor-php, set OPENAI_API_KEY, and define a final class Person with typed properties. A form submission passes free-text to StructuredOutput::using('openai')->with(messages: ..., responseModel: Person::class)->get().
Outcome: They get a validated Person object instead of a raw string, with configurable retry policies catching malformed output, so no hand-written JSON parsing lands in the codebase.
They wire Agents' AgentLoop and AgentState with a system prompt and capability packs such as UseBash and UseGuards (maxSteps: 10), and rely on session persistence across HTTP requests so the conversation carries between requests.
Outcome: A multi-step support agent with tool use and stop rules runs inside the existing Laravel app, and FakeAgentDriver lets them script scenarios in tests without making API calls.
They use AgentCtrl::claudeCode()->inDirectory('/my/project')->execute('Summarize this repo.') from a PHP script or CI job, choosing blocking execution or streaming callbacks.
Outcome: Repository summaries and refactors run from PHP with normalized text, usage, cost, and tool-call data returned to the script, so coding-agent output can be logged and acted on programmatically.
Use Cases
- Extract typed PHP objects like a Person with name and age from unstructured text using StructuredOutput.
- Call OpenAI, Anthropic, and a local Ollama model through the same Polyglot Inference interface.
- Build a math tutor agent with a system prompt, tools, and stop rules using AgentLoop and AgentState.
- Run Claude Code or OpenAI Codex from PHP to summarize or refactor a repository.
- Generate embeddings for a PHP search or similarity feature via Polyglot's embeddings providers.
- Test agent behavior deterministically with FakeAgentDriver, with no API calls.
- Persist agent sessions across HTTP requests in a Laravel or Symfony web app.
- Switch LLM providers by editing a YAML preset instead of rewriting application code.
Models Under the Hood
as of 2026-09-08
Limitations
- The documentation does not publish rate limits or plan tiers for the SDK itself — context limits and model availability vary by the underlying provider, since Polyglot is a unified API over 25+ providers.
- Agent and coding agent features require additional configuration.
- AgentCtrl requires the external CLI tools (Claude Code, OpenAI Codex, OpenCode, Pi, Gemini CLI) to be installed and reachable, and running them means the coding agent's own model, cost, and rate limits apply.
- It is a PHP-only SDK, so Python, Node, or Go teams cannot use it.
- There is no no-code interface, and it does not target real-time audio or multimodal input pipelines.
as of 2026-09-14
Verification history
We have re-verified Instructor Php 7 times since . Each pass re-reads the vendor's own pages and re-checks every listed field against that evidence; passes where nothing had changed are marked as such.
- — re-checked, vendor evidence unchanged
- — re-checked, vendor evidence unchanged
- — re-checked, vendor evidence unchanged
- — re-checked, vendor evidence unchanged
- — re-verified summary, description, our verdict, our analysis, pricing model, pricing tiers, features, integrations, who it suits, who should skip it
- — re-verified summary, description, our verdict, our analysis, pricing model, pricing tiers, features, integrations, who it suits, who should skip it
Showing the 6 most recent of 7 verification passes.
Free to cite with attribution — this page re-verifies continuously.
Where the pricing makes sense
The company stage and team size where Instructor Php's pricing actually pencils out — and where peers do it cheaper.
Instructor for PHP is free open-source software installed through Composer — there is no license, plan tier, or seat fee. The cost equation is entirely your LLM usage: a solo PHP developer on Ollama pays essentially nothing, while a team routing high-volume structured extraction and agent loops through OpenAI or Anthropic pays those providers' token rates. Compared with no-code LLM platforms that charge per seat plus usage, this is cheaper for teams with engineering capacity; compared with raw
Setup time & first value
How long it actually takes to get something useful out of Instructor Php — broken out by persona, not the marketing-page minute.
A single-package start is fast: composer require cognesy/instructor-php, export an API key, and a first Polyglot Inference call can run in minutes. Structured outputs take a bit longer — you write the typed PHP class that shapes the response. Agents add more time once you configure tools, stop rules, and capability packs. AgentCtrl is the longest lead item because the external CLI (Claude Code,
Switching to or from Instructor Php
How to bring data in from common predecessors and how to get it back out — written for the switcher, not the buyer.
- →From raw OpenAI/Anthropic PHP SDKs: install cognesy/instructor-php, move calls to Polyglot Inference::using(), and keep provider switching to a string change.
- →From hand-rolled JSON parsing: define a typed PHP response model and swap the parse-and-retry code for StructuredOutput with responseModel.
- →From Python-centric frameworks: reimplement the flow in PHP using Polyglot, Instructor, and Agents, since this SDK is PHP-native rather than a port.
- ↗To Python Instructor or LangChain: your typed response models and agent prompts port conceptually, but the PHP classes and Composer setup do not transfer.
- ↗To raw provider SDKs: replace Polyglot Inference calls with the provider's own PHP client, giving up the unified provider abstraction and YAML presets.
Integrations
Resources & Guides
Tutorials & Learning
YouTube returned 6 videos for “Instructor Php”, and we withheld 6: 6 did not mention Instructor Php. We are showing none, because we could not prove any of them are about Instructor Php.
Official links
Tools that pair well with Instructor Php
Common stack mates teams adopt alongside Instructor Php, with the specific reason each pairing earns its keep.
Pydantic AI
Pydantic AI is the Python AI SDK for typed agents, realtime voice, image generation, and embeddings — every model a string swap away.
Rig
Type-safe Rust library for building AI agents across 20+ providers
Zhipu GLM
Zhipu GLM delivers open-source LLM models, MaaS APIs, and autonomous agents for Chinese enterprises and developers.
Featured Head-to-Head Comparisons
Instructor Php vs Presto Voice
Presto Voice and Instructor PHP serve completely different audiences — one is a specialized drive-thru voice AI for QSR chains, the other a developer SDK for structured LLM outputs in PHP. Your choice depends entirely on domain: if you run a multi-location quick-service restaurant with drive-thrus and need to boost revenue, Presto Voice is the pick; if you're a PHP developer building LLM-powered apps with structured data extraction, Instructor PHP is free and purpose-built. There's no overlap, so pick based on your role.
Instructor Php vs Locus Robotics
Locus Robotics and Instructor PHP serve completely different domains: physical warehouse automation vs. software SDK for LLM interaction. Choose Locus if your pain point is manual picking inefficiency in a busy warehouse; choose Instructor PHP if you're a PHP developer needing to integrate LLMs with structured outputs. They are not competitors but complementary tools for unrelated problems.
Instructor Php vs Truleo
Truleo and Instructor PHP serve entirely different domains — law enforcement intelligence vs. PHP developer tooling. Choose Truleo if you're a police agency drowning in siloed data and need automated lead generation, report writing, and real-time alerts. Choose Instructor PHP if you're a PHP developer who needs structured LLM outputs and multi-provider support without switching ecosystems. There's no overlap; the decision depends entirely on your role and industry.
Alternatives to Instructor Php
View allPydantic AI
Pydantic AI is the Python AI SDK for typed agents, realtime voice, image generation, and embeddings — every model a string swap away.
Frequently Asked Questions
Topics
Used Instructor Php? Help shape our editorial sentiment research.