Skip to main content

Towards automated general intelligence.

Project description

PyPI - Version Read the Docs PyPI - License PyPI - Downloads

PyPI | Documentation | Discord

LionAGI

Towards Automated General Intelligence

LionAGI is a cutting-edge intelligent agent framework. It integrates data manipulation with advanced machine learning tools, such as Large Language Models (i.e. OpenAI's GPT).

  • Designed for data-centric, production-level projects,
  • dramatically lowers the barrier in creating intelligent, automated systems
  • that can understand and interact meaningfully with large volumes of data.

Install LionAGI with pip:

pip install lionagi

Download the .env_template file, input your appropriate API_KEY, save the file, rename as .env and put in your project's root directory. by default we use OPENAI_API_KEY.

Features

  • Robust and scalable. Create a production ready LLM application in hours, with more than 100 models
  • Efficient and verstile data operations for reading, chunking, binning, writing, storing data with support for langchain and llamaindex
  • Built-in support for chain/graph-of-thoughts, ReAct, Concurrent parallel function calling
  • Unified interface with any LLM provider, API or local
    • Fast and concurrent API call with configurable rate limit
    • (Work In Progress) support for models both API and local

LionAGI is designed to be asynchronous only, please check python official documentation on how async work: here

Notice:

  • calling API with maximum throughput over large set of data with advanced models i.e. gpt-4 can get EXPENSIVE IN JUST SECONDS,
  • please know what you are doing, and check the usage on OpenAI regularly
  • default rate limits are set to be tier 1 of OpenAI model gpt-4-1104-preview, please check the OpenAI usage limit documentation you can modify token rate parameters to fit different use cases.
  • if you would like to build from source, please download the latest release, main is under development and will be changed without notice

Quick Start

The following example shows how to use LionAGI's Session object to interact with gpt-4 model:

# define system messages, context and user instruction
system = "You are a helpful assistant designed to perform calculations."
instruction = {"Addition":"Add the two numbers together i.e. x+y"}
context = {"x": 10, "y": 5}
# in interactive environment (.ipynb for example)
import lionagi as li

calculator = li.Session(system=system)
result = await calculator.initiate(
  instruction=instruction, context=context, model="gpt-4-1106-preview"
)

print(f"Calculation Result: {result}")
# or otherwise, you can use
import asyncio
from dotenv import load_dotenv

load_dotenv()

import lionagi as li

async def main():
    calculator = li.Session(system=system)
    result = await calculator.initiate(
      instruction=instruction, context=context, model="gpt-4-1106-preview"
    )
    print(f"Calculation Result: {result}")

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

Visit our notebooks for our examples.

Community

We encourage contributions to LionAGI and invite you to enrich its features and capabilities. Engage with us and other community members Join Our Discord

Citation

When referencing LionAGI in your projects or research, please cite:

@software{Li_LionAGI_2023,
  author = {Haiyang Li},
  month = {12},
  year = {2023},
  title = {LionAGI: Towards Automated General Intelligence},
  url = {https://github.com/lion-agi/lionagi},
}

Star History

Star History Chart

Requirements

Python 3.9 or higher.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lionagi-0.0.202.tar.gz (102.6 kB view details)

Uploaded Source

Built Distribution

lionagi-0.0.202-py3-none-any.whl (122.9 kB view details)

Uploaded Python 3

File details

Details for the file lionagi-0.0.202.tar.gz.

File metadata

  • Download URL: lionagi-0.0.202.tar.gz
  • Upload date:
  • Size: 102.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for lionagi-0.0.202.tar.gz
Algorithm Hash digest
SHA256 ff0962b3441396be62e63625177509a04ba91c43a212083fda8d45d576211959
MD5 a2c5747dd4478e2c69c01d622079971c
BLAKE2b-256 3d4ea1e88f981da8d9eb8e3cb7de8077b84b00eac5eed8172adc3f5516d35719

See more details on using hashes here.

File details

Details for the file lionagi-0.0.202-py3-none-any.whl.

File metadata

  • Download URL: lionagi-0.0.202-py3-none-any.whl
  • Upload date:
  • Size: 122.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for lionagi-0.0.202-py3-none-any.whl
Algorithm Hash digest
SHA256 c777eb70687d986b8678aea51ba3b5c448accfe4bf2ee4c7b749e72bac0a402f
MD5 f1320fb6ed49cad3d9dce57c01c44b67
BLAKE2b-256 07732c3b9cb71ba53685fb09d65e8055d9464af409a074b65462a02c430cfeaf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page