Fructose
FreeFructose is a python package to create a dependable, strongly-typed interface around an LLM call. 
About Fructose
Fructose is a Python package that enables developers to define LLM calls as strongly-typed functions using a simple @ai decorator. By decorating a type-annotated function, Fructose automatically builds a prompt for an LLM (currently OpenAI) and returns structured data matching the function's return type. It supports primitive types (str, int, bool, float), compound types (list, dict, tuple, Enum, Optional), complex dataclasses, nested types, custom prompt templates, and local function calling. The package is lightweight and syntactic sugar, making it easy to integrate into existing Python projects. Note: maintenance is paused; alternative packages like Instructor or Marvin are recommended for active development.
Key Features
Pros & Cons
- Simple decorator-based syntax integrates naturally with Python
- Strongly-typed interface ensures predictable outputs
- Supports complex nested data types including dataclasses
- Local function calling allows composition of LLM calls with traditional code
- Lightweight and easy to install
- Maintenance paused; project may not receive updates
- Only supports OpenAI models (requires API key)
- Local function calling requires specific annotations (type hints, docstrings)
- Not actively maintained; consider alternatives like Instructor or Marvin