@@ -9,20 +9,36 @@ multiple LLMs through a standardized interface. Based on the OpenAI interface st
9
9
makes it easy to interact with the most popular LLMs and compare the results of their chat based
10
10
functionality, with support for more interfaces coming in the near future.
11
11
12
+ Currently supported providers are -
13
+ OpenAI, Anthropic, Azure, Google, AWS, Groq, Mistral, HuggingFace and Ollama.
14
+ Internally, aisuite uses either the HTTP endpoint or the SDK for making calls to the provider.
15
+
12
16
## Installation
13
17
18
+ This installs just the base package without installing any provider's SDK.
19
+
14
20
``` shell
15
21
pip install aisuite
16
22
```
17
23
24
+ This installs anthropic along with anthropic
25
+ ``` shell
26
+ pip install aisuite[anthropic]
27
+ ```
28
+
29
+ This installs all the provider specific libraries
30
+ ``` shell
31
+ pip install aisuite[all]
32
+ ```
33
+
18
34
## Set up
19
35
20
36
This library provides a thin wrapper around python client libraries to interact with
21
37
various Generative AI providers allowing creators to seamlessly swap out or test responses
22
38
from a number of LLMs without changing their code.
23
39
24
- To get started you will need the API Keys for the providers
25
- you intend to use and install the provider specific library to use.
40
+ To get started you will need the API Keys for the providers you intend to use. You also need to
41
+ install the provider specific library to use either separately or when installing aisuite .
26
42
27
43
The API Keys are expected to be in the host ENV and can be set manually or by using a tool such
28
44
as [ ` python-dotenv ` ] ( https://pypi.org/project/python-dotenv/ ) or [ ` direnv ` ] ( https://direnv.net/ ) .
@@ -35,12 +51,6 @@ export ANTHROPIC_API_KEY="your-anthropic-api-key"
35
51
export OPENAI_API_KEY=" your-openai-api-key"
36
52
```
37
53
38
- Install the respective client libraries:
39
-
40
- ``` shell
41
- pip install openai anthropic
42
- ```
43
-
44
54
In your python code:
45
55
46
56
``` python
@@ -63,13 +73,13 @@ for model in models:
63
73
print (response.choices[0 ].message.content)
64
74
65
75
```
76
+ Note that the model name in the create() call needs to be replaced with ` <provider>:<model-name> `
77
+ aisuite will call the appropriate provider with the right parameters based on the provider value.
78
+ The current list of supported providers can be found by executing ` aisuite.ProviderNames.values() `
66
79
67
80
For more examples, check out the ` examples ` directory where you will find several
68
81
notebooks that you can run to experiment with the interface.
69
82
70
- The current list of supported providers can be found in the ` aisuite.providers `
71
- package.
72
-
73
83
## License
74
84
75
85
aisuite is released under the MIT License. You are free to use, modify, and distribute
0 commit comments