@dbx-tools/shared-model 0.9.131 → 0.9.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -27
- package/index.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
# @dbx-tools/shared-model
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Validate model lookups and ranked model responses in UIs, routes, tools, and
|
|
4
|
+
tests without importing Databricks clients. Use the browser-safe model
|
|
5
|
+
selection, capability, reasoning, and OpenAI Chat Completions contracts across
|
|
6
|
+
client and server boundaries.
|
|
7
|
+
Server-side normalization, classification, ranking, and fuzzy resolution live in
|
|
8
|
+
[@dbx-tools/model](../../node/model).
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Generated `ModelClass`, endpoint, query, status, profile, ranking, and
|
|
12
|
-
reasoning-effort contracts as browser-safe TypeScript and zod.
|
|
13
|
-
- Human-readable endpoint display names via `display.toModelDisplayName`.
|
|
14
|
-
- Browser-safe OpenAI Chat message and tool-call contracts.
|
|
15
|
-
- Types that match the server selection API without depending on the Databricks
|
|
16
|
-
SDK.
|
|
17
|
-
|
|
18
|
-
## Human-Readable Display Names
|
|
10
|
+
## Format model display names
|
|
19
11
|
|
|
20
12
|
```ts
|
|
21
13
|
import { display } from "@dbx-tools/shared-model";
|
|
@@ -26,11 +18,15 @@ display.toModelDisplayName("x", "Claude 4.6 (Preview)"); // provided name wins
|
|
|
26
18
|
```
|
|
27
19
|
|
|
28
20
|
`ServingEndpointSummary.displayName` is the optional friendly label for the
|
|
29
|
-
picker
|
|
21
|
+
picker. `name` stays the invocation ID. A Databricks-provided name wins. Otherwise,
|
|
30
22
|
the pure helper strips leading vendor prefixes and title-cases through
|
|
31
23
|
`@dbx-tools/shared-core`'s tokenizer.
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
The package also includes generated `ModelClass`, endpoint, query, status,
|
|
26
|
+
profile, ranking, and reasoning-effort contracts, plus browser-safe OpenAI Chat
|
|
27
|
+
Completions message and tool-call contracts.
|
|
28
|
+
|
|
29
|
+
## Validate a model lookup request
|
|
34
30
|
|
|
35
31
|
```ts
|
|
36
32
|
import { model } from "@dbx-tools/shared-model";
|
|
@@ -47,7 +43,7 @@ Use `model.ModelQuerySchema` for route query/body validation and agent tool
|
|
|
47
43
|
inputs. It keeps client model pickers and backend resolution endpoints on the
|
|
48
44
|
same request shape.
|
|
49
45
|
|
|
50
|
-
## Use
|
|
46
|
+
## Use classified endpoint catalogs
|
|
51
47
|
|
|
52
48
|
```ts
|
|
53
49
|
import { model } from "@dbx-tools/shared-model";
|
|
@@ -57,10 +53,10 @@ const agentModels = endpoints.filter((endpoint) => endpoint.supportsTools);
|
|
|
57
53
|
```
|
|
58
54
|
|
|
59
55
|
The server stamps class and capability fields before returning `/models`.
|
|
60
|
-
Browser clients consume those fields directly
|
|
56
|
+
Browser clients consume those fields directly. Model-family policy does not run
|
|
61
57
|
in the browser.
|
|
62
58
|
|
|
63
|
-
## Strip
|
|
59
|
+
## Strip fields that Databricks rejects
|
|
64
60
|
|
|
65
61
|
```ts
|
|
66
62
|
import { openaiChat } from "@dbx-tools/shared-model";
|
|
@@ -72,13 +68,18 @@ Databricks Model Serving validates Chat Completions bodies strictly.
|
|
|
72
68
|
`stripUnsupportedChatFields` deletes known unsupported fields in place and
|
|
73
69
|
returns the removed names so a caller can log the difference.
|
|
74
70
|
|
|
75
|
-
##
|
|
71
|
+
## Runtime boundary
|
|
76
72
|
|
|
77
|
-
|
|
73
|
+
This package doesn't discover endpoints, read credentials, rank models, or send
|
|
74
|
+
Model Serving requests. Use [@dbx-tools/model](../../node/model) for
|
|
75
|
+
server-side model discovery and selection. Use
|
|
76
|
+
[@dbx-tools/shared-model-gateway](../model-gateway) for browser-safe model
|
|
77
|
+
gateway responses and discovery clients.
|
|
78
|
+
|
|
79
|
+
## Package exports
|
|
80
|
+
|
|
81
|
+
- `model`: model classes, reasoning-effort schema, endpoint summaries, lookup
|
|
78
82
|
requests, and ranked results.
|
|
79
|
-
- `display
|
|
80
|
-
- `openaiChat
|
|
83
|
+
- `display`: human-readable endpoint labels.
|
|
84
|
+
- `openaiChat`: Chat Completions message and tool-call types, content helpers,
|
|
81
85
|
and rejected-field sanitization.
|
|
82
|
-
|
|
83
|
-
Server-side selection, cache, and fuzzy endpoint matching are in
|
|
84
|
-
[`@dbx-tools/model`](../../node/model).
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Hand edits are overwritten on the next watch; this file is read-only.
|
|
4
4
|
|
|
5
5
|
export const PACKAGE_IDENTIFIER = "@dbx-tools/shared-model";
|
|
6
|
-
export const PACKAGE_VERSION = "0.9.
|
|
6
|
+
export const PACKAGE_VERSION = "0.9.132";
|
|
7
7
|
export * as contracts from "./src/contracts.ts";
|
|
8
8
|
export * as display from "./src/display.ts";
|
|
9
9
|
export * as model from "./src/model.ts";
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const PACKAGE_IDENTIFIER = "@dbx-tools/shared-model";
|
|
2
|
-
export declare const PACKAGE_VERSION = "0.9.
|
|
2
|
+
export declare const PACKAGE_VERSION = "0.9.132";
|
|
3
3
|
export * as contracts from "./src/contracts.ts";
|
|
4
4
|
export * as display from "./src/display.ts";
|
|
5
5
|
export * as model from "./src/model.ts";
|
package/lib/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Regenerated from the exporting modules in ./src.
|
|
3
3
|
// Hand edits are overwritten on the next watch; this file is read-only.
|
|
4
4
|
export const PACKAGE_IDENTIFIER = "@dbx-tools/shared-model";
|
|
5
|
-
export const PACKAGE_VERSION = "0.9.
|
|
5
|
+
export const PACKAGE_VERSION = "0.9.132";
|
|
6
6
|
export * as contracts from "./src/contracts.js";
|
|
7
7
|
export * as display from "./src/display.js";
|
|
8
8
|
export * as model from "./src/model.js";
|
|
9
9
|
export * as openaiChat from "./src/openai-chat.js";
|
|
10
10
|
export { ChatRoleSchema, ChatContentPartSchema, ChatToolCallFunctionSchema, ChatToolCallSchema, ChatMessageSchema, UNSUPPORTED_CHAT_FIELDS, ChatContentToTextOptionsSchema } from "./src/openai-chat.js";
|
|
11
11
|
export * from "./exports.js";
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwyQ0FBMkM7QUFDM0MsbURBQW1EO0FBQ25ELHdFQUF3RTtBQUV4RSxNQUFNLENBQUMsTUFBTSxrQkFBa0IsR0FBRyx5QkFBeUIsQ0FBQztBQUM1RCxNQUFNLENBQUMsTUFBTSxlQUFlLEdBQUcsU0FBUyxDQUFDO0FBQ3pDLE9BQU8sS0FBSyxTQUFTLE1BQU0sb0JBQW9CLENBQUM7QUFDaEQsT0FBTyxLQUFLLE9BQU8sTUFBTSxrQkFBa0IsQ0FBQztBQUM1QyxPQUFPLEtBQUssS0FBSyxNQUFNLGdCQUFnQixDQUFDO0FBQ3hDLE9BQU8sS0FBSyxVQUFVLE1BQU0sc0JBQXNCLENBQUM7QUFDbkQsT0FBTyxFQUFFLGNBQWMsRUFBRSxxQkFBcUIsRUFBRSwwQkFBMEIsRUFBRSxrQkFBa0IsRUFBRSxpQkFBaUIsRUFBRSx1QkFBdUIsRUFBRSw4QkFBOEIsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRXpNLGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gR0VORVJBVEVEIGJ5IHByb2plbiB3Y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JjL29wZW5haS1jaGF0LnRzXCI7XG5leHBvcnQgKiBmcm9tIFwiLi9leHBvcnRzLnRzXCI7XG4iXX0=
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"typescript": "^5.9.3"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dbx-tools/shared-core": "^0.9.
|
|
25
|
+
"@dbx-tools/shared-core": "^0.9.132",
|
|
26
26
|
"zod": "4.3.6"
|
|
27
27
|
},
|
|
28
28
|
"main": "./lib/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"./package.json": "./package.json"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
"version": "0.9.
|
|
62
|
+
"version": "0.9.132",
|
|
63
63
|
"types": "./lib/index.d.ts",
|
|
64
64
|
"dbxToolsConfig": {
|
|
65
65
|
"tags": [
|