@dbx-tools/appkit-model-gateway 0.9.131 → 0.9.136
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 +56 -16
- package/index.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# @dbx-tools/appkit-model-gateway
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Expose models in a Databricks workspace through OpenAI Responses, OpenAI Chat
|
|
4
|
+
Completions, Anthropic Messages, embeddings, and Codex-compatible APIs. The
|
|
5
|
+
gateway discovers the workspace catalogue and selects a compatible Databricks
|
|
6
|
+
route for each request.
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Choose embedded, foreground, or service mode
|
|
9
|
+
|
|
10
|
+
Register the AppKit plugin when model routes belong to an existing application.
|
|
11
|
+
Run `dbx model-gateway` for a foreground loopback endpoint used by local tools.
|
|
12
|
+
Use `dbx model-gateway service install` when that local endpoint must continue
|
|
13
|
+
after the terminal closes.
|
|
14
|
+
|
|
15
|
+
## Register the AppKit plugin
|
|
9
16
|
|
|
10
17
|
```ts
|
|
11
18
|
import { createApp, server } from "@databricks/appkit";
|
|
@@ -17,15 +24,15 @@ await createApp({
|
|
|
17
24
|
```
|
|
18
25
|
|
|
19
26
|
AppKit mounts the plugin routes under `/api/model-gateway/v1/*`. The
|
|
20
|
-
|
|
21
|
-
standard root compatibility paths.
|
|
27
|
+
[@dbx-tools/cli](../../cli/dbx-tools) provides foreground server construction,
|
|
28
|
+
current-user service management, and standard root compatibility paths.
|
|
22
29
|
|
|
23
|
-
## Connect
|
|
30
|
+
## Connect a client
|
|
24
31
|
|
|
25
32
|
Use the standalone CLI when a tool expects an OpenAI-compatible base URL:
|
|
26
33
|
|
|
27
34
|
```sh
|
|
28
|
-
dbx model-gateway --profile PROFILE --
|
|
35
|
+
dbx model-gateway --profile PROFILE --listen tcp://127.0.0.1:4000
|
|
29
36
|
```
|
|
30
37
|
|
|
31
38
|
Add `--prefer-system-models` to route non-exact Responses requests, including
|
|
@@ -33,17 +40,18 @@ Codex traffic, through `system.ai.*` AI Gateway services instead of workspace
|
|
|
33
40
|
serving endpoints. Codex model slugs follow the same choice. The flag defaults to
|
|
34
41
|
off, and an exact endpoint id or `system.ai.*` name always wins.
|
|
35
42
|
|
|
36
|
-
Configure the client with
|
|
43
|
+
Configure the client with
|
|
44
|
+
[http://127.0.0.1:4000/v1](http://127.0.0.1:4000/v1). For an embedded AppKit
|
|
37
45
|
route, use the app origin plus `/api/model-gateway/v1`.
|
|
38
46
|
|
|
39
47
|
The gateway supports:
|
|
40
48
|
|
|
41
|
-
- OpenAI Responses and Chat Completions
|
|
42
|
-
- Anthropic Messages
|
|
43
|
-
- OpenAI-compatible embeddings
|
|
49
|
+
- OpenAI Responses and Chat Completions.
|
|
50
|
+
- Anthropic Messages.
|
|
51
|
+
- OpenAI-compatible embeddings.
|
|
44
52
|
- Codex model discovery and Responses traffic.
|
|
45
53
|
|
|
46
|
-
## Discover
|
|
54
|
+
## Discover models
|
|
47
55
|
|
|
48
56
|
```ts
|
|
49
57
|
import { createModelGatewayClient } from "@dbx-tools/shared-model-gateway";
|
|
@@ -54,15 +62,22 @@ const models = await client.listModels({ search: "sonnet" });
|
|
|
54
62
|
|
|
55
63
|
Use `{ codex: true }` when a Codex client needs its native catalogue shape.
|
|
56
64
|
|
|
57
|
-
## Request
|
|
65
|
+
## Request compatibility
|
|
58
66
|
|
|
59
67
|
Requests stay on a native streaming path when the selected model supports the
|
|
60
68
|
client protocol. When protocols differ, the gateway translates the request and
|
|
61
|
-
response while preserving
|
|
69
|
+
response through Vercel AI SDK messages while preserving text, function tools,
|
|
70
|
+
reasoning, usage, finish reasons, streaming, and cancellation. Embeddings use a
|
|
71
|
+
direct Databricks embeddings route and are not translated.
|
|
62
72
|
|
|
63
73
|
The gateway rejects stateful Responses options it cannot preserve, including
|
|
64
74
|
`previous_response_id`, `store: true`, and `background: true`.
|
|
65
75
|
|
|
76
|
+
Web-search and custom-tool requests use a direct route only when the discovered
|
|
77
|
+
model advertises the required capability. OpenAI model-list
|
|
78
|
+
`capabilities.web_search` and Codex `supports_search_tool` use that same
|
|
79
|
+
discovered value.
|
|
80
|
+
|
|
66
81
|
## Configure Codex
|
|
67
82
|
|
|
68
83
|
`GET /v1/models` includes Codex metadata when the request carries
|
|
@@ -77,6 +92,31 @@ http://127.0.0.1:4000/v1
|
|
|
77
92
|
|
|
78
93
|
Use `wire_api = "responses"` and `supports_websockets = false`.
|
|
79
94
|
|
|
95
|
+
## Configure model policy
|
|
96
|
+
|
|
97
|
+
`model` and `modelClass` set the default selection. `preferSystemModels` selects
|
|
98
|
+
`system.ai.*` AI Gateway services for non-exact eligible requests. An exact
|
|
99
|
+
serving endpoint or `system.ai.*` name still wins.
|
|
100
|
+
|
|
101
|
+
Use `overrides` when workspace metadata must be corrected for a specific model.
|
|
102
|
+
For example, disable an advertised capability that the selected gateway route
|
|
103
|
+
cannot use:
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
import { modelGateway } from "@dbx-tools/appkit-model-gateway";
|
|
107
|
+
|
|
108
|
+
modelGateway({
|
|
109
|
+
overrides: [
|
|
110
|
+
{
|
|
111
|
+
model: "databricks-gpt-example",
|
|
112
|
+
capabilities: { webSearch: false },
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Overrides affect routing and the OpenAI and Codex model catalogues.
|
|
119
|
+
|
|
80
120
|
## Package API
|
|
81
121
|
|
|
82
122
|
- `modelGateway()` registers the AppKit plugin.
|
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/appkit-model-gateway";
|
|
6
|
-
export const PACKAGE_VERSION = "0.9.
|
|
6
|
+
export const PACKAGE_VERSION = "0.9.136";
|
|
7
7
|
export * as gateway from "./src/gateway.ts";
|
|
8
8
|
export * as models from "./src/models.ts";
|
|
9
9
|
export * as plugin from "./src/plugin.ts";
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const PACKAGE_IDENTIFIER = "@dbx-tools/appkit-model-gateway";
|
|
2
|
-
export declare const PACKAGE_VERSION = "0.9.
|
|
2
|
+
export declare const PACKAGE_VERSION = "0.9.136";
|
|
3
3
|
export * as gateway from "./src/gateway.ts";
|
|
4
4
|
export * as models from "./src/models.ts";
|
|
5
5
|
export * as plugin from "./src/plugin.ts";
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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/appkit-model-gateway";
|
|
5
|
-
export const PACKAGE_VERSION = "0.9.
|
|
5
|
+
export const PACKAGE_VERSION = "0.9.136";
|
|
6
6
|
export * as gateway from "./src/gateway.js";
|
|
7
7
|
export * as models from "./src/models.js";
|
|
8
8
|
export * as plugin from "./src/plugin.js";
|
|
@@ -16,4 +16,4 @@ export { ModelGatewayError, ModelGateway } from "./src/gateway.js";
|
|
|
16
16
|
export { ModelGatewayPlugin, modelGateway } from "./src/plugin.js";
|
|
17
17
|
export { DatabricksModelRegistry } from "./src/registry.js";
|
|
18
18
|
export { UnsupportedGatewayFeatureError } from "./src/router.js";
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1h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yBNb2RlbEdhdGV3YXlQbHVnaW4sIG1vZGVsR2F0ZXdheSB9IGZyb20gXCIuL3NyYy9wbHVnaW4udHNcIjtcbmV4cG9ydCB0eXBlIHsgTW9kZWxHYXRld2F5UGx1Z2luQ29uZmlnIH0gZnJvbSBcIi4vc3JjL3BsdWdpbi50c1wiO1xuZXhwb3J0IHR5cGUgeyBBZGFwdGVkSW5mZXJlbmNlQm9keSB9IGZyb20gXCIuL3NyYy9yZWFzb25pbmctYWRhcHQudHNcIjtcbmV4cG9ydCB7IERhdGFicmlja3NNb2RlbFJlZ2lzdHJ5IH0gZnJvbSBcIi4vc3JjL3JlZ2lzdHJ5LnRzXCI7XG5leHBvcnQgdHlwZSB7IE1vZGVsUmVnaXN0cnlSZXNvbHZlT3B0aW9ucywgTW9kZWxSZWdpc3RyeSwgTW9kZWxSZWdpc3RyeU9wdGlvbnMgfSBmcm9tIFwiLi9zcmMvcmVnaXN0cnkudHNcIjtcbmV4cG9ydCB7IFVuc3VwcG9ydGVkR2F0ZXdheUZlYXR1cmVFcnJvciB9IGZyb20gXCIuL3NyYy9yb3V0ZXIudHNcIjtcbmV4cG9ydCB0eXBlIHsgRGF0YWJyaWNrc1RyYW5zcG9ydFJlcXVlc3QgfSBmcm9tIFwiLi9zcmMvdHJhbnNwb3J0LnRzXCI7XG4iXX0=
|
package/package.json
CHANGED
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@databricks/appkit": "0.81.0",
|
|
30
|
-
"@dbx-tools/databricks": "^0.9.
|
|
31
|
-
"@dbx-tools/model": "^0.9.
|
|
32
|
-
"@dbx-tools/model-protocol": "^0.9.
|
|
33
|
-
"@dbx-tools/shared-core": "^0.9.
|
|
34
|
-
"@dbx-tools/shared-model": "^0.9.
|
|
35
|
-
"@dbx-tools/shared-model-gateway": "^0.9.
|
|
30
|
+
"@dbx-tools/databricks": "^0.9.136",
|
|
31
|
+
"@dbx-tools/model": "^0.9.136",
|
|
32
|
+
"@dbx-tools/model-protocol": "^0.9.136",
|
|
33
|
+
"@dbx-tools/shared-core": "^0.9.136",
|
|
34
|
+
"@dbx-tools/shared-model": "^0.9.136",
|
|
35
|
+
"@dbx-tools/shared-model-gateway": "^0.9.136",
|
|
36
36
|
"ai": "^7.0.0",
|
|
37
37
|
"zod": "4.3.6"
|
|
38
38
|
},
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"./package.json": "./package.json"
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
-
"version": "0.9.
|
|
93
|
+
"version": "0.9.136",
|
|
94
94
|
"types": "./lib/index.d.ts",
|
|
95
95
|
"dbxToolsConfig": {
|
|
96
96
|
"tags": [
|