Requirements
- Python 3.12 or later
- Windows, macOS, or Linux
Install the Agent skill pack (recommended)
If you plan to use SimpleLLMFunc together with a coding agent, install the packaged skill right after installing the library. The skill tells the agent how to use the framework correctly, where to look for references, and how to follow common workflows.This creates:The exported folder contains:
Export the usage skill
SKILL.md- helper reference files under
reference/
Optional: export the developer skill
If your agent also needs to work on the framework itself, update low-level code, or add tests, export the developer-oriented skill pack as well:Supported skill kinds are
usage, developer, and dev. If the destination already exists, add --force to overwrite it.Configure your model provider
Try a more advanced example
Dynamic template parameters
This example shows how_template_params lets one function adapt to different scenarios:Inspect logs
SimpleLLMFunc includes a built-in logging system. After running a demo, you can inspect:
- Console output with
trace_id - Structured logs in
LOG_DIR/application.log(default:logs/application.log) - If PyRepl is enabled, execution audit logs in
LOG_DIR/pyrepl/<instance_id>/executions.jsonl
trace_id, which makes debugging much easier.FAQ
What if my API key is invalid?
What if my API key is invalid?
Check the API keys in
provider.json and make sure they are valid and still have quota.What if the model returns an invalid format?
What if the model returns an invalid format?
For complex output types, the framework expects structured output. If the model often returns invalid structure, try a stronger model or tighten the format constraints in the docstring.
How do I add more tools?
How do I add more tools?
Define them with
@tool and pass them to the toolkit parameter of @llm_function or @llm_chat.How do async calls work?
How do async calls work?
The decorators only support
async def functions. Use them in an async context with await, or call them from a top-level asyncio.run(...) entry point.What are dynamic template parameters?
What are dynamic template parameters?
They let you fill placeholders in the docstring at call time through
_template_params, so one function can serve multiple scenarios.Next Steps
Browse Examples
Explore the
examples/ directory for more patterns.Read the User Guide
Use the task-oriented guide to decide what to read next.
Build with llm_function
Start building typed, structured LLM workflows.
Contribute
Report issues, contribute docs, or add new examples.