Skip to main content

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 WorkspaceClient protocol;
  • canonical first-party service model names exposed through a typed serviceNames map 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 — structural WorkspaceClient endpoint listing;
  • model_status - daily Databricks retirement-page refresh, parsing, caching, generated fallback selection, and centralized ModelStatus resolution;
  • 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

dbx_tools_model-0.6.180.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

dbx_tools_model-0.6.180-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file dbx_tools_model-0.6.180.tar.gz.

File metadata

  • Download URL: dbx_tools_model-0.6.180.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dbx_tools_model-0.6.180.tar.gz
Algorithm Hash digest
SHA256 379a2b82ffdca36bc3299e12d8b5ece639563da0ce1fc5d294c6e67c7b19891c
MD5 a5b1f90ac238ef9a3875a6e2091abf44
BLAKE2b-256 d39c5a7c38fdc42fc2564774a773ddd322c07f4b17f3ea65d02de989c1dee19c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbx_tools_model-0.6.180.tar.gz:

Publisher: release.yml on reggie-db/dbx-tools

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

File details

Details for the file dbx_tools_model-0.6.180-py3-none-any.whl.

File metadata

File hashes

Hashes for dbx_tools_model-0.6.180-py3-none-any.whl
Algorithm Hash digest
SHA256 7392e7ca50cd8428290568bf68bc1b7e39252391e201215b1bec5351cfd7504d
MD5 a83a0afec61e1e20a61607b517c0f03f
BLAKE2b-256 ed0807b1e9a954aaac15457edb5588941bad258b782b856e724d010316024bc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbx_tools_model-0.6.180-py3-none-any.whl:

Publisher: release.yml on reggie-db/dbx-tools

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

Release history Release notifications | RSS feed

0.6.186

2 files

0.6.185

2 files

0.6.183

2 files

0.6.182

2 files

0.6.181

2 files

This release

0.6.180 This release

2 files

0.6.179

2 files

0.6.177

2 files

0.6.176

2 files

0.6.175

2 files

0.6.174

2 files

0.6.173

2 files

0.6.172

2 files

0.6.171

2 files

0.6.170

2 files

0.6.168

2 files

0.6.163

2 files

0.6.161

2 files

0.6.160

2 files

0.6.158

2 files

0.6.153

2 files

0.6.147

2 files

0.6.146

2 files

0.6.145

2 files

0.6.144

2 files

0.6.143

2 files

0.6.142

2 files

0.6.141

2 files

0.6.140

2 files

0.6.139

2 files

0.6.138

2 files

0.6.137

2 files

0.6.136

2 files

0.6.135

2 files

0.6.134

2 files

0.6.133

2 files

0.6.131

2 files

0.6.130

2 files

0.6.129

2 files

0.6.128

2 files

0.6.127

2 files

0.6.126

2 files

0.6.125

2 files

0.6.124

2 files

0.6.123

2 files

0.6.122

2 files

0.6.121

2 files

0.6.120

2 files

0.6.119

2 files

0.6.118

2 files

0.6.117

2 files

0.6.116

2 files

0.6.115

2 files

0.6.114

2 files

0.6.113

2 files

0.6.112

2 files

0.6.111

2 files

0.6.110

2 files

0.6.109

2 files

0.6.108

2 files

0.6.107

2 files

0.6.106

2 files

0.6.105

2 files

0.6.104

2 files

0.6.103

2 files

0.6.102

2 files

0.6.101

2 files

0.6.100

2 files

0.6.99

2 files

0.6.98

2 files

0.6.97

2 files

0.6.96

2 files

0.6.95

2 files

0.6.94

2 files

0.6.93

2 files

0.6.92

2 files

0.6.91

2 files

0.6.90

2 files

0.6.89

2 files

0.6.88

2 files

0.6.87

2 files

0.6.86

2 files

0.6.85

2 files

0.6.82

2 files

0.6.78

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