---
title: Introduction
description: 'Structured data processing in PHP, powered by LLMs. Designed for simplicity, transparency, and control.'
---

<img
  className="block dark:hidden"
  src="/images/hero-light.svg"
  alt="Hero Light"
/>
<img
  className="hidden dark:block"
  src="/images/hero-dark.svg"
  alt="Hero Dark"
/>


## What is Instructor?

Instructor is a library that allows you to get structured, validated data from multiple types of inputs: text,
chat messages, or images. It is powered by Large Language Models (LLMs).

The library is inspired by the [Instructor](https://jxnl.github.io/instructor/) for Python created by [Jason Liu](https://twitter.com/jxnlco).




## Learn More...

<CardGroup cols={1}>
    <Card
        title="Get Started"
        icon="sparkles"
        href="/quickstart"
    >
        Check how to set up Instructor in your project and start processing data with LLMs
    </Card>

    <Card
        title="Concepts"
        icon="shapes"
        href="/concepts/overview"
    >
        Read more about basic concepts behind Instructor
    </Card>

    <Card
        title="Essentials"
        icon="hammer"
        href="/essentials"
    >
        Learn Instructor features and capabilities
    </Card>

    <Card
        title="Cookbooks"
        icon="book"
        href="/cookbook/introduction"
    >
        Browse examples to see Instructor in action and find out how to use it in your projects
    </Card>

    <Card
        title="Internals"
        icon="gears"
        href="/internals"
    >
        Deep dive into Instructor internals and low level mechanisms
    </Card>

</CardGroup>





## Feature Highlights

Instructor is designed to make it easy to process data with LLMs in PHP. Here are some of the key features of the library:

### Core features

- Get structured responses from LLM inference
- Validation of returned data
- Automated retries in case of errors when LLM responds with invalid data

### Flexible inputs

- Process various types of input data: text, series of chat messages or images
- 'Structured-to-structured' processing - provide object or array as an input and get object with the results of inference back
- Demonstrate examples to improve the quality of inference

### Customizable outputs

- Define response data model the way to need: type-hinted classes, JSON Schema arrays, or dynamically define your data shapes with Structures
- Customize prompts and retry prompts
- Use attributes or PHP DocBlocks to provide additional instructions for LLM
- Customize response model processing by providing your own implementation of schema, deserialization, validation and transformation interfaces

### Sync and streaming support

- Receive synchronous or streaming responses
- Get partial updates & stream completed sequence items

### Observability

- Get detailed insight into internal processing via events

### Support for multiple LLMs / API providers

- Use multiple LLM API providers (incl. OpenAI,  Anthropic, Cohere, Azure, Groq, Mistral, Fireworks AI, Ollama, OpenRouter, Together AI)
- Use local models with Ollama

### Documentation and examples

- Learn more from growing documentation and 50+ cookbooks




## Instructor in Other Languages

Instructor has been implemented in various technology stacks. Check out implementations in other languages below:

- [Python](https://www.github.com/jxnl/instructor) (original)
- [Javascript](https://github.com/instructor-ai/instructor-js) (port)
- [Elixir](https://github.com/thmsmlr/instructor_ex/) (port)
- [Ruby](https://ruby.useinstructor.com/) (port)
- [Go](https://go.useinstructor.com/) (port)

If you want to port Instructor to another language, please reach out to us on [Twitter](https://twitter.com/jxnlco) we'd love to help you get started!



