← all repositories

BlackHC/llm-strategy

A Python decorator library that connects strongly-typed Python interfaces and dataclasses to LLMs, using type annotations as prompts and converting LLM responses back to Python types.

llm-strategy
Velocity · 7d
+0.3
★ / day
Trend
steady
star history

The library implements the Strategy Pattern using LLMs by adding an llm_strategy decorator that forwards method calls to an LLM and converts responses back into Python dataclasses. It extracts data schemas from type annotations to send to the LLM for interpretation. The package uses doc strings, type hints, and method signatures as prompts for the LLM, enabling developers to define abstract interfaces that are automatically implemented by an LLM backend.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.