Skip to main content

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


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.16.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmar_llm-2.0.16-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file mmar_llm-2.0.16.tar.gz.

File metadata

  • Download URL: mmar_llm-2.0.16.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.31

File hashes

Hashes for mmar_llm-2.0.16.tar.gz
Algorithm Hash digest
SHA256 44cc3c4e6e3c6b81a9d3a4ab361fccbd5a9f6debb7d6e6fba573c518d0e6d8d9
MD5 614b3d6f4643c3f0965fd6c14019788d
BLAKE2b-256 32792c1083a487277c727d1268cc89bbfb1f9d1c91598072db6336b525c4c7eb

See more details on using hashes here.

File details

Details for the file mmar_llm-2.0.16-py3-none-any.whl.

File metadata

  • Download URL: mmar_llm-2.0.16-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

Hashes for mmar_llm-2.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 c52cfd4870f9bfb331b1c2e30156fdbb874f4edf41d5e10853cde1e7a45961ac
MD5 cb942d89cc3b68a712c5feebdec85802
BLAKE2b-256 17e050e578cdd99fcf80774e28ddf3f68c80e817dcdd5c96232363269a750d06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page