easyai4all


Nameeasyai4all JSON
Version 0.0.2 PyPI version JSON
download
home_pageNone
SummaryEasyAI4All: Unified LLM Interface
upload_time2024-12-08 10:39:18
maintainerNone
docs_urlNone
authorNone
requires_python<3.12,>=3.10
licenseMIT License Copyright (c) 2024 Balaji Rama Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords interface llm unify
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # easyai4all

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Truly unified & comprehensive interface to multiple Generative AI providers.

Inspired from `aisuite` by Andrew Ng and `litellm` by BerriAI, `easyai4all` unifies the various LLM providers under a single interface. Derived from the OpenAI specification, `easyai4all` allows users to interact with all kinds of LLMs, with a standardized input/output format. `easyai4all` is a comprehensive wrapper, meaning that all functionalities supported by the individual LLM providers are available through `easyai4all`.

Currently supported providers, along with functionalities are -

| LLM Provider | Is Supported | JSON Mode | Tool Calling |
|--------------|--------------|-----------|--------------|
| OpenAI | ✅ | ✅ | ✅ |
| Anthropic | ✅ | ✅ | ❌ |
| Google (Gemini) | ✅ | ✅ | ✅ |

> [!TIP] 
>
> Unlike `aisuite` and `litellm`, we directly interact with the LLMs via REST API's over HTTPS, meaning no external client dependencies or abstractions. This allows `easyai4all` to be extremely lightweight (only one dependency - `httpx`)!


## Installation

You can install `easyai4all` via PyPI

```shell
pip install easyai4all
```

## Set up

<!-- To get started, you will need API Keys for the providers you intend to use. You'll need to
install the provider-specific library either separately or when installing aisuite.

