Skip to content

MikiTwenty/belso

Repository files navigation

belso – Better LLMs Structured Outputs

Documentation PyPI version License: MIT

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.


🚀 Overview

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.


🔑 Key Features

  • 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

📦 Installation

pip install belso

🧪 Quick Start

Explore the examples directory to see how belso can help you structure LLM outputs with ease.


📚 Documentation

Full documentation is available on the official site. Includes guides, API reference, and advanced usage examples.


📄 License

This project is distributed under the terms of the MIT License.


☕ Support My Work

If you find belso useful, consider supporting the project:

Buy me a coffee

About

Better LLMs Structured Outputs - A useful python package!

Topics

Resources

License

Stars

Watchers

Forks

Languages