Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
90% of what you need for LLM app development. Nothing you don't.
| Date | Stars |
|---|---|
| 2026-07-31 | 274 |
| 2026-08-06 | 274 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# promptic
[](https://pypi.org/project/promptic)
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/knowsuchagency/promptic/actions/workflows/tests.yml)
### 90% of what you need for LLM app development. Nothing you don't.
Promptic aims to be the "[requests](https://requests.readthedocs.io/en/latest/)" of LLM development -- the most productive and pythonic way to build LLM applications. It leverages [LiteLLM][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
- 📚 Automatic prompt caching for supported models
- 💾 Built-in conversation memory
## Installation
```bash
pip install promptic
```
## Usage
### Basics
Functions decorated with `@llm` use its docstring as a prompt template. When the function is called, promptic combines the docstring with the function's arguments to generate the prompt and returns the LLM's response.
```py
# examples/basic.py
from promptic import llm
@llm
def translate(text, language="Chinese"):
"""Translate '{text}' to {language}"""
print(translate("Hello world!"))
# 您好,世界!
print(translate("Hello world!", language="Spanish"))
# ¡Hola, mundo!
@llm(
model="claude-3-haiku-20240307",
system="You are a customer service analyst. Provide clear sentiment analysis with key points.",
)
def analyze_sentiment(text):
"""Analyze the sentiment of this customer feedback: {text}"""
print(analyze_sentiment("The product was okay but shipping took forever"))
# Sentiment: Mixed/Negative
# Key points:
# - Neutral product satisfaction
# - Significant dissatisfaction with shipping time
```
### Image Support
Promptic supports image inputs through the `ImageBytes` type. By defining an argument as `ImageBytes`, image data is automatically converted to base64 format and sent to the LLM.
```py
# examples/image_support.py
from promptic import llm, ImageBytes
@llm(model="gpt-4o") # Use a vision-capable model
def describe_image(image: ImageBytes):
"""What's in this image?"""
with open("tests/fixtures/ocai-logo.jpeg", "rb") as f:
image_data = ImageBytes(f.read())
print(describe_image(image_data))
# The image features an illustration of a cheerful orange with glasses sitting on a laptop. There are small, sparkling stars surrounding the orange. Below the illustration, it says "Orange County AI."
@llm(model="gpt-4o")
def analyze_image_feature(image: ImageBytes, feature: str):
"""Tell me about the {feature} in this image in a sentence or less."""
print(analyze_image_feature(image_data, "colors"))
# The image features vibrant orange, green, and black colors against a light background.
```
### Structured Outputs
You can use Pydantic models to ensure the LLM returns data in exactly the structure you expect. Simply define a Pydantic model and use it as the return type annotation on your decorated function. The LLM's response will be automatically validated against your model schema and returned as a Pydantic object.
```py
# examples/structured.py
from pydantic import BaseModel
from promptic import llm
class Forecast(BaseModel):
location: str
temperature: float
units: str
@llm
def get_weather(location, units: str = "fahrenheit") -> Forecast:
"""What's the weather for {location} in {units}?"""
print(get_weather("San Francisco", units="celsius"))
# location='San Francisco' temperature=16.0 units='CelsiExcerpt of 21,316 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:926adccc36d5b933, llm:topics: ai, llms, python, utility; description: '90% of what you need for LLM app development.'
matched fp:926adccc36d5b933, llm:topics: ai, llms, python, utility; description: '90% of what you need for LLM app development.'
matched fp:926adccc36d5b933, llm:topics: ai, llms, python, utility; description: '90% of what you need for LLM app development.'