Show HN: rstructor, Pydantic+instructor for Rust
github.com·11h·
Discuss: Hacker News
Flag this post

rstructor: Structured LLM Outputs for Rust

RStructor is a Rust library for extracting structured data from Large Language Models (LLMs) with built-in validation. Define your schemas as Rust structs/enums, and RStructor will handle the rest—generating JSON Schemas, communicating with LLMs, parsing responses, and validating the results.

Think of it as the Rust equivalent of Instructor + Pydantic for Python, bringing the same structured output capabilities to the Rust ecosystem.

✨ Features

  • 📝 Type-Safe Definitions: Define data models as standard Rust structs/enums with attributes
  • 🔄 JSON Schema Generation: Auto-generates JSON Schema from your Rust types
  • ✅ Built-in Validation: Type checking plus custom business rule validati…

Similar Posts

Loading similar posts...