# belso – Better LLMs Structured Outputs

[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://MikiTwenty.github.io/belso/)
[![PyPI version](https://badge.fury.io/py/belso.svg)](https://badge.fury.io/py/belso)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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

```bash
pip install belso
```

---

## 🧪 Quick Start

Explore the [examples](examples/) directory to see how belso can help you structure LLM outputs with ease.

---

## 📚 Documentation

Full documentation is available on the [official site](https://MikiTwenty.github.io/belso/).
Includes guides, API reference, and advanced usage examples.

---

## 📄 License

This project is distributed under the terms of the [MIT License](LICENSE).

---

## ☕ Support My Work

If you find belso useful, consider supporting the project:

[![Buy me a coffee](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/mikitwenty)
