Skip to main content

llm_model_alias

A standalone Python package for resolving model aliases across platforms (vllm, vllm-metal, ollama, openai, custom) with JSON-backed mappings.

Features

  • Resolve a model alias to a platform-specific model id.
  • Store mappings in a JSON file.
  • Seed defaults from packaged mappings.
  • Pass through openai and custom model names unchanged.
  • Local-only is_downloaded checks for Ollama and Hugging Face cache.

Installation

From the llm_model_alias directory:

pip install -e .

Public API

  • Class: LLMModelAlias
  • Types: ModelPlatform, ModelPlatformMapping, ModelMapping, ResolvedModelMapping
  • Constant: MODEL_PLATFORMS

Main methods:

  • resolve(model_name, platform) -> str
  • get(model_name, platform) -> ResolvedModelMapping
  • is_downloaded(model_name, platform) -> bool
  • load() -> list[ModelMapping]
  • json_path() -> Path
  • normalize_model_name(model_name) -> str
  • ollama_url() -> str

Configuration

Mapping file location

JSON schema:

{
  "mappings": []
}

Path precedence:

  1. data_file constructor parameter
  2. MODEL_ALIAS_JSON_FILE environment variable
  3. OS default path

If the selected path does not exist and data_file is not explicitly provided, packaged defaults are loaded from src/llm_model_alias/data/default_model_mappings.json.

OS defaults:

  • Linux: ${XDG_DATA_HOME:-~/.local/share}/llm_model_alias/model_mappings.json
  • macOS: ~/Library/Application Support/llm_model_alias/model_mappings.json

Ollama URL

URL precedence:

  1. ollama_url constructor parameter
  2. MODEL_ALIAS_OLLAMA_URL environment variable
  3. http://localhost:11434

Usage

from pathlib import Path

from llm_model_alias import LLMModelAlias

alias = LLMModelAlias(
  data_file=Path("./model_mappings.json"),
  ollama_url="http://localhost:11434",
)

resolved = alias.resolve("qwen3.5:9b", "vllm")
print(resolved)

mapping = alias.get("qwen3.5:9b", "vllm")
print(mapping)

Notes

  • Default mappings live at src/llm_model_alias/data/default_model_mappings.json.

Metadata

Release files for llm-model-alias 0.1.0

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

Source distribution (sdist)

Source distribution for llm-model-alias 0.1.0
File Size Uploaded Provenance
llm_model_alias-0.1.0.tar.gz 23.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-model-alias 0.1.0
File Interpreter ABI Platform
llm_model_alias-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / llm_model_alias-0.1.0.tar.gz

Download URL llm_model_alias-0.1.0.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
317b39104a4017d2b545042f6a5e0f5f71d3099b722bf2ef5a8216531d11cb34
BLAKE2b-256 checksum
How to use checksums
36a928bae55c5c4dc1375afd9b3790a62daab8ec17df19ed924df41967b77ec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 10, 2026.

Transparency log

Release files / llm_model_alias-0.1.0-py3-none-any.whl

Download URL llm_model_alias-0.1.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53e7fab0b980fefac5314d103f4cbb42eca4bd47b422f3abf68c490cc5114d7e
BLAKE2b-256 checksum
How to use checksums
82b11450eac60f778050ef5d4c606e4daf2eef8177e1de4b3b2d526d6c16be07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 10, 2026.

Transparency log

Security for llm-model-alias 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llm_model_alias-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 10, 2026.

Transparency log

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

0.1.0 This release

2 release files Full 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