belso is a developer-friendly Python toolkit for defining, validating, and translating structured data in Large Language Models (LLMs). Compatible with major providers. Designed for simplicity, power, and extensibility.
belso (Better LLMs Structured Outputs) streamlines how developers work with structured outputs from LLMs. It offers a consistent API for schema definition, validation, and translation—helping you bridge the gap between human language and structured data, regardless of provider.
- ✅ Unified Schema Interface – define once, use everywhere via Python dataclasses or Pydantic models
- 🔀 Multi-Provider Compatibility – seamless I/O with:
- OpenAI
- Anthropic
- Google AI
- Mistral AI
- Hugging Face
- Ollama
- LangChain
- 🔁 Bi-directional Format Translation – convert schemas across LLM formats with a single call
- 🧱 Supports Nesting & Arrays – works with deeply nested fields and typed collections
- 🧪 Validation & Inspection – ensure schema integrity with built-in tools
- 📦 Serialization – import/export schemas via JSON, YAML, and XML
- ⚡ Lightweight & Fast – minimal dependencies, optimal for production use
pip install belso
Explore the examples directory to see how belso can help you structure LLM outputs with ease.
Full documentation is available on the official site. Includes guides, API reference, and advanced usage examples.
This project is distributed under the terms of the MIT License.
If you find belso useful, consider supporting the project: