{"repo":"clifton/rstructor","free":true,"listed":false,"github":"https://github.com/clifton/rstructor","clone":"git clone https://github.com/clifton/rstructor.git","description":"Pydantic + Instructor for Rust: extract structured, validated data from LLMs (OpenAI GPT, Anthropic Claude, Gemini, Grok/xAI) into native Rust structs & enums. Derive macros auto-generate JSON Schema, parse responses, and retry on validation errors. Type-safe structured outputs & function calling.","language":"Rust","stars":29,"topics":["instructor","llm-tools","pydantic","rust","anthropic","claude","data-extraction","function-calling","gemini","gpt"],"license":"MIT","category":"ai-agents","readme_excerpt":"rstructor: Structured LLM Outputs for Rust Get structured, validated data from supported LLM providers as native Rust structs and enums. Define the shape you want as plain Rust types — rstructor generates the JSON Schema, prompts the model, parses the response, and either returns a validated value or a typed error after the configured retries. Features - Type-safe schemas from Rust types — Derive Instructor on structs and enums; rstructor generates the JSON Schema and validated parser for you, no hand-written prompts or DTOs - Multi-provider, one API — OpenAI, Anthropic, Grok (xAI), and Gemini behind a single extract() call with swappable clients - Validation with automatic re-ask — Built-in type checking plus custom business rules; validation failures are fed back to the model and retried within an explicit bound - Rich, nested data — Nested objects, arrays, optionals, maps, and enums with associated data, with validation that recurses through the whole tree - Familiar if you know Pydantic + Instructor — The same structured-output workflow as Python's Instructor + Pydantic, with Rust's compile-time type safety Installation The default includes the derive macro and all four built-in providers. Provider features share the same HTTP and async dependency stack, so enabling all of them does not add third-party dependencies over an OpenAI-only build. Logging setup, streaming, tools, schemars interop, mocks, and fixture replay remain opt-in. 60-Second Extraction Set the API key for","default_branch":null,"files":null,"tree":[],"storefront":"/r/clifton","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/clifton/rstructor/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}