
Instructor is an open-source library for developers who need structured data from local LLMs or cloud models. It turns natural-language input into typed objects that applications can use, with validation and retries built into the extraction process. Its focus is data extraction.
The Python library uses Pydantic to describe the expected data and check model responses against it. Schemas can include nested objects, lists and custom validation rules, so extraction can cover a customer support case with multiple tickets as well as a simple name-and-age record. When a response fails validation, Instructor retries with the validation error as feedback. These checks enforce the schema and your rules; they don't establish that every extracted fact is correct.
For local inference, it works with Ollama, llama-cpp-python and vLLM. The model runs through your chosen local backend. It also connects to cloud providers including OpenAI, Anthropic, Google, Mistral, Cohere and DeepSeek, where model requests go to the selected provider. A shared interface keeps structured output handling consistent across providers.
Streaming supports partial objects and lists before the full response arrives. Python developers also get type inference, IDE autocompletion, and synchronous or asynchronous calls. Instructor is available in TypeScript, Go, Ruby, Elixir and Rust as well, and the Python repository uses the MIT license.
Claim this page with an email at python.useinstructor.com. Instructor gets the verified badge, and you can upgrade the listing to be featured on localhosted. Proud to be listed? Put our badge on your site.
Want more people to find Instructor?Promote it
Something wrong or outdated on this page?
31.3KUpdated 1 day agoApache-2.0
Docker#Hybrid search#Knowledge graphs#llama.cpp backend
Graphiti is a self-hosted Python framework for developers building AI agents that need to remember changing facts. It builds knowledge graphs from conversations, structured records and unstructured text, so an agent can query current information or recover what was true earlier. It's open source under Apache 2.0.
4.2KUpdated 1 year agoApache-2.0
Windows · Linux · Web · VS Code#Batch processing#Guardrails#Hugging Face integration
4.4KUpdated 2 days agoMIT
Web#LoRA#Multimodal input#Ollama integration
10.6KUpdated 2 days agoMIT
#Batch processing#Ollama integration#Streaming inference
1.4KUpdated 2 months agoMIT
#Multimodal input#Ollama integration#Streaming inference
15.9KUpdated 1 month agoApache-2.0
#llama.cpp backend#MLX#Ollama integration
LMQL is a programming language for developers who need model calls and ordinary Python logic in the same program. It lets you define rules for generated text, including types, length limits, allowed answers and stopping phrases. Those rules apply during generation, so you can constrain intermediate responses as well as the final output.
Ollama JavaScript connects Node.js and browser applications to models running through Ollama. It's for developers building chat interfaces, AI agents or other apps that need a local LLM backend. The library is open source under the MIT license, with TypeScript types and an API that follows Ollama's REST interface.
Ollama Python connects Python applications to models running through Ollama on your own machine or to Ollama's cloud service. It's for developers adding local LLM features to scripts, chat applications, or other Python projects. The library is open source under the MIT license and requires a running Ollama service for local use.
OllamaSharp is a C# library for developers building .NET applications around Ollama. It connects to Ollama on your own machine or a remote server and covers the full Ollama API, including model management alongside chat and embeddings. It's open source under the MIT license.
Outlines is an open-source Python library for developers who need LLM responses to match a defined structure. It constrains output during generation, reducing the need to repair malformed JSON or retry responses that don't fit an application's requirements. The library uses the Apache 2.0 license.