The API Keys can be set as environment variables, or can be passed as config to the aisuite Client constructor.
You can use tools like [`python-dotenv`](https://pypi.org/project/python-dotenv/) or [`direnv`](https://direnv.net/) to set the environment variables manually. Please take a look at the `examples` folder to see usage.

Here is a short example of using `aisuite` to generate chat completion responses from gpt-4o and claude-3-5-sonnet.

Set the API keys.
```shell
export OPENAI_API_KEY="your-openai-api-key"
export ANTHROPIC_API_KEY="your-anthropic-api-key"
```

Use the python client.
```python
import aisuite as ai
client = ai.Client()

models = ["openai:gpt-4o", "anthropic:claude-3-5-sonnet-20240620"]

messages = [
    {"role": "system", "content": "Respond in Pirate English."},
    {"role": "user", "content": "Tell me a joke."},
]

for model in models:
    response = client.chat.completions.create(
        model=model,
        messages=messages,
        temperature=0.75
    )
    print(response.choices[0].message.content)

```
Note that the model name in the create() call uses the format - `<provider>:<model-name>`.
`aisuite` will call the appropriate provider with the right parameters based on the provider value.
For a list of provider values, you can look at the directory - `aisuite/providers/`. The list of supported providers are of the format - `<provider>_provider.py` in that directory. We welcome  providers adding support to this library by adding an implementation file in this directory. Please see section below for how to contribute.

For more examples, check out the `examples` directory where you will find several notebooks that you can run to experiment with the interface. -->

## License

`easyai4all` is released under the MIT License. You are free to use, modify, and distribute the code for both commercial and non-commercial purposes.

## Contributing

<!-- If you would like to contribute, please read our [Contributing Guide](https://github.com/andrewyng/aisuite/blob/main/CONTRIBUTING.md) and join our [Discord](https://discord.gg/T6Nvn8ExSb) server! -->

## Adding support for a provider
We have made easy for a provider or volunteer to add support for a new platform.

TBD
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "easyai4all",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.10",
    "maintainer_email": null,
    "keywords": "interface, llm, unify",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/91/fb/96ba507342a2f4406e7a3168cc5ce0891874698515fe65227992505f1d20/easyai4all-0.0.2.tar.gz",
    "platform": null,
    "description": "# easyai4all\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nTruly unified & comprehensive interface to multiple Generative AI providers.\n\nInspired from `aisuite` by Andrew Ng and `litellm` by BerriAI, `easyai4all` unifies the various LLM providers under a single interface. Derived from the OpenAI specification, `easyai4all` allows users to interact with all kinds of LLMs, with a standardized input/output format. `easyai4all` is a comprehensive wrapper, meaning that all functionalities supported by the individual LLM providers are available through `easyai4all`.\n\nCurrently supported providers, along with functionalities are -\n\n| LLM Provider | Is Supported | JSON Mode | Tool Calling |\n|--------------|--------------|-----------|--------------|\n| OpenAI | \u2705 | \u2705 | \u2705 |\n| Anthropic | \u2705 | \u2705 | \u274c |\n| Google (Gemini) | \u2705 | \u2705 | \u2705 |\n\n> [!TIP] \n>\n> Unlike `aisuite` and `litellm`, we directly interact with the LLMs via REST API's over HTTPS, meaning no external client dependencies or abstractions. This allows `easyai4all` to be extremely lightweight (only one dependency - `httpx`)!\n\n\n## Installation\n\nYou can install `easyai4all` via PyPI\n\n```shell\npip install easyai4all\n```\n\n## Set up\n\n<!-- To get started, you will need API Keys for the providers you intend to use. You'll need to\ninstall the provider-specific library either separately or when installing aisuite.\n\nThe API Keys can be set as environment variables, or can be passed as config to the aisuite Client constructor.\nYou can use tools like [`python-dotenv`](https://pypi.org/project/python-dotenv/) or [`direnv`](https://direnv.net/) to set the environment variables manually. Please take a look at the `examples` folder to see usage.\n\nHere is a short example of using `aisuite` to generate chat completion responses from gpt-4o and claude-3-5-sonnet.\n\nSet the API keys.\n```shell\nexport OPENAI_API_KEY=\"your-openai-api-key\"\nexport ANTHROPIC_API_KEY=\"your-anthropic-api-key\"\n```\n\nUse the python client.\n```python\nimport aisuite as ai\nclient = ai.Client()\n\nmodels = [\"openai:gpt-4o\", \"anthropic:claude-3-5-sonnet-20240620\"]\n\nmessages = [\n    {\"role\": \"system\", \"content\": \"Respond in Pirate English.\"},\n    {\"role\": \"user\", \"content\": \"Tell me a joke.\"},\n]\n\nfor model in models:\n    response = client.chat.completions.create(\n        model=model,\n        messages=messages,\n        temperature=0.75\n    )\n    print(response.choices[0].message.content)\n\n```\nNote that the model name in the create() call uses the format - `<provider>:<model-name>`.\n`aisuite` will call the appropriate provider with the right parameters based on the provider value.\nFor a list of provider values, you can look at the directory - `aisuite/providers/`. The list of supported providers are of the format - `<provider>_provider.py` in that directory. We welcome  providers adding support to this library by adding an implementation file in this directory. Please see section below for how to contribute.\n\nFor more examples, check out the `examples` directory where you will find several notebooks that you can run to experiment with the interface. -->\n\n## License\n\n`easyai4all` is released under the MIT License. You are free to use, modify, and distribute the code for both commercial and non-commercial purposes.\n\n## Contributing\n\n<!-- If you would like to contribute, please read our [Contributing Guide](https://github.com/andrewyng/aisuite/blob/main/CONTRIBUTING.md) and join our [Discord](https://discord.gg/T6Nvn8ExSb) server! -->\n\n## Adding support for a provider\nWe have made easy for a provider or volunteer to add support for a new platform.\n\nTBD",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Balaji Rama  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "EasyAI4All: Unified LLM Interface",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/BRama10/easyai4all",
        "Repository": "https://github.com/BRama10/easyai4all.git"
    },
    "split_keywords": [
        "interface",
        " llm",
        " unify"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "781a161327fc36f963388c9c16923dcb97ce2a10cd22d6a3b909af4532c8e4f8",
                "md5": "4c157a7ff6c2fdff9e585ef03980701b",
                "sha256": "0d447ce7742d9ac19be2690837bc0014b22ccae4bbd86be657c1023bc9102d62"
            },
            "downloads": -1,
            "filename": "easyai4all-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4c157a7ff6c2fdff9e585ef03980701b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.10",
            "size": 20603,
            "upload_time": "2024-12-08T10:39:16",
            "upload_time_iso_8601": "2024-12-08T10:39:16.346310Z",
            "url": "https://files.pythonhosted.org/packages/78/1a/161327fc36f963388c9c16923dcb97ce2a10cd22d6a3b909af4532c8e4f8/easyai4all-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91fb96ba507342a2f4406e7a3168cc5ce0891874698515fe65227992505f1d20",
                "md5": "2a3595df6039a7ddc7f6c8f92499f09a",
                "sha256": "eb2d4369c25712093db79fd4167a7bc4c23afbfcb7787b41999ed4292f3b3f70"
            },
            "downloads": -1,
            "filename": "easyai4all-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2a3595df6039a7ddc7f6c8f92499f09a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.10",
            "size": 10823,
            "upload_time": "2024-12-08T10:39:18",
            "upload_time_iso_8601": "2024-12-08T10:39:18.183561Z",
            "url": "https://files.pythonhosted.org/packages/91/fb/96ba507342a2f4406e7a3168cc5ce0891874698515fe65227992505f1d20/easyai4all-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-08 10:39:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "BRama10",
    "github_project": "easyai4all",
    "github_not_found": true,
    "lcname": "easyai4all"
}
        
Elapsed time: 0.98261s