Skip to main content

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

abstraction_model-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

abstraction_model-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

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

Hashes for abstraction_model-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a02aa09cb2147004682a324646fefe36873a0d4b83ebb713dedf43a84f50629a
MD5 49371b1b8a93004f413d4d1c43bb9d77
BLAKE2b-256 75105ced279cd433e747e46ae041aa325208329cbe58637e3628eb6932cdf7ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstraction_model-0.1.0.tar.gz:

Publisher: publish.yml on openabstractions/abstraction-model

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file abstraction_model-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abstraction_model-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3283f73665de720115455ba64798ccbe8bb87dc77d0a3a9ee84d3292ee64305b
MD5 e3fe2d1762af25d168a100184f581a94
BLAKE2b-256 e61acda46e6c53bb800f194c80e2c93a9201dc93e54c285c019740f6d1d59177

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstraction_model-0.1.0-py3-none-any.whl:

Publisher: publish.yml on openabstractions/abstraction-model

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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