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_model": "model",
"warmup": true,
"wait_seconds_on_llm_retry": [1, 2, 4, 4, 4],
"endpoints": [
{
"key": "model",
"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.1.0.tar.gz
(12.5 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.1.0-py3-none-any.whl
(18.1 kB
view details)
File details
Details for the file mmar_llm-2.1.0.tar.gz.
File metadata
- Download URL: mmar_llm-2.1.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.31
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2f30addc897f3c769b6e9a7845115f2bad3506a272eef7d943013f3f32d991c
|
|
| MD5 |
15af53b85ced9b52f26007d7ee569858
|
|
| BLAKE2b-256 |
85876e39e4c4e53f265b9793648c5157e3410872f03ab0c970df5d73fc116871
|
File details
Details for the file mmar_llm-2.1.0-py3-none-any.whl.
File metadata
- Download URL: mmar_llm-2.1.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.31
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
611154cea0f9dca9b39d2e7df4aeeb895adf527ae9eba41cd8f892175244c60a
|
|
| MD5 |
9c17ee9bae5204b8e6990ae9f552171a
|
|
| BLAKE2b-256 |
a3cc05ba2129bf4c65cb8be1d0ae78c83e215337a97d3c8cc69b554119f2dc38
|