abstraction-model, in Python
Whether two strings from two hosts name one model. Hugging Face, Ollama, LM Studio and a directory on disk each write the same weights a different way, so an application that has already downloaded a model cannot tell that the one it is about to fetch is the same file.
Every token that is not known packaging is kept. The reverse rule — a list of noise to strip — collapses a fine-tune onto the model it was tuned from, and then a request for one is answered by the other. One module, standard library only, importing nothing of ours.
This page is the Python package. The Go implementation, the store side and what
is UNPROVEN are on
the repository.
Install
Not on PyPI, and the name on PyPI is not ours.
git clone https://github.com/openabstractions/abstraction-model
pip install ./abstraction-model/python
Python 3.9 or later. abstraction_model.py is one file with no imports of ours,
so copying it into a _vendor/ directory of your own is an equally complete
installation.
An example that runs
import abstraction_model as model
a = "bartowski/Qwen2.5-0.5B-Instruct-GGUF/Qwen2.5-0.5B-Instruct-IQ2_M.gguf"
b = "qwen2.5:0.5b-instruct-q4_K_M"
print(model.parse(a))
print(model.parse(b))
print("same model:", model.same(a, b))
print("same file: ", model.parse(a) == model.parse(b))
Two quantisations of one model are the same model and are still two files on
disk, and that is the distinction the layer exists to make: same answers the
routing question, equality of the parsed Name answers the storage one.
What an application calls
| call | what it does |
|---|---|
parse(s) |
a Name with family and quant |
family(s) |
the family alone: what survives packaging, host prefixes and file extensions |
same(a, b) |
whether two host identifiers name one model for routing |
shard(name) |
the shard a multi-file model's part belongs to, when the name says |
What may break
- This module answers about names and nothing else. It does not download, does not hash and never touches a store.
- The algorithm is a judgment, not a standard. It is compared against the Go implementation over a shared corpus of identifiers, so the two agree; there is no third party to be right against.
- No conformance verdict. No scenario in the suite cites this layer yet — what is proven and what is not.
- Not on any package index, and no release carries an API stability promise. Pin a commit you have read.
Apache-2.0. See LICENSE.
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 abstraction_model-0.1.0.tar.gz.
File metadata
- Download URL: abstraction_model-0.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a02aa09cb2147004682a324646fefe36873a0d4b83ebb713dedf43a84f50629a
|
|
| MD5 |
49371b1b8a93004f413d4d1c43bb9d77
|
|
| BLAKE2b-256 |
75105ced279cd433e747e46ae041aa325208329cbe58637e3628eb6932cdf7ee
|
Provenance
The following attestation bundles were made for abstraction_model-0.1.0.tar.gz:
Publisher:
publish.yml on openabstractions/abstraction-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstraction_model-0.1.0.tar.gz -
Subject digest:
a02aa09cb2147004682a324646fefe36873a0d4b83ebb713dedf43a84f50629a - Sigstore transparency entry: 2784018396
- Sigstore integration time:
-
Permalink:
openabstractions/abstraction-model@595f55592f3cc095b259faa05774895fbdcd1fca -
Branch / Tag:
refs/tags/python/v0.1.0 - Owner: https://github.com/openabstractions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@595f55592f3cc095b259faa05774895fbdcd1fca -
Trigger Event:
push
-
Statement type:
File details
Details for the file abstraction_model-0.1.0-py3-none-any.whl.
File metadata
- Download URL: abstraction_model-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3283f73665de720115455ba64798ccbe8bb87dc77d0a3a9ee84d3292ee64305b
|
|
| MD5 |
e3fe2d1762af25d168a100184f581a94
|
|
| BLAKE2b-256 |
e61acda46e6c53bb800f194c80e2c93a9201dc93e54c285c019740f6d1d59177
|
Provenance
The following attestation bundles were made for abstraction_model-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on openabstractions/abstraction-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstraction_model-0.1.0-py3-none-any.whl -
Subject digest:
3283f73665de720115455ba64798ccbe8bb87dc77d0a3a9ee84d3292ee64305b - Sigstore transparency entry: 2784018421
- Sigstore integration time:
-
Permalink:
openabstractions/abstraction-model@595f55592f3cc095b259faa05774895fbdcd1fca -
Branch / Tag:
refs/tags/python/v0.1.0 - Owner: https://github.com/openabstractions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@595f55592f3cc095b259faa05774895fbdcd1fca -
Trigger Event:
push
-
Statement type: