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;
- daily retirement-status discovery from the Databricks policy page, with a disk and memory cache plus a generated fallback, so endpoint listing excludes deprecated models even when the serving API reports them as ready;
- 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.
Endpoint listing excludes deprecated models by default. Pass
include_deprecated=True to include them alongside current endpoints.
ModelQuery.include_deprecated defaults to False and applies the same
behavior during model lookup through the includeDeprecated wire field. Every
endpoint carries a status: ModelStatus field. model_status.get() resolves
that dataclass from all known endpoint identities so additional status fields
can be added in one place.
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;model_status- daily Databricks retirement-page refresh, parsing, caching, generated fallback selection, and centralizedModelStatusresolution;invoke- URLs, Responses-only policy, process-serialized SDK authentication headers, and JSON POST helpers;chat,embedding— request repair/sanitization and response extraction.
Metadata
Release files for dbx-tools-model 0.6.186
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dbx_tools_model-0.6.186.tar.gz | 19.0 kB | With provenance | Details for dbx_tools_model-0.6.186.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dbx_tools_model-0.6.186-py3-none-any.whl | Python 3 | none | any | Details for dbx_tools_model-0.6.186-py3-none-any.whl |
Total release size: 43.4 kB
Release files / dbx_tools_model-0.6.186.tar.gz
| Download URL | dbx_tools_model-0.6.186.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39d5f59d995488e9ff1b05bd8138d6878e57f2739124179047374f74a801d9d1
|
|
BLAKE2b-256 checksum How to use checksums |
ad65b6984062864c27bbf9f8bed609c6271bfdf9b5fb6a89897f43f2cea64cf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 9, 2026.
Transparency logRelease files / dbx_tools_model-0.6.186-py3-none-any.whl
| Download URL | dbx_tools_model-0.6.186-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
837b5b971de085602759ab4dd9894a04ff8833544677aba61af5b4af7ae067bc
|
|
BLAKE2b-256 checksum How to use checksums |
29b92017971fe083df4445dd72a13ebfdcfeddc87b45fba3598413a03bdead82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 9, 2026.
Transparency logSecurity for dbx-tools-model 0.6.186
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.
Attestation for dbx_tools_model-0.6.186.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 Sep 9, 2026.
Transparency logA 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.