I've been building magentic [0] around similar ideas! Structured outputs and keeping control flow in python is definitely the way to go to keep things lightweight and easy to integrate. Having state management built in is cool! I'd be interested to hear what kinds of projects this has enabled you to build.
Many libraries have been written in Python to build LLM applications, but none of them suited my needs. I wanted something straightforward that would get out of my way, like "requests" did for HTTP.
I've been using Promptic for all my LLM projects over the past several months, and I've continued to refine it. It's now at a point where I feel good about sharing it with you all.
I hope you find it as fun and productive to use as I do!
---
Promptic: 90% of what you need for LLM app development. Nothing you don't.
Promptic aims to be the "requests" of LLM development -- the most productive and Pythonic way to build LLM applications. It leverages LiteLLM, so you're never locked in to an LLM provider and can switch to the latest and greatest with a single line of code. Promptic gets out of your way so you can focus entirely on building features.
“Perfection is attained, not when there is nothing more to add, but when there is nothing more to take away.”
At a glance
Type-safe structured outputs with Pydantic
Easy-to-build agents with function calling
Streaming support for real-time responses
Built-in conversation memory
Error handling and retries
Extensible state management
[0] https://github.com/jackmpcollins/magentic
reply