A toolkit for initializing LLMs and embeddings with multiple providers
Project description
Init LLM
A toolkit for initializing LLMs(Langchain) and embeddings with multiple providers. All models are openai compatible.
Installation
pip install init-llm
Quick Start
from init_llm import ChatLLM, EmbeddingLLM
# Initialize chat model
llm = ChatLLM('openai') # or 'azure', 'anthropic', etc.
response = llm.invoke('Hello!')
# Initialize embeddings
embeddings = EmbeddingLLM('text-embedding-3-small')
vector = embeddings.embed_query('Hello world')
Configuration
The package uses two configuration files:
model_providers.toml: Model configurations and provider settings.env: API keys and other sensitive information
Auto Configuration
On first use, the package will:
- Check for configuration files in the working directory
- If not found, create them automatically with default settings
- Load environment variables from
.env
Custom Configuration
You can specify custom configuration location and env file name:
llm = ChatLLM(
'openai',
config_dir='/path/to/config',
env_file='custom.env'
)
See Supported Providers in model_providers.toml
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
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 init_llm-0.1.3.tar.gz.
File metadata
- Download URL: init_llm-0.1.3.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b3e3203a4f09e7093d1685dcc7167737b41389aa1ea8890dfa6b5a4c1cd5a55
|
|
| MD5 |
23f808075d29ecc83ad31da258659f24
|
|
| BLAKE2b-256 |
08820e61c8934174cd24ae15809ed404660e2dcffb916e26fbd9f308552fe37e
|
File details
Details for the file init_llm-0.1.3-py3-none-any.whl.
File metadata
- Download URL: init_llm-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62fe220f2ef0e5e216ecb10ade92c4bb2a196285858eae83210d40ad7348c3d2
|
|
| MD5 |
e5e93ade0ec46a6ec43c089e77e0b1aa
|
|
| BLAKE2b-256 |
1082a2b3befdddc46f50ce3d06efdc264ee6d618e843e43e616381bc81e90864
|