Standalone model alias resolver
Project description
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
openaiandcustommodel names unchanged. - Local-only
is_downloadedchecks 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) -> strget(model_name, platform) -> ResolvedModelMappingis_downloaded(model_name, platform) -> boolload() -> list[ModelMapping]json_path() -> Pathnormalize_model_name(model_name) -> strollama_url() -> str
Configuration
Mapping file location
JSON schema:
{
"mappings": []
}
Path precedence:
data_fileconstructor parameterMODEL_ALIAS_JSON_FILEenvironment variable- 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:
ollama_urlconstructor parameterMODEL_ALIAS_OLLAMA_URLenvironment variablehttp://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.
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
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
File details
Details for the file llm_model_alias-0.1.0.tar.gz.
File metadata
- Download URL: llm_model_alias-0.1.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
317b39104a4017d2b545042f6a5e0f5f71d3099b722bf2ef5a8216531d11cb34
|
|
| MD5 |
e777005a6be315c6cf418b95e5a3d694
|
|
| BLAKE2b-256 |
36a928bae55c5c4dc1375afd9b3790a62daab8ec17df19ed924df41967b77ec4
|
Provenance
The following attestation bundles were made for llm_model_alias-0.1.0.tar.gz:
Publisher:
publish.yml on charlesverge/llm-model-alias
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_model_alias-0.1.0.tar.gz -
Subject digest:
317b39104a4017d2b545042f6a5e0f5f71d3099b722bf2ef5a8216531d11cb34 - Sigstore transparency entry: 1271961499
- Sigstore integration time:
-
Permalink:
charlesverge/llm-model-alias@d25499a4356970b97ef8bc87b1066eaf60a693fb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/charlesverge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d25499a4356970b97ef8bc87b1066eaf60a693fb -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file llm_model_alias-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_model_alias-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53e7fab0b980fefac5314d103f4cbb42eca4bd47b422f3abf68c490cc5114d7e
|
|
| MD5 |
e500c2708d4d89988d652f1782f21f8b
|
|
| BLAKE2b-256 |
82b11450eac60f778050ef5d4c606e4daf2eef8177e1de4b3b2d526d6c16be07
|
Provenance
The following attestation bundles were made for llm_model_alias-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on charlesverge/llm-model-alias
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_model_alias-0.1.0-py3-none-any.whl -
Subject digest:
53e7fab0b980fefac5314d103f4cbb42eca4bd47b422f3abf68c490cc5114d7e - Sigstore transparency entry: 1271961611
- Sigstore integration time:
-
Permalink:
charlesverge/llm-model-alias@d25499a4356970b97ef8bc87b1066eaf60a693fb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/charlesverge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d25499a4356970b97ef8bc87b1066eaf60a693fb -
Trigger Event:
workflow_dispatch
-
Statement type: