llm wrappers for multimodal architectures team
Project description
mmar-llm
Library to access different LLM's via common API:
- GigaChat
- OpenRouter
- ..
Usage
Create llm_config.json with llm-endpoints:
{
"default_endpoint_key": "endpoint_key",
"warmup": true,
"wait_seconds_on_llm_retry": [1, 2, 4, 4, 4],
"endpoints": [
{
"key": "endpoint_key",
"caption": "GigaChat MAX 2",
"descriptor": "gigachat",
"args": {
"authorization_key": "MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMA=="
}
},
...
]
}
Create llm-hub:
from pathlib import Path
from types import SimpleNamespace
from mmar_llm import LLMConfig, LLMHub
def create_llm_hub(llm_config_path: str, tmp_path: str | None = None):
llm_config = LLMConfig.model_validate_json(Path(llm_config_path).read_text())
llm_hub_config = SimpleNamespace(llm=llm_config, files_dir=tmp_path)
llm_hub = LLMHub(llm_hub_config)
return llm_hub
lh = create_llm_hub('/path/to/llm_config.json')
print(lh.get_response(request='What is your name?'))
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
mmar_llm-2.0.12.tar.gz
(12.1 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
mmar_llm-2.0.12-py3-none-any.whl
(17.2 kB
view details)
File details
Details for the file mmar_llm-2.0.12.tar.gz.
File metadata
- Download URL: mmar_llm-2.0.12.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.31
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10949c15eb29d34b451e6a52ff32b6fa80856395ceb8ec565a3a256c691e0feb
|
|
| MD5 |
6e7f29cd64256b6d2039819ab6aa9db1
|
|
| BLAKE2b-256 |
362f3c76bcd6506b96377d379548400dcda430599b96e7734924409c43e4d0e7
|
File details
Details for the file mmar_llm-2.0.12-py3-none-any.whl.
File metadata
- Download URL: mmar_llm-2.0.12-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.31
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0ec49baa0ff10845cf4227e3590f22a12a150cd51212b4e4246371edaf72faf
|
|
| MD5 |
c3c1af51d8eb79fc35da04152350cbe9
|
|
| BLAKE2b-256 |
fb9243b7e3afa9de84c449c1d6440076e9525cb754d4f97f184f1406bb2cf2fc
|