A small example package
Project description
Lite LLM Client
This project made for very light llm client.
the main idea is do not use any llm client library.
setup
How to pass API_KEY
- use parameter of LLMConfig
from lite_llm_client import LiteLLMClient, OpenAIConfig, LLMMessage, LLMMessageRole
client = LiteLLMClient(OpenAIConfig(api_key="YOUR API KEY"))
answer = client.chat_completions(messages=[LLMMessage(role=LLMMessage.USER, content="hello ai?")])
print(answer)
- use .env
- rename
.env_exampleto.env - replace YOUR KEY to real api_key
- rename
OPENAI_API_KEY=YOUR KEY
ANTHROPIC_API_KEY=YOUR KEY
GEMINI_API_KEY=YOUR KEY
Known issue
- gemini path may not stable. guide code has
/v1beta/.... sometimes gemini returns http 500 error
Roadmap
Future version
- support multimodal (image and text)
- apply opentelemetry in async functions
0.2.0
-
2025-01-11support json mode(OpenAI) -
2024-11-01apply opentelemetry in sync functions
0.1.2
-
2024-10-25fix exception when use new model name as str type
0.1.0
-
2024-07-21support OpenAI -
2024-07-25support Anthropic -
2024-07-27add options for inference -
2024-07-28support Gemini -
2024-07-30support streaming (OpenAI). simple SSE implement. -
2024-07-31support streaming (Anthropic). -
2024-08-01support streaming (Gemini). unstable google gemini. -
2024-08-13support inference result(token count, stop readon)
Reference
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
lite_llm_client-0.2.0.tar.gz
(13.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lite_llm_client-0.2.0.tar.gz.
File metadata
- Download URL: lite_llm_client-0.2.0.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccb1f6b605cd733476d64e922e167d930995b3b0c4a000f2be5a518a70209bb9
|
|
| MD5 |
b7ad2823c95401499f563991fb6c60b8
|
|
| BLAKE2b-256 |
4363c42905bcc05a7ba2116f2eef99f7b3d2715d4d8ee73127270d8e264b37b7
|
File details
Details for the file lite_llm_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: lite_llm_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b20b1065b58a276f5de64035312bf23afcb147f0ccb53701051741128a65fb9e
|
|
| MD5 |
8a3394eab19847f963f82fe59c185ee7
|
|
| BLAKE2b-256 |
66703dd0771ca9aefdaa14d671264656d79531c42bd749a30c7162a9d05dfd36
|