GithubHelp home page GithubHelp logo

gregorgolen / lionagi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lion-agi/lionagi

0.0 0.0 0.0 6.08 MB

Towards Automated General Intelligence.

License: Apache License 2.0

Python 28.92% Jupyter Notebook 71.08%

lionagi's Introduction

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.

  • supports all models in OpenRouter (not released yet, you can have a preview in main)
  • supports all langchain and llamaindex splitters, chunkers, and readers (not released yet)
  • here is the the latest stable, please pip install lionagi==0.0.111 if you find 0.0.112 buggy

Features

  • Create a production ready LLM application in hours.
  • written in pure python, minimum dependency aiohttp, python-dotenv, tiktoken, pydantic
  • Efficient and verstile data operations for reading, chunking, binning, writing, storing and managing data
  • (Work In Progress) support for all langchain and llamaindex splitters, chunkers, and readers
  • Unified interface with any LLM provider, API or local
    • Fast and concurrent API call with configurable rate limit
    • (Work In Progress) support for hundreds of 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:

import lionagi as li

# 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)
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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.