lite-agent


Namelite-agent JSON
Version 0.14.1 PyPI version JSON
download
home_pageNone
SummaryA lightweight, extensible framework for building AI agent.
upload_time2025-09-04 01:31:46
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/4e/cb/55b17396d6554a7b1d4068925013546382d2f4fe78275082696c1a037615/lite_agent-0.14.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.14.1",
    "project_urls": null,
    "split_keywords": [
        "ai",
        " agent framework",
        " assistant",
        " chatbot",
        " function call",
        " openai",
        " pydantic",
        " rich",
        " tooling"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e863fe14b28271ee35ae2df3ab5733110a444f76d9c4cd55f057926936975459",
                "md5": "34199831bcedfbda3fc86a949d24f9ae",
                "sha256": "a8e8a8ffbfaf48aefa219ea4635c360f7226f94d847166d947b8c1359cdda019"
            },
            "downloads": -1,
            "filename": "lite_agent-0.14.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "34199831bcedfbda3fc86a949d24f9ae",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 55262,
            "upload_time": "2025-09-04T01:31:45",
            "upload_time_iso_8601": "2025-09-04T01:31:45.393095Z",
            "url": "https://files.pythonhosted.org/packages/e8/63/fe14b28271ee35ae2df3ab5733110a444f76d9c4cd55f057926936975459/lite_agent-0.14.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4ecb55b17396d6554a7b1d4068925013546382d2f4fe78275082696c1a037615",
                "md5": "8fc6bd5abe03b8f97d75a4b30280c8ab",
                "sha256": "a20f9d694175952be44f12336c3aef8f1a9e79b0809e81199fd9625eb6833ee3"
            },
            "downloads": -1,
            "filename": "lite_agent-0.14.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8fc6bd5abe03b8f97d75a4b30280c8ab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 376148,
            "upload_time": "2025-09-04T01:31:46",
            "upload_time_iso_8601": "2025-09-04T01:31:46.784798Z",
            "url": "https://files.pythonhosted.org/packages/4e/cb/55b17396d6554a7b1d4068925013546382d2f4fe78275082696c1a037615/lite_agent-0.14.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-04 01:31:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "lite-agent"
}
        
Elapsed time: 1.33744s