Repository navigation
feat(appkit): add model_service resource and use it in the agents plugin - #705
MarioCadenas wants to merge 6 commits into
Conversation
…fault model Add the MODEL_SERVICE UC securable as a model_service resource type (EXECUTE, bound as uc_securable), a picker lister that walks catalogs and schemas, and switch the agents plugin's default-model resource to it. Dotted model names now route to the AI Gateway; DATABRICKS_SERVING_ENDPOINT_NAME stays a fallback. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
…add-model-service-resource-rep
Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
A full catalogs x schemas walk did not finish in 10 minutes on a large workspace and one rejected schema name aborted it. List model services like volumes instead: catalog, then schema, then ai-gateway list-model-services. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Finding system among thousands of catalogs is slow, so list system.ai model services first, with a "Browse other catalogs..." entry for the full catalog/schema drill-down. --set still accepts any catalog.schema.name. 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.3 MB (+520 B) | 460 KB (+112 B) |
| Type declarations | 468 KB (+3.3 KB) | 169 KB (+70 B) |
| Source maps | 2.5 MB (+995 B) | 859 KB (+80 B) |
| Other | 11 KB | 3.7 KB |
| Total | 4.2 MB (+4.8 KB) | 1.5 MB (+262 B) |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
106 KB (+57 B) | 2.5 KB | 109 KB (+57 B) | external | 344 KB (+234 B) |
./beta |
103 KB (+79 B) | 483 B (+1 B) | 104 KB (+80 B) | external | 310 KB (+341 B) |
./testing |
45 KB (+43 B) | 32 KB | 77 KB (+43 B) | external | 224 KB (+232 B) |
./tsdown |
520 B | 0 B | 520 B | external | 813 B |
./type-generator |
26 KB | 0 B | 26 KB | external | 74 KB |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 102 KB |
. |
utils.js |
initial | 4.6 KB |
. |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./beta |
beta.js |
initial | 83 KB |
./beta |
modular.js |
initial | 6.0 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 |
client.js |
initial | 647 B |
./beta |
index.js |
initial | 20 B |
./beta |
supervisor-api.js |
lazy | 192 B |
./beta |
databricks.js |
lazy | 177 B |
./beta |
index.js |
lazy | 114 B |
./testing |
manifest.js |
initial | 32 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 | 26 KB |
@databricks/appkit-ui
npm tarball (packed): 397 KB — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 429 KB | 147 KB |
| Type declarations | 267 KB | 98 KB |
| Source maps | 853 KB | 286 KB |
| CSS | 16 KB | 3.2 KB |
| Total | 1.5 MB | 534 KB |
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 |
🤖 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 41849434868 -R databricks/appkit -n appkit-template-0.90.0-pr.8907544-work-34-add-model-service-resource-rep-705 -D appkit-pr-705 \
&& unzip -o "appkit-pr-705/appkit-template-0.90.0-pr.8907544-work-34-add-model-service-resource-rep-705.zip" -d "appkit-pr-705" \
&& databricks apps init --template "appkit-pr-705"The template pins |
Merge the two return branches in listParentContextStep and trim the comments added for model_service to one line each. The model service picker opens on system.ai because finding the system catalog among thousands is slow. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
|
Review 6 · Fail · 1 critical, 1 minor Does the change do what the task asked? No. Gate: major and worse must be fixed. The model_service resource type, its uc_securable MODEL_SERVICE/EXECUTE binding, the picker, the doctor check and the agents plugin switch are built, and the 262 related tests pass. The serving plugin is still on serving_endpoint, but the task says plainly to replace it in both plugins. The closing note cites a human decision to keep it, but there is no human message in the task log that confirms this. Required
Not required (below the gate)
|
|
Review 7 · Pass · 1 minor, 1 trivial Does the change do what the task asked? Yes. Gate: major and worse must be fixed. model_service is added to the schema, DABs binding (uc_securable, MODEL_SERVICE, EXECUTE), doctor, the CLI picker (catalog > schema > ai-gateway list-model-services, prefix stripped) and the agents manifest and runtime env fallback, with tests that pass. The serving plugin staying on serving_endpoint and the CLI-based lister are human-settled decisions, so I don't count them as gaps. Not required (below the gate)
|
What
Adds the new Databricks Apps
model_serviceresource (a Unity Catalog securable of typeMODEL_SERVICE, from databricks-eng/universe#2571640) and makes it the agents plugin's default-model resource.Changes
model_serviceinresourceTypeSchema, permissionEXECUTE. Indatabricks.ymlit binds asuc_securablewithsecurable_type: MODEL_SERVICE, mappingnametosecurable_full_name. Generated types, JSON schemas,plugin createdefaults and docs updated.model_service(agents-model-service, envDATABRICKS_MODEL_SERVICE_NAME, valuecatalog.schema.name). The agents plugin and standalonerunAgentread that env first and still fall back toDATABRICKS_SERVING_ENDPOINT_NAME, so existing apps keep working.adapterFromModelStringsends any dotted name to the AI Gateway (fromAiGateway), not onlysystem.*. Model services arecatalog.schema.name, and serving endpoint names cannot contain dots, so no existing endpoint changes route. To force a dotted name onto a serving endpoint, pass a pre-built adapter.appkit plugin addpicker: opens on thesystem.aimodel services, with "Browse other catalogs..." for a catalog, schema, model service drill-down. Usesdatabricks ai-gateway list-model-services, so it needs a CLI that has that command; otherwise it falls back to manual entry.--set/--from-planaccept anycatalog.schema.name.appkit doctor: existence check formodel_service(GET/api/2.1/unity-catalog/model-services/{name}).Not changed
serving_endpoint. It is deprecated, and it calls/serving-endpoints/{name}/invocations, which a model service is not.SCOPE_BY_TYPEentry formodel_service, so the agents resource no longer carries a user API scope. Agents that run on behalf of the user may needai-gateway; not added until confirmed.Why the picker is a drill-down
A flat walk over every catalog and schema did not finish in 10 minutes on dogfood (1158 catalogs), and finding
systemby paging is slow, so the picker opens onsystem.aiand leaves the rest one pick away.Testing
system.ai, browse,--set), doctor check, routing, agents env default.pnpm check,pnpm -r typecheck,pnpm test, docs build: green.system.ai.gpt-5-miniand reports NOT_FOUND for a made-up name; thesystem.ailisting returns 70 services;runAgentwithDATABRICKS_MODEL_SERVICE_NAME=system.ai.gpt-5-minianswered through the AI Gateway.Task: KIT-34 (app-kit/34)
This pull request and its description were written by Isaac.