dbx-tools-model
Python contracts and runtime helpers for Databricks Model Serving. This package
mirrors the reusable parts of @dbx-tools/shared-model and @dbx-tools/model
without AppKit cache or Mastra dependencies.
Install from PyPI:
pip install dbx-tools-model
To install the current main branch directly from the repository instead:
pip install "dbx-tools-model @ git+https://github.com/reggie-db/dbx-tools.git@main#subdirectory=packages/py/model"
Key features:
- stable Pydantic endpoint, profile, query, and ranked-result models;
- live endpoint listing through a structural
WorkspaceClientprotocol; - canonical first-party service model names exposed through a typed
serviceNamesmap on library endpoint results; - score-driven model classification with family fallbacks;
- reasoning-effort levels inferred from Databricks served-entity identity, with endpoint-family fallback for summaries that omit it;
- flexible family, version, and model parsing shared by classification, reasoning, sorting, and downstream integrations;
- exact and fuzzy endpoint resolution with deterministic class ordering;
- Databricks invocation URL and process-serialized per-request authentication helpers, so concurrent SDK refreshes converge;
- shared Responses-only endpoint policy, including Codex and GPT 5.4+ while excluding GPT-OSS;
- OpenAI chat request sanitization, assistant-prefill repair, and content extraction;
- embedding vector extraction with optional dimension validation.
from databricks.sdk import WorkspaceClient
from dbx_tools.model import ModelClass, list_serving_endpoints, resolve_model
endpoints = list_serving_endpoints(WorkspaceClient())
selection = resolve_model(endpoints, model_class=ModelClass.CHAT_BALANCED)
print(selection.model_id)
print(endpoints[0].service_names)
print(
next(
endpoint.reasoning_efforts for endpoint in endpoints if endpoint.name == selection.model_id
)
)
The Python port intentionally omits AppKit CacheManager integration,
Mastra-specific adapters, and browser-only schemas. Callers can cache the plain
Pydantic results with their preferred Python cache.
Model-name parsing produces provider-neutral components without maintaining a second family registry:
from dbx_tools.model.models import parse_model_name
parsed = parse_model_name("databricks-qwen35-122b-a10b")
assert parsed is not None
assert parsed.family == "qwen"
assert parsed.version == (3, 5)
Known first-party identities are keyed by ModelService, such as openai,
anthropic, google, xai, deepseek, moonshot, alibaba, zhipu, and
meta. A model without a canonical name on one of those services has no entry;
the package does not invent names for third-party hosts.
Relationship to the Databricks SDK
Use the native SDK directly when an endpoint name is already known and its typed query method fits the request. Use this package when endpoint choice, stable cross-runtime models, OpenAI-shaped HTTP invocation, or provider-neutral chat and embedding normalization is the repetitive part.
Module map
models— Pydantic wire contracts plus shared family/version/model parsing;reasoning— model-family and served-entity reasoning-level inference;classify,classes,fallback— model taxonomy and ordering;resolve— exact/fuzzy ranking and single-model selection;serving— structuralWorkspaceClientendpoint listing;invoke- URLs, Responses-only policy, process-serialized SDK authentication headers, and JSON POST helpers;chat,embedding— request repair/sanitization and response extraction.
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 dbx_tools_model-0.6.143.tar.gz.
File metadata
- Download URL: dbx_tools_model-0.6.143.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc0c928ca079b43c584afa61e4d22733ecd9fd133a38ad0a3ae0acf3a980f8ed
|
|
| MD5 |
eb22be7a02fd5fc5f1406eefc4a413e5
|
|
| BLAKE2b-256 |
fec83d2cb47ec8cf9f0958a261d1e89cea499f9c906bb5831263b7e07636218f
|
Provenance
The following attestation bundles were made for dbx_tools_model-0.6.143.tar.gz:
Publisher:
python-release.yml on reggie-db/dbx-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbx_tools_model-0.6.143.tar.gz -
Subject digest:
dc0c928ca079b43c584afa61e4d22733ecd9fd133a38ad0a3ae0acf3a980f8ed - Sigstore transparency entry: 2704931320
- Sigstore integration time:
-
Permalink:
reggie-db/dbx-tools@7e55b74751eca540e3e7f813ef0167e2a91aa778 -
Branch / Tag:
refs/tags/v0.6.143 - Owner: https://github.com/reggie-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@7e55b74751eca540e3e7f813ef0167e2a91aa778 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dbx_tools_model-0.6.143-py3-none-any.whl.
File metadata
- Download URL: dbx_tools_model-0.6.143-py3-none-any.whl
- Upload date:
- Size: 18.9 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 |
0138c409f9214998d7656b19b623bda6a3eefaf77ed6236beb0655fee0a7a809
|
|
| MD5 |
73e6f9f5cc890ec8a44242a554a43a61
|
|
| BLAKE2b-256 |
e65d7c0494d7dfb8133dd6316e008a5a46def09824af11105e0be39d8ffb39d7
|
Provenance
The following attestation bundles were made for dbx_tools_model-0.6.143-py3-none-any.whl:
Publisher:
python-release.yml on reggie-db/dbx-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbx_tools_model-0.6.143-py3-none-any.whl -
Subject digest:
0138c409f9214998d7656b19b623bda6a3eefaf77ed6236beb0655fee0a7a809 - Sigstore transparency entry: 2704931372
- Sigstore integration time:
-
Permalink:
reggie-db/dbx-tools@7e55b74751eca540e3e7f813ef0167e2a91aa778 -
Branch / Tag:
refs/tags/v0.6.143 - Owner: https://github.com/reggie-db
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@7e55b74751eca540e3e7f813ef0167e2a91aa778 -
Trigger Event:
push
-
Statement type: