Skip to main content

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?'))

Metadata

Release files for mmar-llm 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mmar-llm 2.1.1
File Size Uploaded Provenance Actions
mmar_llm-2.1.1.tar.gz 12.5 kB Without provenance Details for mmar_llm-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mmar-llm 2.1.1
File Interpreter ABI Platform Actions
mmar_llm-2.1.1-py3-none-any.whl Python 3 none any Details for mmar_llm-2.1.1-py3-none-any.whl

Total release size: 30.6 kB

Release files / mmar_llm-2.1.1.tar.gz

Download URL mmar_llm-2.1.1.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d5356e7ff8a164ddff401c42a55e015acfb2647e924f287fa41297f26c773792
BLAKE2b-256 checksum
How to use checksums
091d24c59901f5f63fcfd7b58f05838dc4236d86ea6888e616b586b0e188c506
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.31

Release files / mmar_llm-2.1.1-py3-none-any.whl

Download URL mmar_llm-2.1.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06bdcb85153e873bbce9fed6c04b5c3eae40b7c7e622039b33f19f83652296d5
BLAKE2b-256 checksum
How to use checksums
317550ddd2be496a79387dfe44ec13532c017bb33537c08ed5560ae6c7e23177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.31

Security for mmar-llm 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page