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.19.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.0.19-py3-none-any.whl
(18.1 kB
view details)
File details
Details for the file mmar_llm-2.0.19.tar.gz.
File metadata
- Download URL: mmar_llm-2.0.19.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 |
5c4320c7620340605954bddc551cd844a7443fe3824c34a7601523c786393a1e
|
|
| MD5 |
2da0136b1b7b08f22a0fce5900483694
|
|
| BLAKE2b-256 |
fc6e3c02218a121914e4b0965c54fce6f7ec9a02d23fa695cbf800f804467e8c
|
File details
Details for the file mmar_llm-2.0.19-py3-none-any.whl.
File metadata
- Download URL: mmar_llm-2.0.19-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 |
ce26619abff8a13cd0ce9faadab7ae1559674909976a8b2a433f7ab7f57c37ce
|
|
| MD5 |
ff3daab752d92202fcf3031260b12e56
|
|
| BLAKE2b-256 |
0a80100b1203a8ab241c56c137998d6675fd9437c369097bf66d986e1e2872e9
|