Repository navigation
feat: add model_service resource type for Unity AI Gateway - #649
MarioCadenas wants to merge 3 commits into
Conversation
Add support for Unity AI Gateway V3 model services as an app resource type: - Register model_service in resource type registry with EXECUTE permission - Configure DABs binding to uc_securable with MODEL_SERVICE securable_type - Add model_service as optional resource in agents plugin with default env var - Update model routing in agents plugin to route dotted names (catalog.schema.name) to AI Gateway instead of just system.* prefix - Add environment variable precedence: MODEL_SERVICE_NAME beats SERVING_ENDPOINT_NAME Model services are service-principal only (no OBO scope), matching the contract from the backend (universe PRs 2571640..2589111, behind enableModelServiceAsAppsResource). Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
📦 Bundle size reportCompared against
|
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 1.2 MB (+835 B) | 447 KB (+180 B) |
| Type declarations | 459 KB (+3.3 KB) | 165 KB (+74 B) |
| Source maps | 2.5 MB (+1.2 KB) | 837 KB (+173 B) |
| Other | 11 KB | 3.7 KB |
| Total | 4.1 MB (+5.3 KB) | 1.4 MB (+427 B) |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
102 KB (+54 B) | 2.5 KB (+1 B) | 105 KB (+55 B) | external | 332 KB (+237 B) |
./beta |
99 KB (+146 B) | 484 B | 99 KB (+146 B) | external | 298 KB (+664 B) |
./testing |
42 KB (+76 B) | 32 KB (-2 B) | 74 KB (+74 B) | external | 215 KB (+235 B) |
./tsdown |
520 B | 0 B | 520 B | external | 813 B |
./type-generator |
23 KB | 0 B | 23 KB | external | 66 KB |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 97 KB |
. |
utils.js |
initial | 4.6 KB |
. |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./beta |
beta.js |
initial | 81 KB |
./beta |
stream-manager.js |
initial | 5.9 KB |
./beta |
service-context.js |
initial | 4.2 KB |
./beta |
databricks.js |
initial | 3.3 KB |
./beta |
wide-event-emitter.js |
initial | 3.2 KB |
./beta |
client.js |
initial | 594 B |
./beta |
index.js |
initial | 20 B |
./beta |
supervisor-api.js |
lazy | 192 B |
./beta |
databricks.js |
lazy | 177 B |
./beta |
index.js |
lazy | 115 B |
./testing |
manifest.js |
initial | 29 KB |
./testing |
index.js |
initial | 10 KB |
./testing |
wide-event-emitter.js |
initial | 2.9 KB |
./testing |
index.js |
lazy | 28 KB |
./testing |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./testing |
utils.js |
lazy | 1.8 KB |
./tsdown |
index.js |
initial | 520 B |
./type-generator |
index.js |
initial | 23 KB |
@databricks/appkit-ui
npm tarball (packed): 397 KB (+4 B) — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 428 KB | 146 KB |
| Type declarations | 266 KB | 98 KB (+1 B) |
| Source maps | 852 KB | 285 KB |
| CSS | 16 KB | 3.2 KB |
| Total | 1.5 MB | 533 KB (+1 B) |
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
./js |
5.3 KB | 49 KB | 55 KB | 208 KB | 14 KB |
./js/beta |
2.1 KB | 0 B | 2.1 KB | 0 B | 5.0 KB |
./react |
433 KB | 49 KB | 481 KB | 1.3 MB | 177 KB |
./react/beta |
4.9 KB | 0 B | 4.9 KB | 0 B | 12 KB |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
./js |
index.js |
initial | 5.2 KB |
./js |
chunk |
initial | 120 B |
./js |
apache-arrow |
lazy | 49 KB |
./js/beta |
beta.js |
initial | 2.1 KB |
./react |
index.js |
initial | 431 KB |
./react |
tslib |
initial | 2.1 KB |
./react |
apache-arrow |
lazy | 49 KB |
./react/beta |
beta.js |
initial | 4.9 KB |
Add unit tests for model_service resource type: - adapterFromModelString routing: verify dotted user model service names route to AI Gateway - manifest schema validation: model_service accepts EXECUTE permission and rejects others - DABs binding: verify model_service uses uc_securable with MODEL_SERVICE securable_type - scope and appOnly: verify model_service is SP-only (not in SCOPE_BY_TYPE or APP_ONLY) Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 37909750859 -R databricks/appkit -n appkit-template-0.87.0-pr.66c5199-feat-model-service-resource-649 -D appkit-pr-649 \
&& unzip -o "appkit-pr-649/appkit-template-0.87.0-pr.66c5199-feat-model-service-resource-649.zip" -d "appkit-pr-649" \
&& databricks apps init --template "appkit-pr-649"The template pins |
- Add tests for the agents plugin default model: DATABRICKS_MODEL_SERVICE_NAME wins over DATABRICKS_SERVING_ENDPOINT_NAME, config defaultModel wins over both, and the error names both env vars. - Regenerate docs/static/schemas/template-plugins.schema.json for the new model_service resource type (CI checks generated files are up to date). Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
|
This pull request has had no activity for 23 days and has been marked as stale. It will be closed in 7 days if there is no further activity. Add a comment, push a commit, or apply the |
Summary
Add Unity AI Gateway (Unity Gateway V3) model services as an app resource type, and let the agents plugin use one as its default model. The backend models a model service as the existing
uc_securableapp resource withsecurable_type: MODEL_SERVICEand a singleEXECUTEpermission, behind theenableModelServiceAsAppsResourceSAFE flag (universe PRs 2571640, 2571642, 2571645, 2586620, 2589111).Changes
model_serviceas a resource type: manifest schema, permission schema (EXECUTEonly), DABs binding table, plugin-create defaults, generated registry types, and the generated JSON schemas.agents-model-serviceresource (fieldname, envDATABRICKS_MODEL_SERVICE_NAME,EXECUTE). The existingagents-serving-endpointresource is unchanged.defaultModelconfig, thenDATABRICKS_MODEL_SERVICE_NAME, thenDATABRICKS_SERVING_ENDPOINT_NAME. The no-model error names both env vars.adapterFromModelString: any dotted name (catalog.schema.name, includingsystem.*) goes to the AI Gateway; names without dots stay on Model Serving. Serving-endpoint names cannot contain dots, so no existing endpoint changes routing.knip.json:pnpm knip(run by the pre-commit hook) fails on a cleanmain(unusedpackages/appkit/bin/appkit.js, unused devDependenciesesbuild,ora,zod), so no commit passes the hook from a fresh checkout. This PR adds those toknip.jsonso the hook passes; it can be split out if preferred.Contract (shared with the Databricks CLI PR databricks/cli#6998)
model_service, fieldname= model service full UC name (catalog.schema.model_service, without themodel-services/prefix).EXECUTE. Service principal only (no user API scope).{ "yamlKey": "uc_securable", "varFields": [["name", "securable_full_name"]], "staticFields": [["securable_type", "MODEL_SERVICE"]] }.Tests
packages/appkit/src/agents/tests/databricks.test.ts: dotted user model service name routes to the AI Gateway;system.*still does; plain endpoint names route to Model Serving.packages/shared/src/schemas/manifest.test.ts:model_serviceacceptsEXECUTEand rejects other permissions; binding isuc_securable/MODEL_SERVICE; not OBO-capable and not app-only.packages/appkit/src/plugins/agents/tests/default-model.test.ts:DATABRICKS_MODEL_SERVICE_NAMEwins overDATABRICKS_SERVING_ENDPOINT_NAME; serving endpoint env still used alone;defaultModelwins over both; the error names both env vars. Removing the model service fallback makes the precedence test fail.vitest run(5779 passed, 1 skipped),pnpm typecheck,pnpm check,pnpm knip, andgenerate:typeswith no diff in the checked generated files.Not done / assumptions
doctorexistence probe formodel_service: the JS SDK used by AppKit has no model service API.system.*models. Not verified end to end.This pull request and its description were written by Isaac.