← 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
Not currently ranked — collecting fresh signals.
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.

Frequently asked

What is 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.
Is llm-strategy open source?
Yes — BlackHC/llm-strategy is open source, released under the MIT license.
What language is llm-strategy written in?
BlackHC/llm-strategy is primarily written in Python.
How popular is llm-strategy?
BlackHC/llm-strategy has 400 stars on GitHub.
Where can I find llm-strategy?
BlackHC/llm-strategy is on GitHub at https://github.com/BlackHC/llm-strategy.

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