iLLMs is a minimal Python framework for building ReAct-style LLM agents with tool support. It combines a structured reasoning loop (Thought → Action → Observation → Answer) with simple abstractions for tools and agents.
- 🧠 ReAct loop: Thought → Action → Observation → Answer
- 🧩 Define tools via a simple decorator
- 🛠 Easily plug tools into your agent
- 🧪 Clean example in Jupyter Notebook
iLLMs/
├── Agent.py # Core agent logic (ReAct loop)
├── Tool.py # Tool definition and decorator
├── Examples/
│ └── agent.ipynb # Notebook showing usage
└── README.md
pip install groqfrom Tool import tool
@tool
def greet(name: str) -> str:
"""Returns a greeting for the given name."""
return f"Hello, {name}!"from Agent import Agent
from groq import Groq
client = Groq(api_key="your_api_key")
agent = Agent(
client=client,
name="ReActBot",
role="A helpful assistant that reasons and acts using tools.",
tools=[greet],
system_message_file="SYSTEM_PROMPT.txt"
)response = agent("Say hello to Sam.")
print(response)The agent internally loops through:
- Thought: Think about what to do next
- Action: Pick and invoke a tool
- Observation: Receive and reflect on the result
- Answer: Conclude when ready
Structured JSON responses control the loop:
{
"state": "Action",
"payload": "greet",
"args": ["Sam"]
}Check Examples/agent.ipynb for a full demonstration of defining tools and running your agent.
MIT License © 2025
- Add multi_agentic workflows
- Support for different LLM providers