@dbx-tools/dbx-model-catalog 0.1.9 → 0.3.0
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 +296 -55
- package/dist/_generated/channels.d.ts +4 -3
- package/dist/_generated/json-schema.d.ts +6527 -175
- package/dist/_generated/schemas.d.ts +154 -0
- package/dist/_generated/workspace-rules.d.ts +133 -0
- package/dist/browser.d.ts +34 -15
- package/dist/browser.js +1152 -9042
- package/dist/catalog-index.d.ts +15 -2
- package/dist/chunk-engbh7tj.js +39 -0
- package/dist/chunk-gzjer0mc.js +1797 -0
- package/dist/chunk-pp7fw379.js +51 -0
- package/dist/chunk-pwssxaq0.js +39 -0
- package/dist/cli.js +41 -9619
- package/dist/effective.d.ts +31 -0
- package/dist/index.d.ts +33 -16
- package/dist/index.js +60 -9630
- package/dist/local-client.d.ts +16 -3
- package/dist/pynect.d.ts +6 -3
- package/dist/search.d.ts +7 -1
- package/dist/serving-endpoints.d.ts +15 -0
- package/dist/sources.d.ts +30 -0
- package/dist/types.d.ts +31 -3
- package/dist/validation.d.ts +15 -1
- package/dist/workspace-cache.d.ts +68 -0
- package/dist/workspace-client.d.ts +49 -0
- package/dist/workspace-connection.d.ts +67 -0
- package/dist/workspace-file-cache.d.ts +11 -0
- package/dist/workspace-identity.d.ts +27 -0
- package/dist/workspace-overlay.d.ts +71 -0
- package/package.json +8 -12
- package/src/_generated/channels.ts +41 -0
- package/src/_generated/index.ts +6 -0
- package/src/_generated/json-schema.ts +5 -0
- package/src/_generated/published.ts +7 -0
- package/src/_generated/schemas.ts +585 -0
- package/src/_generated/workspace-rules.ts +285 -0
- package/src/browser.ts +115 -0
- package/src/catalog-index.ts +121 -0
- package/src/cli.ts +99 -0
- package/src/effective.ts +200 -0
- package/src/filter.ts +47 -0
- package/src/identity.ts +56 -0
- package/src/index.ts +187 -0
- package/src/local-client.ts +127 -0
- package/src/pynect.ts +31 -0
- package/src/search.ts +582 -0
- package/src/serving-endpoints.ts +157 -0
- package/src/sources.ts +107 -0
- package/src/types.ts +49 -0
- package/src/validation.ts +127 -0
- package/src/workspace-cache.ts +234 -0
- package/src/workspace-client.ts +134 -0
- package/src/workspace-connection.ts +160 -0
- package/src/workspace-file-cache.ts +45 -0
- package/src/workspace-identity.ts +77 -0
- package/src/workspace-overlay.ts +200 -0
- package/dist/browser.js.map +0 -38
- package/dist/catalog.json +0 -1
- package/dist/cli.js.map +0 -40
- package/dist/index.js.map +0 -39
- package/dist/pynect.js +0 -553
- package/dist/pynect.js.map +0 -15
- package/dist/search-index.json +0 -1
- package/dist/snapshot.d.ts +0 -7
- package/dist/snapshot.js +0 -9515
- package/dist/snapshot.js.map +0 -36
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CatalogSearchIndexPayload, EffectiveModelCatalog, ModelCatalog, WorkspaceRefresh } from "./_generated/schemas.js";
|
|
2
|
+
import { type WorkspaceEndpoint } from "./serving-endpoints.js";
|
|
3
|
+
/** Version of the effective-catalog contract; part of every workspace cache key. */
|
|
4
|
+
export declare const EFFECTIVE_CATALOG_CONTRACT_VERSION: number;
|
|
5
|
+
/**
|
|
6
|
+
* Merge normalized endpoints over `publicCatalog` with live-over-public precedence, following
|
|
7
|
+
* the Python reference (`build_effective_catalog`) and the shared `WORKSPACE_OVERLAY_RULES`:
|
|
8
|
+
*
|
|
9
|
+
* - A repeated endpoint name keeps its first entry.
|
|
10
|
+
* - An endpoint matches the first identity candidate the public index resolves exactly
|
|
11
|
+
* (case-insensitive) or by normalized identity; never fuzzy.
|
|
12
|
+
* - Each overlay field the endpoint supplies replaces the public value (origin `workspace`) and
|
|
13
|
+
* drops `sources[target]`; omitted fields keep the public value and sources (origin `public`).
|
|
14
|
+
* Unmatched endpoints start from schema-required placeholders (origin `placeholder`).
|
|
15
|
+
* - An unmatched endpoint whose task maps to no type gets no record or search document: it is
|
|
16
|
+
* listed in `endpoints` only, with no field origins, because any type would be invented.
|
|
17
|
+
* - The record id is the endpoint name. Public order is kept, an endpoint named like a public id
|
|
18
|
+
* replaces it in place, and other endpoint records follow sorted by name.
|
|
19
|
+
* - Endpoint identities other than the name become aliases only when the public index does not
|
|
20
|
+
* resolve them and no public record or earlier endpoint already claims them.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildEffectiveCatalog(publicCatalog: ModelCatalog, endpoints?: Iterable<WorkspaceEndpoint>, workspace?: WorkspaceRefresh): EffectiveModelCatalog;
|
|
23
|
+
/** True when the workspace listed `id` as an invocable endpoint. */
|
|
24
|
+
export declare function isEffectiveModelAccessible(effective: EffectiveModelCatalog, id: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Search documents for every effective record. Text fields come from the effective record;
|
|
27
|
+
* quality comes from the public search index: an unchanged public record reuses its own document,
|
|
28
|
+
* an endpoint record inherits its matched public record's quality, and an unmatched endpoint uses
|
|
29
|
+
* `runtime_search_quality`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildEffectiveSearchIndex(effective: EffectiveModelCatalog, publicIndex: CatalogSearchIndexPayload): CatalogSearchIndexPayload;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,35 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { type CatalogSourceOptions, type ModelCatalogSourceInput } from "./sources.js";
|
|
2
|
+
import type { ModelCatalogClient } from "./types.js";
|
|
3
|
+
import { type ModelServingClientOption } from "./workspace-client.js";
|
|
4
|
+
import type { WorkspaceCacheOptions } from "./workspace-overlay.js";
|
|
5
|
+
/** Options for the Node `createModelCatalogClient`, which also accepts SDK clients. */
|
|
6
|
+
export interface ModelCatalogClientOptions extends CatalogSourceOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Workspace connection: a `@databricks/sdk-experimental` `WorkspaceClient`, a
|
|
9
|
+
* `@databricks/sdk-modelserving` `ModelServingClient`, a `{ host, headers }` connection, or a sync
|
|
10
|
+
* or async function returning one. Validated before any request.
|
|
11
|
+
*/
|
|
12
|
+
modelServingClient?: ModelServingClientOption;
|
|
13
|
+
/** Workspace overlay refresh and cache settings. */
|
|
14
|
+
workspaceCache?: NodeWorkspaceCacheOptions;
|
|
8
15
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Node workspace cache settings. By default principal-scoped overlays persist to a `keyv-file`
|
|
18
|
+
* store under the user cache directory; `persistent: false` keeps them in process memory.
|
|
19
|
+
*/
|
|
20
|
+
export interface NodeWorkspaceCacheOptions extends WorkspaceCacheOptions {
|
|
21
|
+
/** Cache file for the default persistent store. */
|
|
22
|
+
filename?: string;
|
|
15
23
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Create a catalog client from any source: the published catalog by default (or the files named by
|
|
26
|
+
* `DBX_MODEL_CATALOG_PATH`), an `http(s)` catalog URL, a `ws(s)` URL of the Python catalog server
|
|
27
|
+
* (needs the optional `pynect` and `@chanx-js/client` peers), a catalog file path or `file:` URL
|
|
28
|
+
* (`search-index.json` beside it), or an in-memory catalog with `options.searchIndex`. With
|
|
29
|
+
* `modelServingClient` every read serves the workspace-effective catalog, whatever the source.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createModelCatalogClient(source?: ModelCatalogSourceInput, options?: ModelCatalogClientOptions): Promise<ModelCatalogClient>;
|
|
32
|
+
export { createPersistentWorkspaceCatalogCache } from "./workspace-file-cache.js";
|
|
33
|
+
export type { ModelServingClientOption, ModelServingSdkClientLike, WorkspaceClientLike, WorkspaceClientRequest, } from "./workspace-client.js";
|
|
34
|
+
export type { Availability, AveragePrice, Benchmark, BrowserModelServingClientOption, CachedWorkspaceOverlay, Capabilities, CatalogFilters, CatalogIdentityMatch, CatalogModel, CatalogModelRecord, CatalogSearchIndexDocument, CatalogSearchIndexPayload, CatalogSearchMatch, CatalogSearchQualityScores, EffectiveEndpoint, EffectiveModelCatalog, FieldOrigin, IdentityCandidate, Latency, Limits, MatchedPublicIdentity, Modalities, ModelCatalog, ModelCatalogClient, ModelCatalogSource, ModelCatalogSourceInput, ModelCatalogSourceKind, ModelIdentity, ModelIdentityKind, ModelServingConnection, ModelServingConnectionGenerator, Notice, Price, Rankings, RateLimits, Reasoning, Retirement, SourceLink, Status, Type, WorkspaceCacheOptions, WorkspaceCacheStore, WorkspaceCatalogCache, WorkspaceEndpointCapabilities, WorkspaceEndpointSource, WorkspaceModelProfile, WorkspaceRefresh, WorkspaceRefreshStatus, } from "./browser.js";
|
|
35
|
+
export { CatalogAveragePriceSchema, CatalogCapabilitiesSchema, CatalogLatencySchema, CatalogModelRecordSchema, CatalogModelSchema, CatalogPreferenceRankingSchema, CatalogPriceSchema, CatalogRankingSchema, CatalogRateLimitsSchema, CatalogScoreRankingSchema, CatalogSearchIndexSchema, CatalogStatusSchema, EFFECTIVE_CATALOG_CONTRACT_VERSION, EffectiveModelCatalogSchema, ModelCatalogSchema, PUBLISHED_CATALOG_DATABASE_URL, PUBLISHED_CATALOG_INDEX_URL, PUBLISHED_CATALOG_ROOT_URL, PUBLISHED_CATALOG_SCHEMA_URL, PUBLISHED_CATALOG_SCHEMA_VERSION, PUBLISHED_CATALOG_SEARCH_INDEX_URL, PUBLISHED_CATALOG_URL, WorkspaceRefreshSchema, parseCatalogModelRecord, parseCatalogSearchIndex, parseEffectiveModelCatalog, parseModelCatalog, } from "./browser.js";
|