Galadriel
Galadriel is a Python framework for building autonomous, economically useful AI Agents.
Quickstart
Note: you should setup local env for this. In terminal
python3 -m venv venv
source venv/bin/activate
And then, install galadriel package.
pip install galadriel
Now, create a new python file and copy the code below to create sample agent.
It uses TestClient which sends 2 messages sequentially to the agent and prints the result of agent execution.
import asyncio
from galadriel import AgentRuntime, CodeAgent, LiteLLMModel
from galadriel.clients import SimpleMessageClient
from galadriel.tools import DuckDuckGoSearchTool
model = LiteLLMModel(model_id="gpt-4o", api_key="<ADD YOUR OPENAI KEY HERE>")
agent = CodeAgent(
model=model,
tools=[DuckDuckGoSearchTool()]
)
client = SimpleMessageClient("Explain the concept of blockchain")
runtime = AgentRuntime(
agent=agent,
inputs=[client],
outputs=[client],
)
asyncio.run(runtime.run())
Components
Clients
Clients serve as the bridge between agents and external data sources, handling both input and output operations. An input client (AgentInput) supplies messages to the agent, while an output client (AgentOutput) delivers the agent’s responses to their intended destination. This modular design allows seamless integration with a variety of sources, from scheduled jobs (like cron tasks) to interactive applications (such as Discord bots).
Tools
Tools extend an agent’s capabilities by providing predefined functions that enable interaction with external APIs, data sources, and systems. These tools empower agents to perform tasks such as fetching real-time weather updates or submitting blockchain transactions. Each tool defines its name, purpose, input requirements, and output format, ensuring structured and meaningful interactions. Galadriel supports any tool from HuggingFace, Composio and Langchain out-of-the-box.
Agents
Agents are the core intelligence behind the system, capable of reasoning, processing inputs, and generating informed responses. Our framework supports ToolCallingAgent and CodeAgent, which build upon Hugging Face’s Smolagents while introducing enhancements for improved integration with the runtime. Agents leverage ReAct-based reasoning and can access a wide variety of LLMs via LiteLLM. Additionally, they can be configured with custom personalities and interact with powerful tools to enhance their decision-making capabilities.
Runtime
The Agent Runtime ensures continuous and autonomous agent execution. It manages the lifecycle of agent interactions, efficiently processing incoming requests while maintaining agent state. The runtime follows a structured execution loop:
- Receive a Message – An input client sends a message to the runtime.
- Process the Message – The agent receives and handles the request.
- Send the Response – The agent's output is forwarded to the appropriate client.
- Repeat – The runtime continuously handles incoming messages in a loop.
This architecture enables real-time, scalable, and efficient agent operations across diverse environments.
Metadata
Release files for galadriel 0.0.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| galadriel-0.0.16.tar.gz | 1.0 MB | Without provenance | Details for galadriel-0.0.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| galadriel-0.0.16-py3-none-any.whl | Python 3 | none | any | Details for galadriel-0.0.16-py3-none-any.whl |
Total release size: 2.1 MB
Release files / galadriel-0.0.16.tar.gz
| Download URL | galadriel-0.0.16.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbf7e08910c16187f725f8ce037a5b6445541346cfbcbb0584f107f0f1b54fa7
|
|
BLAKE2b-256 checksum How to use checksums |
10a6077a905333a5f453fe5170d880d725f7e15cdafc99c3d4278005f27b48ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.9
|
Release files / galadriel-0.0.16-py3-none-any.whl
| Download URL | galadriel-0.0.16-py3-none-any.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6417d589e08c88016e12cc6f59c745657e1f72d71e68b26e0c3f6da562410124
|
|
BLAKE2b-256 checksum How to use checksums |
135bc8658c57f6bbf48bcd4136c9bddae47b11e66c3cfc3cf90ae37f16397214
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.9
|
Security for galadriel 0.0.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.