A simple library for making requests to LLMs
Project description
LLMLib
LLMLib is a simple Python library for making requests to Language Learning Models (LLMs) such as OpenAI's GPT and Anthropic's Claude.
Installation
You can install LLMLib using pip:
pip install llmlib-amq
Usage
Here's a quick example of how to use LLMLib:
from llmlib import LLMClient, LLMRequest, Provider, OpenAIModel, Message
client = LLMClient(
openai_api_key="your-openai-api-key",
anthropic_api_key="your-anthropic-api-key"
)
request = LLMRequest(
provider=Provider.OPENAI,
model=OpenAIModel.GPT_3_5_TURBO,
messages=[
Message(role="system", content="You are a helpful assistant."),
Message(role="user", content="Tell me a joke.")
],
stream=True
)
for chunk in client.generate(request):
print(chunk, end="", flush=True)
License
This project is licensed under the MIT License.
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
llmlib_amq-0.0.2.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for llmlib_amq-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03558b4a35ec24099dbe5ea146d425096577d63a946b07f1f97dc1515e2d77ba |
|
MD5 | 9767c7ff2fe7079ca16448ab6c754c39 |
|
BLAKE2b-256 | cedf45dde9669147b64f2f48a09ccd81ca116db7d0efeb195d3f7c985b1848ce |