You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LiteAgent is an easy-to-learn, lightweight, and extensible AI agent framework built on top of LiteLLM. It is designed as a minimal yet practical implementation for quickly building intelligent assistants and chatbots with robust tool-calling capabilities. The codebase is intentionally simple, making it ideal for learning, extension, and rapid prototyping.
Key Advantages:
Minimal and approachable: The simplest agent implementation for fast learning and hacking.
Accurate and complete type hints: All function signatures are fully type-hinted and never faked, ensuring reliable developer experience and static analysis.
Flexible parameter definition: Supports defining tool function parameters using basic types, Pydantic models, or Python dataclasses—even in combination.
Streaming responses: Seamless support for LiteLLM streaming output.
Custom tool functions: Easily integrate your own Python functions (e.g., weather, temperature queries).
If you want to install from source for development:
uv pip install -e .# or
pip install -e .
Quick Start
Code Example
See examples/basic.py:
importasynciofromlite_agent.agentimportAgentfromlite_agent.runnerimportRunnerasyncdefget_whether(city: str) ->str:
awaitasyncio.sleep(1)
returnf"The weather in {city} is sunny with a few clouds."asyncdefmain():
agent=Agent(
model="gpt-4.1",
name="Weather Assistant",
instructions="You are a helpful weather assistant.",
tools=[get_whether],
)
runner=Runner(agent)
resp=awaitrunner.run_until_complete("What's the weather in New York?")
forchunkinresp:
print(chunk)
if__name__=="__main__":
asyncio.run(main())