@llmops/core 0.6.1-beta.2 → 0.6.2
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/dist/{bun-sqlite-dialect-DFKD-iqI.cjs → bun-sqlite-dialect-BUnuGpx1.cjs} +1 -1
- package/dist/db/index.cjs +2 -2
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/db/index.mjs +1 -1
- package/dist/{db-CQvUnGBp.mjs → db-Cd1KR24Y.mjs} +12 -0
- package/dist/{db-C6ApWDjW.cjs → db-i0OOYxJm.cjs} +16 -4
- package/dist/{index-DdG7GtcE.d.cts → index-CyVFWq76.d.cts} +28 -0
- package/dist/{index-BosemZ_J.d.mts → index-D3onb7gK.d.mts} +28 -0
- package/dist/index.cjs +142 -79
- package/dist/index.d.cts +52 -34
- package/dist/index.d.mts +52 -34
- package/dist/index.mjs +140 -78
- package/dist/{neon-dialect-DNyVaL-1.cjs → neon-dialect-DavGzunb.cjs} +1 -1
- package/dist/{neon-dialect-SqAJhPFS.cjs → neon-dialect-oh8u9vRy.cjs} +1 -1
- package/dist/{node-sqlite-dialect-DI0PJyHV.cjs → node-sqlite-dialect-CbwETvHG.cjs} +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "./index-
|
|
1
|
+
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "./index-D3onb7gK.mjs";
|
|
2
2
|
import gateway from "@llmops/gateway";
|
|
3
3
|
import * as kysely0 from "kysely";
|
|
4
4
|
import { Kysely } from "kysely";
|
|
@@ -1259,13 +1259,13 @@ declare const createConfigDataLayer: (db: Kysely<Database>) => {
|
|
|
1259
1259
|
modelName: string | null;
|
|
1260
1260
|
jsonData: Record<string, unknown> | null;
|
|
1261
1261
|
variantVersionId: string | null;
|
|
1262
|
-
id: string;
|
|
1263
1262
|
slug: string;
|
|
1264
1263
|
name: string | undefined;
|
|
1264
|
+
id: string;
|
|
1265
1265
|
createdAt: Date;
|
|
1266
1266
|
updatedAt: Date;
|
|
1267
|
-
variantName: string | null;
|
|
1268
1267
|
variantId: string | null;
|
|
1268
|
+
variantName: string | null;
|
|
1269
1269
|
}[]>;
|
|
1270
1270
|
};
|
|
1271
1271
|
//#endregion
|
|
@@ -1370,13 +1370,13 @@ declare const createConfigVariantDataLayer: (db: Kysely<Database>) => {
|
|
|
1370
1370
|
modelName: string;
|
|
1371
1371
|
jsonData: Record<string, unknown>;
|
|
1372
1372
|
} | null;
|
|
1373
|
+
configId: string;
|
|
1373
1374
|
id: string;
|
|
1374
1375
|
createdAt: Date;
|
|
1375
1376
|
updatedAt: Date;
|
|
1376
1377
|
variantId: string;
|
|
1377
|
-
configId: string;
|
|
1378
|
-
configName: string | null | undefined;
|
|
1379
1378
|
variantName: string | null;
|
|
1379
|
+
configName: string | null | undefined;
|
|
1380
1380
|
} | undefined>;
|
|
1381
1381
|
/**
|
|
1382
1382
|
* Get config variants with details including latest version data
|
|
@@ -1395,11 +1395,11 @@ declare const createConfigVariantDataLayer: (db: Kysely<Database>) => {
|
|
|
1395
1395
|
modelName: string;
|
|
1396
1396
|
jsonData: Record<string, unknown>;
|
|
1397
1397
|
} | null;
|
|
1398
|
+
configId: string;
|
|
1398
1399
|
id: string;
|
|
1399
1400
|
createdAt: Date;
|
|
1400
1401
|
updatedAt: Date;
|
|
1401
1402
|
variantId: string;
|
|
1402
|
-
configId: string;
|
|
1403
1403
|
name: string | null;
|
|
1404
1404
|
}[]>;
|
|
1405
1405
|
/**
|
|
@@ -1956,7 +1956,9 @@ declare const insertLLMRequestSchema: z$1.ZodObject<{
|
|
|
1956
1956
|
completionTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1957
1957
|
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1958
1958
|
cachedTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1959
|
+
cacheCreationTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1959
1960
|
cost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1961
|
+
cacheSavings: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1960
1962
|
inputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1961
1963
|
outputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1962
1964
|
endpoint: z$1.ZodString;
|
|
@@ -2069,6 +2071,8 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
2069
2071
|
requestId: string;
|
|
2070
2072
|
model: string;
|
|
2071
2073
|
cachedTokens: number;
|
|
2074
|
+
cacheCreationTokens: number;
|
|
2075
|
+
cacheSavings: number;
|
|
2072
2076
|
inputCost: number;
|
|
2073
2077
|
outputCost: number;
|
|
2074
2078
|
endpoint: string;
|
|
@@ -2114,6 +2118,8 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
2114
2118
|
requestId: string;
|
|
2115
2119
|
model: string;
|
|
2116
2120
|
cachedTokens: number;
|
|
2121
|
+
cacheCreationTokens: number;
|
|
2122
|
+
cacheSavings: number;
|
|
2117
2123
|
inputCost: number;
|
|
2118
2124
|
outputCost: number;
|
|
2119
2125
|
endpoint: string;
|
|
@@ -2161,6 +2167,8 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
2161
2167
|
requestId: string;
|
|
2162
2168
|
model: string;
|
|
2163
2169
|
cachedTokens: number;
|
|
2170
|
+
cacheCreationTokens: number;
|
|
2171
|
+
cacheSavings: number;
|
|
2164
2172
|
inputCost: number;
|
|
2165
2173
|
outputCost: number;
|
|
2166
2174
|
endpoint: string;
|
|
@@ -2194,6 +2202,8 @@ declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
|
2194
2202
|
totalPromptTokens: number;
|
|
2195
2203
|
totalCompletionTokens: number;
|
|
2196
2204
|
totalTokens: number;
|
|
2205
|
+
totalCachedTokens: number;
|
|
2206
|
+
totalCacheSavings: number;
|
|
2197
2207
|
requestCount: number;
|
|
2198
2208
|
} | undefined>;
|
|
2199
2209
|
/**
|
|
@@ -3787,8 +3797,10 @@ interface UsageData {
|
|
|
3787
3797
|
completionTokens: number;
|
|
3788
3798
|
/** Total tokens (prompt + completion) */
|
|
3789
3799
|
totalTokens?: number;
|
|
3790
|
-
/** Number of
|
|
3800
|
+
/** Number of cache read tokens (OpenAI cached_tokens / Anthropic cache_read_input_tokens) */
|
|
3791
3801
|
cachedTokens?: number;
|
|
3802
|
+
/** Number of cache creation tokens (Anthropic cache_creation_input_tokens) */
|
|
3803
|
+
cacheCreationTokens?: number;
|
|
3792
3804
|
/** Number of reasoning tokens (optional, for models like o1) */
|
|
3793
3805
|
reasoningTokens?: number;
|
|
3794
3806
|
}
|
|
@@ -3804,6 +3816,8 @@ interface CostResult {
|
|
|
3804
3816
|
inputCost: number;
|
|
3805
3817
|
/** Output/completion cost in micro-dollars */
|
|
3806
3818
|
outputCost: number;
|
|
3819
|
+
/** Cost saved by cache hits in micro-dollars (negative means cache write premium exceeded savings) */
|
|
3820
|
+
cacheSavings: number;
|
|
3807
3821
|
}
|
|
3808
3822
|
/**
|
|
3809
3823
|
* Provider for fetching model pricing data
|
|
@@ -3850,6 +3864,19 @@ interface PricingProvider {
|
|
|
3850
3864
|
* ```
|
|
3851
3865
|
*/
|
|
3852
3866
|
declare function calculateCost(usage: UsageData, pricing: ModelPricing): CostResult;
|
|
3867
|
+
/**
|
|
3868
|
+
* Calculate cache-aware cost of an LLM request in micro-dollars.
|
|
3869
|
+
*
|
|
3870
|
+
* Splits input tokens into uncached, cache-read, and cache-creation buckets,
|
|
3871
|
+
* each priced at different rates. Falls back to provider-specific multipliers
|
|
3872
|
+
* when models.dev doesn't provide cache pricing.
|
|
3873
|
+
*
|
|
3874
|
+
* @param usage - Token usage data (with cachedTokens and cacheCreationTokens)
|
|
3875
|
+
* @param pricing - Model pricing (may include cacheReadCostPer1M / cacheWriteCostPer1M)
|
|
3876
|
+
* @param provider - Provider name for fallback rate selection
|
|
3877
|
+
* @returns Cost breakdown in micro-dollars
|
|
3878
|
+
*/
|
|
3879
|
+
declare function calculateCacheAwareCost(usage: UsageData, pricing: ModelPricing, provider?: string): CostResult;
|
|
3853
3880
|
/**
|
|
3854
3881
|
* Convert micro-dollars to dollars
|
|
3855
3882
|
*
|
|
@@ -3893,47 +3920,38 @@ declare function formatCost(microDollars: number, decimals?: number): string;
|
|
|
3893
3920
|
//#endregion
|
|
3894
3921
|
//#region src/pricing/provider.d.ts
|
|
3895
3922
|
/**
|
|
3896
|
-
* Pricing provider that fetches data from
|
|
3923
|
+
* Pricing provider that fetches per-model data from the LLMOps Models API.
|
|
3897
3924
|
*
|
|
3898
3925
|
* Features:
|
|
3899
|
-
* -
|
|
3900
|
-
* -
|
|
3901
|
-
* -
|
|
3926
|
+
* - Per-model in-memory cache with configurable TTL (default 5 minutes)
|
|
3927
|
+
* - Deduplicates concurrent fetches for the same model
|
|
3928
|
+
* - Caches null results (404s) to avoid repeated lookups
|
|
3929
|
+
* - Falls back to stale cache on fetch errors
|
|
3902
3930
|
*/
|
|
3903
|
-
declare class
|
|
3931
|
+
declare class LLMOpsPricingProvider implements PricingProvider {
|
|
3904
3932
|
private cache;
|
|
3905
|
-
private
|
|
3933
|
+
private pendingFetches;
|
|
3906
3934
|
private cacheTTL;
|
|
3907
|
-
private
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
* @param cacheTTL - Cache TTL in milliseconds (default: 5 minutes)
|
|
3913
|
-
*/
|
|
3914
|
-
constructor(cacheTTL?: number);
|
|
3915
|
-
/**
|
|
3916
|
-
* Generate a cache key for a provider/model combination
|
|
3917
|
-
*/
|
|
3935
|
+
private baseUrl;
|
|
3936
|
+
constructor(options?: {
|
|
3937
|
+
cacheTTL?: number;
|
|
3938
|
+
baseUrl?: string;
|
|
3939
|
+
});
|
|
3918
3940
|
private getCacheKey;
|
|
3919
3941
|
/**
|
|
3920
|
-
* Fetch pricing
|
|
3942
|
+
* Fetch pricing for a single model from the API
|
|
3921
3943
|
*/
|
|
3922
|
-
private
|
|
3923
|
-
/**
|
|
3924
|
-
* Ensure cache is fresh, fetching if necessary
|
|
3925
|
-
*/
|
|
3926
|
-
private ensureFreshCache;
|
|
3944
|
+
private fetchModelPricing;
|
|
3927
3945
|
/**
|
|
3928
3946
|
* Get pricing for a specific model
|
|
3929
3947
|
*/
|
|
3930
3948
|
getModelPricing(provider: string, model: string): Promise<ModelPricing | null>;
|
|
3931
3949
|
/**
|
|
3932
|
-
* Force refresh the pricing cache
|
|
3950
|
+
* Force refresh the pricing cache (clears all cached entries)
|
|
3933
3951
|
*/
|
|
3934
3952
|
refreshCache(): Promise<void>;
|
|
3935
3953
|
/**
|
|
3936
|
-
*
|
|
3954
|
+
* Always ready — no bulk pre-fetch needed
|
|
3937
3955
|
*/
|
|
3938
3956
|
isReady(): boolean;
|
|
3939
3957
|
/**
|
|
@@ -3944,7 +3962,7 @@ declare class ModelsDevPricingProvider implements PricingProvider {
|
|
|
3944
3962
|
/**
|
|
3945
3963
|
* Get the default pricing provider instance
|
|
3946
3964
|
*/
|
|
3947
|
-
declare function getDefaultPricingProvider():
|
|
3965
|
+
declare function getDefaultPricingProvider(): LLMOpsPricingProvider;
|
|
3948
3966
|
//#endregion
|
|
3949
3967
|
//#region src/auth/get-auth-client-options.d.ts
|
|
3950
3968
|
interface AuthClientDatabaseConfig {
|
|
@@ -4174,4 +4192,4 @@ declare class ManifestRouter {
|
|
|
4174
4192
|
routeWithWeights(configIdOrSlug: string, environmentId: string, context?: RoutingContext): RoutingResult | null;
|
|
4175
4193
|
}
|
|
4176
4194
|
//#endregion
|
|
4177
|
-
export { type AnthropicProviderConfig, type AnyProviderConfig, AuthClientDatabaseConfig, AuthClientOptions, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, COST_SUMMARY_GROUP_BY, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, type Config, type ConfigVariant, type ConfigVariantsDataLayer, type ConfigVariantsTable, type ConfigsDataLayer, type ConfigsTable, type CortexProviderConfig, CostResult, type CostSummaryGroupBy, DEFAULT_PROVIDER_ENV_VARS, type DataLayer, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, type Dataset, type DatasetRecord, DatasetRecordsTable, type DatasetVersion, type DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, type DatasetsDataLayer, DatasetsTable, type Environment, type EnvironmentSecret, type EnvironmentSecretsDataLayer, type EnvironmentSecretsTable, type EnvironmentsDataLayer, type EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, type GatewayManifest, type GoogleProviderConfig, type GuardrailConfig, type GuardrailConfigsDataLayer, GuardrailConfigsTable, type GuardrailResult, type GuardrailResults, type HuggingFaceProviderConfig, type InlineProviderConfig, type InlineProvidersConfig, Insertable, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, type LLMRequest, type LLMRequestInsert, type LLMRequestsDataLayer, LLMRequestsTable, MS, ManifestBuilder, type ManifestConfig, type ManifestEnvironment, type ManifestGuardrail, type ManifestProviderGuardrailOverride, ManifestRouter, ManifestService, type ManifestTargetingRule, type ManifestVariantVersion, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing,
|
|
4195
|
+
export { type AnthropicProviderConfig, type AnyProviderConfig, AuthClientDatabaseConfig, AuthClientOptions, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, COST_SUMMARY_GROUP_BY, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, type Config, type ConfigVariant, type ConfigVariantsDataLayer, type ConfigVariantsTable, type ConfigsDataLayer, type ConfigsTable, type CortexProviderConfig, CostResult, type CostSummaryGroupBy, DEFAULT_PROVIDER_ENV_VARS, type DataLayer, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, type Dataset, type DatasetRecord, DatasetRecordsTable, type DatasetVersion, type DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, type DatasetsDataLayer, DatasetsTable, type Environment, type EnvironmentSecret, type EnvironmentSecretsDataLayer, type EnvironmentSecretsTable, type EnvironmentsDataLayer, type EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, type GatewayManifest, type GoogleProviderConfig, type GuardrailConfig, type GuardrailConfigsDataLayer, GuardrailConfigsTable, type GuardrailResult, type GuardrailResults, type HuggingFaceProviderConfig, type InlineProviderConfig, type InlineProvidersConfig, Insertable, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMOpsPricingProvider, type LLMRequest, type LLMRequestInsert, type LLMRequestsDataLayer, LLMRequestsTable, MS, ManifestBuilder, type ManifestConfig, type ManifestEnvironment, type ManifestGuardrail, type ManifestProviderGuardrailOverride, ManifestRouter, ManifestService, type ManifestTargetingRule, type ManifestVariantVersion, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing, type OpenAIProviderConfig, type OracleProviderConfig, type Playground, type PlaygroundColumn, type PlaygroundResult, type PlaygroundResultsDataLayer, PlaygroundResultsTable, type PlaygroundRun, type PlaygroundRunsDataLayer, PlaygroundRunsTable, type PlaygroundsDataLayer, PlaygroundsTable, Prettify, PricingProvider, type ProviderConfig, type ProviderConfigMap, type ProviderConfigsDataLayer, ProviderConfigsTable, type ProviderGuardrailOverride, type ProviderGuardrailOverridesDataLayer, ProviderGuardrailOverridesTable, type ProvidersConfig, type RoutingContext, type RoutingResult, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, Span, SpanEvent, type SpanEventInsert, SpanEventsTable, type SpanInsert, SpansTable, type StabilityAIProviderConfig, SupportedProviders, type TableName, type TargetingRule, type TargetingRulesDataLayer, type TargetingRulesTable, Trace, type TraceUpsert, type TracesDataLayer, TracesTable, Updateable, UsageData, type ValidatedLLMOpsConfig, type Variant, VariantJsonData, type VariantVersion, type VariantVersionsDataLayer, VariantVersionsTable, type VariantsDataLayer, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, type WorkspaceSettings, type WorkspaceSettingsDataLayer, WorkspaceSettingsTable, calculateCacheAwareCost, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createConfigDataLayer, createConfigVariantDataLayer, createDataLayer, createDatabase, createDatabaseFromConnection, createDatasetsDataLayer, createEnvironmentDataLayer, createEnvironmentSecretDataLayer, createGuardrailConfigsDataLayer, createLLMRequestsDataLayer, createNeonDialect, createPlaygroundDataLayer, createPlaygroundResultsDataLayer, createPlaygroundRunsDataLayer, createProviderConfigsDataLayer, createProviderGuardrailOverridesDataLayer, createTargetingRulesDataLayer, createTracesDataLayer, createVariantDataLayer, createVariantVersionsDataLayer, createWorkspaceSettingsDataLayer, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getDefaultProviders, getMigrations, guardrailConfigsSchema, llmRequestsSchema, llmopsConfigSchema, logger, matchType, mergeWithDefaultProviders, microDollarsToDollars, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as schemas, B as any, C as llmRequestsSchema, D as playgroundsSchema, E as playgroundRunsSchema, F as variantVersionsSchema, G as object, H as boolean, I as variantsSchema, J as union, K as record, L as workspaceSettingsSchema, M as spansSchema, N as targetingRulesSchema, O as providerConfigsSchema, P as tracesSchema, R as zod_default, S as guardrailConfigsSchema, T as playgroundResultsSchema, U as literal, V as array, W as number, Y as unknown, _ as datasetVersionRecordsSchema, a as matchType, b as environmentSecretsSchema, c as logger, d as validatePartialTableData, f as validateTableData, g as datasetRecordsSchema, h as configsSchema, i as getMigrations, j as spanEventsSchema, k as providerGuardrailOverridesSchema, l as parsePartialTableData, m as configVariantsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as SCHEMA_METADATA, q as string, r as detectDatabaseType, s as getAuthClientOptions, t as createDatabase, u as parseTableData, v as datasetVersionsSchema, w as playgroundColumnSchema, x as environmentsSchema, y as datasetsSchema, z as _enum } from "./db-
|
|
1
|
+
import { A as schemas, B as any, C as llmRequestsSchema, D as playgroundsSchema, E as playgroundRunsSchema, F as variantVersionsSchema, G as object, H as boolean, I as variantsSchema, J as union, K as record, L as workspaceSettingsSchema, M as spansSchema, N as targetingRulesSchema, O as providerConfigsSchema, P as tracesSchema, R as zod_default, S as guardrailConfigsSchema, T as playgroundResultsSchema, U as literal, V as array, W as number, Y as unknown, _ as datasetVersionRecordsSchema, a as matchType, b as environmentSecretsSchema, c as logger, d as validatePartialTableData, f as validateTableData, g as datasetRecordsSchema, h as configsSchema, i as getMigrations, j as spanEventsSchema, k as providerGuardrailOverridesSchema, l as parsePartialTableData, m as configVariantsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as SCHEMA_METADATA, q as string, r as detectDatabaseType, s as getAuthClientOptions, t as createDatabase, u as parseTableData, v as datasetVersionsSchema, w as playgroundColumnSchema, x as environmentsSchema, y as datasetsSchema, z as _enum } from "./db-Cd1KR24Y.mjs";
|
|
2
2
|
import { n as executeWithSchema, t as createNeonDialect } from "./neon-dialect-DySGBYUi.mjs";
|
|
3
3
|
import gateway from "@llmops/gateway";
|
|
4
4
|
import { sql } from "kysely";
|
|
@@ -2000,7 +2000,9 @@ const insertLLMRequestSchema = zod_default.object({
|
|
|
2000
2000
|
completionTokens: zod_default.number().int().default(0),
|
|
2001
2001
|
totalTokens: zod_default.number().int().default(0),
|
|
2002
2002
|
cachedTokens: zod_default.number().int().default(0),
|
|
2003
|
+
cacheCreationTokens: zod_default.number().int().default(0),
|
|
2003
2004
|
cost: zod_default.number().int().default(0),
|
|
2005
|
+
cacheSavings: zod_default.number().int().default(0),
|
|
2004
2006
|
inputCost: zod_default.number().int().default(0),
|
|
2005
2007
|
outputCost: zod_default.number().int().default(0),
|
|
2006
2008
|
endpoint: zod_default.string(),
|
|
@@ -2095,7 +2097,9 @@ const createLLMRequestsDataLayer = (db) => {
|
|
|
2095
2097
|
completionTokens: req.completionTokens,
|
|
2096
2098
|
totalTokens: req.totalTokens,
|
|
2097
2099
|
cachedTokens: req.cachedTokens,
|
|
2100
|
+
cacheCreationTokens: req.cacheCreationTokens,
|
|
2098
2101
|
cost: req.cost,
|
|
2102
|
+
cacheSavings: req.cacheSavings,
|
|
2099
2103
|
inputCost: req.inputCost,
|
|
2100
2104
|
outputCost: req.outputCost,
|
|
2101
2105
|
endpoint: req.endpoint,
|
|
@@ -2133,7 +2137,9 @@ const createLLMRequestsDataLayer = (db) => {
|
|
|
2133
2137
|
completionTokens: req.completionTokens,
|
|
2134
2138
|
totalTokens: req.totalTokens,
|
|
2135
2139
|
cachedTokens: req.cachedTokens,
|
|
2140
|
+
cacheCreationTokens: req.cacheCreationTokens,
|
|
2136
2141
|
cost: req.cost,
|
|
2142
|
+
cacheSavings: req.cacheSavings,
|
|
2137
2143
|
inputCost: req.inputCost,
|
|
2138
2144
|
outputCost: req.outputCost,
|
|
2139
2145
|
endpoint: req.endpoint,
|
|
@@ -2195,6 +2201,8 @@ const createLLMRequestsDataLayer = (db) => {
|
|
|
2195
2201
|
sql`COALESCE(SUM(${col$1("promptTokens")}), 0)`.as("totalPromptTokens"),
|
|
2196
2202
|
sql`COALESCE(SUM(${col$1("completionTokens")}), 0)`.as("totalCompletionTokens"),
|
|
2197
2203
|
sql`COALESCE(SUM(${col$1("totalTokens")}), 0)`.as("totalTokens"),
|
|
2204
|
+
sql`COALESCE(SUM(${col$1("cachedTokens")}), 0)`.as("totalCachedTokens"),
|
|
2205
|
+
sql`COALESCE(SUM(${col$1("cacheSavings")}), 0)`.as("totalCacheSavings"),
|
|
2198
2206
|
sql`COUNT(*)`.as("requestCount")
|
|
2199
2207
|
]).where(sql`${col$1("createdAt")} >= ${startDate.toISOString()}`).where(sql`${col$1("createdAt")} <= ${endDate.toISOString()}`);
|
|
2200
2208
|
if (configId) query = query.where("configId", "=", configId);
|
|
@@ -3708,7 +3716,64 @@ function calculateCost(usage, pricing) {
|
|
|
3708
3716
|
return {
|
|
3709
3717
|
inputCost,
|
|
3710
3718
|
outputCost,
|
|
3711
|
-
totalCost: inputCost + outputCost
|
|
3719
|
+
totalCost: inputCost + outputCost,
|
|
3720
|
+
cacheSavings: 0
|
|
3721
|
+
};
|
|
3722
|
+
}
|
|
3723
|
+
/**
|
|
3724
|
+
* Get default cache read rate as a fraction of input cost per provider.
|
|
3725
|
+
* Used when models.dev doesn't provide cache pricing.
|
|
3726
|
+
*/
|
|
3727
|
+
function getDefaultCacheReadRate(provider, inputCostPer1M) {
|
|
3728
|
+
switch (provider?.toLowerCase()) {
|
|
3729
|
+
case "anthropic": return inputCostPer1M * .1;
|
|
3730
|
+
case "openai":
|
|
3731
|
+
case "azure-openai": return inputCostPer1M * .5;
|
|
3732
|
+
case "google":
|
|
3733
|
+
case "gemini":
|
|
3734
|
+
case "vertex_ai": return inputCostPer1M * .25;
|
|
3735
|
+
default: return inputCostPer1M * .5;
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
/**
|
|
3739
|
+
* Get default cache write/creation rate as a fraction of input cost per provider.
|
|
3740
|
+
* Used when models.dev doesn't provide cache pricing.
|
|
3741
|
+
*/
|
|
3742
|
+
function getDefaultCacheWriteRate(provider, inputCostPer1M) {
|
|
3743
|
+
switch (provider?.toLowerCase()) {
|
|
3744
|
+
case "anthropic": return inputCostPer1M * 1.25;
|
|
3745
|
+
default: return inputCostPer1M;
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
/**
|
|
3749
|
+
* Calculate cache-aware cost of an LLM request in micro-dollars.
|
|
3750
|
+
*
|
|
3751
|
+
* Splits input tokens into uncached, cache-read, and cache-creation buckets,
|
|
3752
|
+
* each priced at different rates. Falls back to provider-specific multipliers
|
|
3753
|
+
* when models.dev doesn't provide cache pricing.
|
|
3754
|
+
*
|
|
3755
|
+
* @param usage - Token usage data (with cachedTokens and cacheCreationTokens)
|
|
3756
|
+
* @param pricing - Model pricing (may include cacheReadCostPer1M / cacheWriteCostPer1M)
|
|
3757
|
+
* @param provider - Provider name for fallback rate selection
|
|
3758
|
+
* @returns Cost breakdown in micro-dollars
|
|
3759
|
+
*/
|
|
3760
|
+
function calculateCacheAwareCost(usage, pricing, provider) {
|
|
3761
|
+
const cachedTokens = usage.cachedTokens ?? 0;
|
|
3762
|
+
const cacheCreationTokens = usage.cacheCreationTokens ?? 0;
|
|
3763
|
+
if (cachedTokens === 0 && cacheCreationTokens === 0) return calculateCost(usage, pricing);
|
|
3764
|
+
const cacheReadRate = pricing.cacheReadCostPer1M ?? getDefaultCacheReadRate(provider, pricing.inputCostPer1M);
|
|
3765
|
+
const cacheWriteRate = pricing.cacheWriteCostPer1M ?? getDefaultCacheWriteRate(provider, pricing.inputCostPer1M);
|
|
3766
|
+
const uncachedInputTokens = Math.max(0, usage.promptTokens - cachedTokens - cacheCreationTokens);
|
|
3767
|
+
const regularInputCost = Math.round(uncachedInputTokens * pricing.inputCostPer1M);
|
|
3768
|
+
const cacheReadCost = Math.round(cachedTokens * cacheReadRate);
|
|
3769
|
+
const cacheWriteCost = Math.round(cacheCreationTokens * cacheWriteRate);
|
|
3770
|
+
const outputCost = Math.round(usage.completionTokens * pricing.outputCostPer1M);
|
|
3771
|
+
const inputCost = regularInputCost + cacheReadCost + cacheWriteCost;
|
|
3772
|
+
return {
|
|
3773
|
+
inputCost,
|
|
3774
|
+
outputCost,
|
|
3775
|
+
totalCost: inputCost + outputCost,
|
|
3776
|
+
cacheSavings: Math.round((cachedTokens + cacheCreationTokens) * pricing.inputCostPer1M) - cacheReadCost - cacheWriteCost
|
|
3712
3777
|
};
|
|
3713
3778
|
}
|
|
3714
3779
|
/**
|
|
@@ -3760,111 +3825,108 @@ function formatCost(microDollars, decimals = 6) {
|
|
|
3760
3825
|
|
|
3761
3826
|
//#endregion
|
|
3762
3827
|
//#region src/pricing/provider.ts
|
|
3763
|
-
const
|
|
3828
|
+
const LLMOPS_MODELS_API = "https://models.llmops.build";
|
|
3829
|
+
/**
|
|
3830
|
+
* Convert price from USD cents per token to dollars per 1M tokens.
|
|
3831
|
+
*
|
|
3832
|
+
* API returns cents/token. Our system uses dollars/1M tokens.
|
|
3833
|
+
* Formula: (centsPerToken / 100) * 1_000_000 = centsPerToken * 10_000
|
|
3834
|
+
*/
|
|
3835
|
+
function centsPerTokenToCostPer1M(centsPerToken) {
|
|
3836
|
+
return centsPerToken * 1e4;
|
|
3837
|
+
}
|
|
3764
3838
|
/**
|
|
3765
|
-
* Pricing provider that fetches data from
|
|
3839
|
+
* Pricing provider that fetches per-model data from the LLMOps Models API.
|
|
3766
3840
|
*
|
|
3767
3841
|
* Features:
|
|
3768
|
-
* -
|
|
3769
|
-
* -
|
|
3770
|
-
* -
|
|
3842
|
+
* - Per-model in-memory cache with configurable TTL (default 5 minutes)
|
|
3843
|
+
* - Deduplicates concurrent fetches for the same model
|
|
3844
|
+
* - Caches null results (404s) to avoid repeated lookups
|
|
3845
|
+
* - Falls back to stale cache on fetch errors
|
|
3771
3846
|
*/
|
|
3772
|
-
var
|
|
3847
|
+
var LLMOpsPricingProvider = class {
|
|
3773
3848
|
cache = /* @__PURE__ */ new Map();
|
|
3774
|
-
|
|
3849
|
+
pendingFetches = /* @__PURE__ */ new Map();
|
|
3775
3850
|
cacheTTL;
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
*
|
|
3781
|
-
* @param cacheTTL - Cache TTL in milliseconds (default: 5 minutes)
|
|
3782
|
-
*/
|
|
3783
|
-
constructor(cacheTTL = 300 * 1e3) {
|
|
3784
|
-
this.cacheTTL = cacheTTL;
|
|
3851
|
+
baseUrl;
|
|
3852
|
+
constructor(options) {
|
|
3853
|
+
this.cacheTTL = options?.cacheTTL ?? 300 * 1e3;
|
|
3854
|
+
this.baseUrl = options?.baseUrl ?? LLMOPS_MODELS_API;
|
|
3785
3855
|
}
|
|
3786
|
-
/**
|
|
3787
|
-
* Generate a cache key for a provider/model combination
|
|
3788
|
-
*/
|
|
3789
3856
|
getCacheKey(provider, model) {
|
|
3790
3857
|
return `${provider.toLowerCase()}:${model.toLowerCase()}`;
|
|
3791
3858
|
}
|
|
3792
3859
|
/**
|
|
3793
|
-
* Fetch pricing
|
|
3860
|
+
* Fetch pricing for a single model from the API
|
|
3794
3861
|
*/
|
|
3795
|
-
async
|
|
3862
|
+
async fetchModelPricing(provider, model) {
|
|
3863
|
+
const url = `${this.baseUrl}/model-configs/pricing/${encodeURIComponent(provider)}/${model}`;
|
|
3796
3864
|
try {
|
|
3797
|
-
logger.debug(
|
|
3798
|
-
const
|
|
3799
|
-
|
|
3800
|
-
const
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
if (!model.cost) continue;
|
|
3806
|
-
const cacheKey = this.getCacheKey(providerId, model.id);
|
|
3807
|
-
this.cache.set(cacheKey, {
|
|
3808
|
-
inputCostPer1M: model.cost.input ?? 0,
|
|
3809
|
-
outputCostPer1M: model.cost.output ?? 0,
|
|
3810
|
-
cacheReadCostPer1M: model.cost.cache_read,
|
|
3811
|
-
cacheWriteCostPer1M: model.cost.cache_write,
|
|
3812
|
-
reasoningCostPer1M: model.cost.reasoning
|
|
3813
|
-
});
|
|
3814
|
-
const nameKey = this.getCacheKey(providerId, model.name);
|
|
3815
|
-
if (nameKey !== cacheKey) this.cache.set(nameKey, this.cache.get(cacheKey));
|
|
3816
|
-
}
|
|
3865
|
+
logger.debug(`[Pricing] GET ${url}`);
|
|
3866
|
+
const startTime = Date.now();
|
|
3867
|
+
const response = await fetch(url);
|
|
3868
|
+
const elapsed = Date.now() - startTime;
|
|
3869
|
+
logger.debug(`[Pricing] GET ${url} -> ${response.status} (${elapsed}ms)`);
|
|
3870
|
+
if (response.status === 404) {
|
|
3871
|
+
logger.debug(`[Pricing] No pricing found for ${provider}/${model}`);
|
|
3872
|
+
return null;
|
|
3817
3873
|
}
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3874
|
+
if (!response.ok) throw new Error(`API returned ${response.status}`);
|
|
3875
|
+
const data = await response.json();
|
|
3876
|
+
if (!data.pay_as_you_go) return null;
|
|
3877
|
+
const payg = data.pay_as_you_go;
|
|
3878
|
+
const pricing = {
|
|
3879
|
+
inputCostPer1M: centsPerTokenToCostPer1M(payg.request_token?.price ?? 0),
|
|
3880
|
+
outputCostPer1M: centsPerTokenToCostPer1M(payg.response_token?.price ?? 0),
|
|
3881
|
+
cacheReadCostPer1M: payg.cache_read_input_token?.price != null ? centsPerTokenToCostPer1M(payg.cache_read_input_token.price) : void 0,
|
|
3882
|
+
cacheWriteCostPer1M: payg.cache_write_input_token?.price != null ? centsPerTokenToCostPer1M(payg.cache_write_input_token.price) : void 0
|
|
3883
|
+
};
|
|
3884
|
+
logger.debug(`[Pricing] Cached pricing for ${provider}/${model}: input=$${pricing.inputCostPer1M}/1M, output=$${pricing.outputCostPer1M}/1M`);
|
|
3885
|
+
return pricing;
|
|
3821
3886
|
} catch (error) {
|
|
3822
|
-
logger.error(`[Pricing] Failed to fetch pricing
|
|
3823
|
-
|
|
3887
|
+
logger.error(`[Pricing] Failed to fetch pricing for ${provider}/${model}: ${error instanceof Error ? error.message : String(error)}`);
|
|
3888
|
+
const cacheKey = this.getCacheKey(provider, model);
|
|
3889
|
+
const stale = this.cache.get(cacheKey);
|
|
3890
|
+
if (stale) {
|
|
3891
|
+
logger.debug(`[Pricing] Using stale cache for ${provider}/${model}`);
|
|
3892
|
+
return stale.pricing;
|
|
3893
|
+
}
|
|
3894
|
+
return null;
|
|
3824
3895
|
}
|
|
3825
3896
|
}
|
|
3826
3897
|
/**
|
|
3827
|
-
* Ensure cache is fresh, fetching if necessary
|
|
3828
|
-
*/
|
|
3829
|
-
async ensureFreshCache() {
|
|
3830
|
-
if (!(Date.now() - this.lastFetch > this.cacheTTL) && this.cache.size > 0) return;
|
|
3831
|
-
if (!this.fetchPromise) this.fetchPromise = this.fetchPricingData().finally(() => {
|
|
3832
|
-
this.fetchPromise = null;
|
|
3833
|
-
});
|
|
3834
|
-
await this.fetchPromise;
|
|
3835
|
-
}
|
|
3836
|
-
/**
|
|
3837
3898
|
* Get pricing for a specific model
|
|
3838
3899
|
*/
|
|
3839
3900
|
async getModelPricing(provider, model) {
|
|
3840
|
-
await this.ensureFreshCache();
|
|
3841
3901
|
const cacheKey = this.getCacheKey(provider, model);
|
|
3842
|
-
const
|
|
3843
|
-
if (
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
}
|
|
3851
|
-
|
|
3852
|
-
|
|
3902
|
+
const cached = this.cache.get(cacheKey);
|
|
3903
|
+
if (cached && Date.now() - cached.fetchedAt < this.cacheTTL) return cached.pricing;
|
|
3904
|
+
let pending = this.pendingFetches.get(cacheKey);
|
|
3905
|
+
if (!pending) {
|
|
3906
|
+
pending = this.fetchModelPricing(provider, model).then((pricing) => {
|
|
3907
|
+
this.cache.set(cacheKey, {
|
|
3908
|
+
pricing,
|
|
3909
|
+
fetchedAt: Date.now()
|
|
3910
|
+
});
|
|
3911
|
+
return pricing;
|
|
3912
|
+
}).finally(() => {
|
|
3913
|
+
this.pendingFetches.delete(cacheKey);
|
|
3914
|
+
});
|
|
3915
|
+
this.pendingFetches.set(cacheKey, pending);
|
|
3853
3916
|
}
|
|
3854
|
-
return
|
|
3917
|
+
return pending;
|
|
3855
3918
|
}
|
|
3856
3919
|
/**
|
|
3857
|
-
* Force refresh the pricing cache
|
|
3920
|
+
* Force refresh the pricing cache (clears all cached entries)
|
|
3858
3921
|
*/
|
|
3859
3922
|
async refreshCache() {
|
|
3860
|
-
this.
|
|
3861
|
-
await this.ensureFreshCache();
|
|
3923
|
+
this.cache.clear();
|
|
3862
3924
|
}
|
|
3863
3925
|
/**
|
|
3864
|
-
*
|
|
3926
|
+
* Always ready — no bulk pre-fetch needed
|
|
3865
3927
|
*/
|
|
3866
3928
|
isReady() {
|
|
3867
|
-
return
|
|
3929
|
+
return true;
|
|
3868
3930
|
}
|
|
3869
3931
|
/**
|
|
3870
3932
|
* Get the number of cached models (for debugging)
|
|
@@ -3878,7 +3940,7 @@ let defaultProvider = null;
|
|
|
3878
3940
|
* Get the default pricing provider instance
|
|
3879
3941
|
*/
|
|
3880
3942
|
function getDefaultPricingProvider() {
|
|
3881
|
-
if (!defaultProvider) defaultProvider = new
|
|
3943
|
+
if (!defaultProvider) defaultProvider = new LLMOpsPricingProvider();
|
|
3882
3944
|
return defaultProvider;
|
|
3883
3945
|
}
|
|
3884
3946
|
|
|
@@ -4251,4 +4313,4 @@ var ManifestRouter = class {
|
|
|
4251
4313
|
};
|
|
4252
4314
|
|
|
4253
4315
|
//#endregion
|
|
4254
|
-
export { COST_SUMMARY_GROUP_BY, CacheService, DEFAULT_PROVIDER_ENV_VARS, FileCacheBackend, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, MS, ManifestBuilder, ManifestRouter, ManifestService, MemoryCacheBackend,
|
|
4316
|
+
export { COST_SUMMARY_GROUP_BY, CacheService, DEFAULT_PROVIDER_ENV_VARS, FileCacheBackend, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, LLMOpsPricingProvider, MS, ManifestBuilder, ManifestRouter, ManifestService, MemoryCacheBackend, SCHEMA_METADATA, SupportedProviders, calculateCacheAwareCost, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createConfigDataLayer, createConfigVariantDataLayer, createDataLayer, createDatabase, createDatabaseFromConnection, createDatasetsDataLayer, createEnvironmentDataLayer, createEnvironmentSecretDataLayer, createGuardrailConfigsDataLayer, createLLMRequestsDataLayer, createNeonDialect, createPlaygroundDataLayer, createPlaygroundResultsDataLayer, createPlaygroundRunsDataLayer, createProviderConfigsDataLayer, createProviderGuardrailOverridesDataLayer, createTargetingRulesDataLayer, createTracesDataLayer, createVariantDataLayer, createVariantVersionsDataLayer, createWorkspaceSettingsDataLayer, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getDefaultProviders, getMigrations, guardrailConfigsSchema, llmRequestsSchema, llmopsConfigSchema, logger, matchType, mergeWithDefaultProviders, microDollarsToDollars, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Core LLMOps functionality and utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"kysely": "^0.28.8",
|
|
56
56
|
"kysely-neon": "^2.0.2",
|
|
57
57
|
"pino": "^10.1.0",
|
|
58
|
-
"@llmops/gateway": "^0.6.
|
|
58
|
+
"@llmops/gateway": "^0.6.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/json-logic-js": "^2.0.8",
|