← All projects
Developer building blocks

Instructor

Helps programs get neat, checked data back from AI chat models instead of loose text.

Widely usedNew this week

What it does

Instructor is a Python code library for getting structured data out of AI language models. A programmer describes the shape of the information they want, such as a name and an age, and Instructor asks the model and returns it in that exact form.

If the answer doesn't fit the expected shape, it automatically asks the model again. It can also stream partial answers and handle data with several layers.

The same code works with many AI providers, including OpenAI, Anthropic and Google, and with local models through Ollama.

Who it's for

Python developers who need reliable, structured answers from AI models in their apps.

Can I use it without coding?

Developers only. It's a code library used inside Python programs. New to this? Start here.

Can I run it?

Cost
Free, but needs an AI accountThe software is free, but it uses an online AI service (like OpenAI or Anthropic), which usually charges for use.
Runs on
Mac, Windows, Linux
Computer
An ordinary computer is fine
Privacy
Your choice: run it on your device or use an online service
API key
Needed. An API key is a password-like code from an online AI service. What's that?

Try it

Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?

Before you install

  • Only download from the official GitHub page. Copies with similar names exist for many popular projects.
  • License (MIT): Very permissive: free to use, change and share, including for business.
  • Keep your API key private. Never paste it into websites or share it, and set a spending limit with the AI service.
  • More on staying safe