Common interface for language models.
Project description
llm-providers
A common, minimal-dependency, async-first interface for interacting with Large Language Model provider APIs.
Getting Started
pip install llm-providers
from llm_providers.openai import OpenAIProvider
async def main():
provider = OpenAIProvider(
connection_str=os.environ.get("OPENAI_API_KEY"),
)
completion = await provider.complete(prompt="hey i'm a robot who")
assert completion.prompt == "hey i'm a robot who"
assert type(completion.completion_text) == str
if __name__ == "__main__":
asyncio.run(main())
License
This project is licensed under the Apache License
Acknowledgments
Much code borrowed from https://github.com/HazyResearch/manifest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
llm_providers-0.1.0.tar.gz
(14.9 kB
view details)
Built Distribution
File details
Details for the file llm_providers-0.1.0.tar.gz
.
File metadata
- Download URL: llm_providers-0.1.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41b345a6f9eac872fdf32003309c85a754eb652f8d2100b31d008b5b11a5dd5c |
|
MD5 | fc7eb747d7ef946f22ecd2d9d62dcfa3 |
|
BLAKE2b-256 | 4e954e692627466ad0890f64f93e66191f5effa7d3356058b45ef8d0c0429dbf |
File details
Details for the file llm_providers-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: llm_providers-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f73cf280985304866b9fdedb6d5fbf86b971c225bcd2138d20b82f4646bb7486 |
|
MD5 | 248b03303a439cd7513b1383882ae5fe |
|
BLAKE2b-256 | 52865d1f3ee16019a7b8fcad93d4121b9b7641bb01c8c4907dc5a545f0d401e1 |