lite-agent


Namelite-agent JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryA lightweight, extensible framework for building AI agent.
upload_time2025-08-04 15:23:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords ai agent framework assistant chatbot function call openai pydantic rich tooling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LiteAgent

[![codecov](https://codecov.io/gh/Jannchie/lite-agent/graph/badge.svg?token=SJW89Z1VAZ)](https://codecov.io/gh/Jannchie/lite-agent)

## Introduction

LiteAgent is an easy-to-learn, lightweight, and extensible AI agent framework built on top of [LiteLLM](https://github.com/BerriAI/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).
- **Rich type annotations, Pydantic-based.**
- **Easy to extend and test.**

## Installation

You can install LiteAgent directly from PyPI:

```bash
pip install lite-agent
```

Or use [uv](https://github.com/astral-sh/uv):

```bash
uv pip install lite-agent
```

If you want to install from source for development:

```bash
uv pip install -e .
# or
pip install -e .
```

## Quick Start

### Code Example

See `examples/basic.py`:

```python
import asyncio
from lite_agent.agent import Agent
from lite_agent.runner import Runner

async def get_whether(city: str) -> str:
    await asyncio.sleep(1)
    return f"The weather in {city} is sunny with a few clouds."

async def main():
    agent = Agent(
        model="gpt-4.1",
        name="Weather Assistant",
        instructions="You are a helpful weather assistant.",
        tools=[get_whether],
    )
    runner = Runner(agent)
    resp = await runner.run_until_complete("What's the weather in New York?")
    for chunk in resp:
        print(chunk)

if __name__ == "__main__":
    asyncio.run(main())
```

See `pyproject.toml` for details.

## Testing

```bash
pytest
```

## License

MIT License

## Author

Jianqi Pan ([jannchie@gmail.com](mailto:jannchie@gmail.com))

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lite-agent",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "AI, agent framework, assistant, chatbot, function call, openai, pydantic, rich, tooling",
    "author": null,
    "author_email": "Jianqi Pan <jannchie@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/45/9b/5599272f675d6c0d16206fff8d8888196178c582fec58529b812bfc34121/lite_agent-0.4.1.tar.gz",
    "platform": null,
    "description": "# LiteAgent\n\n[![codecov](https://codecov.io/gh/Jannchie/lite-agent/graph/badge.svg?token=SJW89Z1VAZ)](https://codecov.io/gh/Jannchie/lite-agent)\n\n## Introduction\n\nLiteAgent is an easy-to-learn, lightweight, and extensible AI agent framework built on top of [LiteLLM](https://github.com/BerriAI/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.\n\n**Key Advantages:**\n\n- **Minimal and approachable:** The simplest agent implementation for fast learning and hacking.\n- **Accurate and complete type hints:** All function signatures are fully type-hinted and never faked, ensuring reliable developer experience and static analysis.\n- **Flexible parameter definition:** Supports defining tool function parameters using basic types, Pydantic models, or Python dataclasses\u2014even in combination.\n- **Streaming responses:** Seamless support for LiteLLM streaming output.\n- **Custom tool functions:** Easily integrate your own Python functions (e.g., weather, temperature queries).\n- **Rich type annotations, Pydantic-based.**\n- **Easy to extend and test.**\n\n## Installation\n\nYou can install LiteAgent directly from PyPI:\n\n```bash\npip install lite-agent\n```\n\nOr use [uv](https://github.com/astral-sh/uv):\n\n```bash\nuv pip install lite-agent\n```\n\nIf you want to install from source for development:\n\n```bash\nuv pip install -e .\n# or\npip install -e .\n```\n\n## Quick Start\n\n### Code Example\n\nSee `examples/basic.py`:\n\n```python\nimport asyncio\nfrom lite_agent.agent import Agent\nfrom lite_agent.runner import Runner\n\nasync def get_whether(city: str) -> str:\n    await asyncio.sleep(1)\n    return f\"The weather in {city} is sunny with a few clouds.\"\n\nasync def main():\n    agent = Agent(\n        model=\"gpt-4.1\",\n        name=\"Weather Assistant\",\n        instructions=\"You are a helpful weather assistant.\",\n        tools=[get_whether],\n    )\n    runner = Runner(agent)\n    resp = await runner.run_until_complete(\"What's the weather in New York?\")\n    for chunk in resp:\n        print(chunk)\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\nSee `pyproject.toml` for details.\n\n## Testing\n\n```bash\npytest\n```\n\n## License\n\nMIT License\n\n## Author\n\nJianqi Pan ([jannchie@gmail.com](mailto:jannchie@gmail.com))\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A lightweight, extensible framework for building AI agent.",
    "version": "0.4.1",
    "project_urls": null,
    "split_keywords": [
        "ai",
        " agent framework",
        " assistant",
        " chatbot",
        " function call",
        " openai",
        " pydantic",
        " rich",
        " tooling"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6e4b96800931ad15ab76606703db4a64047f7e90b42d8f32724de324cb8d3c8d",
                "md5": "b1026cbc6fbc2c935e2f21973cb012fb",
                "sha256": "6672ed07bbf48e10688a5a83a76d76bbb9654555cf838638b715c6356ed83c89"
            },
            "downloads": -1,
            "filename": "lite_agent-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1026cbc6fbc2c935e2f21973cb012fb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 37201,
            "upload_time": "2025-08-04T15:23:05",
            "upload_time_iso_8601": "2025-08-04T15:23:05.202655Z",
            "url": "https://files.pythonhosted.org/packages/6e/4b/96800931ad15ab76606703db4a64047f7e90b42d8f32724de324cb8d3c8d/lite_agent-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "459b5599272f675d6c0d16206fff8d8888196178c582fec58529b812bfc34121",
                "md5": "e4aee62d4344d609ba68a91cb134c553",
                "sha256": "f5c1e90aaadd5422be75e3de1ecfc67a51390929c35d28cfea4c3a46d4782a82"
            },
            "downloads": -1,
            "filename": "lite_agent-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e4aee62d4344d609ba68a91cb134c553",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 201619,
            "upload_time": "2025-08-04T15:23:06",
            "upload_time_iso_8601": "2025-08-04T15:23:06.323839Z",
            "url": "https://files.pythonhosted.org/packages/45/9b/5599272f675d6c0d16206fff8d8888196178c582fec58529b812bfc34121/lite_agent-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-04 15:23:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "lite-agent"
}
        
Elapsed time: 1.80595s