UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

317 lines 9.85 kB
import * as z from "zod/v3"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./sdkvalidationerror.js"; /** * Pin scope: `specific` (one provider region), `zone` (geo zone), or `global`. */ export declare const AiGatewayVirtualModelConfigInferenceRegionScope: { readonly Global: "global"; readonly Specific: "specific"; readonly Zone: "zone"; }; /** * Pin scope: `specific` (one provider region), `zone` (geo zone), or `global`. */ export type AiGatewayVirtualModelConfigInferenceRegionScope = ClosedEnum<typeof AiGatewayVirtualModelConfigInferenceRegionScope>; /** * Per-provider region overrides keyed by provider slug. */ export type Providers = { /** * Pin scope: `specific` (one provider region), `zone` (geo zone), or `global`. */ scope?: AiGatewayVirtualModelConfigInferenceRegionScope | undefined; /** * Geo zone (e.g. "us", "eu"). */ geoRegion?: string | undefined; /** * Provider-specific region identifier. */ providerRegion?: string | undefined; }; /** * Pin scope: `specific` (one provider region), `zone` (geo zone), or `global`. */ export declare const AiGatewayVirtualModelConfigScope: { readonly Global: "global"; readonly Specific: "specific"; readonly Zone: "zone"; }; /** * Pin scope: `specific` (one provider region), `zone` (geo zone), or `global`. */ export type AiGatewayVirtualModelConfigScope = ClosedEnum<typeof AiGatewayVirtualModelConfigScope>; /** * Region pinned on the VMC for system-credential routing (alias/router only). */ export type InferenceRegion = { /** * Per-provider region overrides keyed by provider slug. */ providers?: { [k: string]: Providers | null; } | undefined; /** * Pin scope: `specific` (one provider region), `zone` (geo zone), or `global`. */ scope?: AiGatewayVirtualModelConfigScope | undefined; /** * Geo zone (e.g. "us", "eu"). */ geoRegion?: string | undefined; /** * Provider-specific region identifier. */ providerRegion?: string | undefined; }; /** * For kind=router: how to order candidates. */ export declare const Selector: { readonly Cost: "cost"; readonly Priority: "priority"; readonly Tps: "tps"; readonly Ttft: "ttft"; }; /** * For kind=router: how to order candidates. */ export type Selector = ClosedEnum<typeof Selector>; /** * Rank eligible providers by an attribute. */ export declare const Sort: { readonly Cost: "cost"; readonly Latency: "latency"; readonly Price: "price"; readonly Throughput: "throughput"; readonly Tps: "tps"; readonly Ttft: "ttft"; }; /** * Rank eligible providers by an attribute. */ export type Sort = ClosedEnum<typeof Sort>; /** * Limit providers to those with these features. */ export declare const Has: { readonly ImplicitCaching: "implicit-caching"; readonly Vision: "vision"; }; /** * Limit providers to those with these features. */ export type Has = ClosedEnum<typeof Has>; /** * Use caching if available. */ export declare const Caching: { readonly Auto: "auto"; }; /** * Use caching if available. */ export type Caching = ClosedEnum<typeof Caching>; /** * Service tier for providers that support it. */ export declare const ServiceTier: { readonly Fast: "fast"; readonly Flex: "flex"; readonly Priority: "priority"; }; /** * Service tier for providers that support it. */ export type ServiceTier = ClosedEnum<typeof ServiceTier>; /** * Per-request provider timeouts in ms, keyed by provider slug for BYOK credentials. */ export type ProviderTimeouts = { byok?: { [k: string]: number; } | undefined; }; /** * Only use fastest providers with short timeouts. */ export declare const Speed: { readonly Fast: "fast"; }; /** * Only use fastest providers with short timeouts. */ export type Speed = ClosedEnum<typeof Speed>; /** * Public response shape for virtual model configs. Used so OpenAPI generation can avoid ElectroDB's recursive EntityItem types. */ export type AiGatewayVirtualModelConfig = { /** * Team (owner) that owns this VMC. */ ownerId: string; /** * Client-facing alias used as the model slug in Gateway calls. */ virtualModelSlug: string; /** * Human-readable name for UI. */ displayName?: string | undefined; /** * Optional description for UI. */ description?: string | undefined; /** * Whether this VMC is soft-deleted. */ deleted: boolean; /** * UI lifecycle status: draft, active, or archived. */ status: string; /** * Visibility in listings: public, internal, or stealth. */ visibility?: string | undefined; /** * User id that last updated this VMC. */ updatedBy?: string | undefined; /** * VMC kind: alias, relay, or router. */ kind: string; /** * For kind=relay: URL the gateway forwards requests to as a transparent proxy. */ baseUrl?: string | undefined; /** * The concrete model-provider instance this VMC resolves to. */ instanceId?: string | undefined; /** * Ordered list of providers to try as fallbacks on failure. */ providerOrder?: Array<string> | undefined; /** * Restrict routing to only these providers. */ providerOnly?: Array<string> | undefined; /** * Arbitrary per-provider AI SDK options, keyed by gateway provider slug. */ providerOptions?: { [k: string]: { [k: string]: any; }; } | undefined; /** * Region pinned on the VMC for system-credential routing (alias/router only). */ inferenceRegion?: InferenceRegion | undefined; /** * Canonical model slug this VMC maps to (e.g. "creator/model"). Not used by kind=router. */ modelSlug?: string | undefined; /** * For kind=router: ordered candidates, model slugs or router references. Otherwise: fallback models. */ models?: Array<string> | undefined; /** * For kind=router: how to order candidates. */ selector?: Selector | undefined; /** * For kind=router: capability tags a candidate must have. */ requires?: Array<string> | undefined; /** * BYOK credential IDs allowed for this VMC. */ byokCredentialIds?: Array<string> | undefined; /** * Observability tags attached to requests through this VMC. */ observabilityTags?: Array<string> | undefined; /** * Rank eligible providers by an attribute. */ sort?: Sort | undefined; /** * Limit providers to those with these features. */ has?: Array<Has> | undefined; /** * Use caching if available. */ caching?: Caching | undefined; /** * Service tier for providers that support it. */ serviceTier?: ServiceTier | undefined; /** * Per-request provider timeouts in ms, keyed by provider slug for BYOK credentials. */ providerTimeouts?: ProviderTimeouts | undefined; /** * Only use providers with zero data retention. */ zeroDataRetention?: boolean | undefined; /** * Only use HIPAA-compliant providers. */ hipaaCompliant?: boolean | undefined; /** * Only use providers that will not train on your prompts. */ disallowPromptTraining?: boolean | undefined; /** * Only use fastest providers with short timeouts. */ speed?: Speed | undefined; /** * Allow fallback from fast to standard providers on failure. */ allowFallbackFromFast?: boolean | undefined; /** * Creation timestamp (epoch ms). */ createdAt: number; /** * Last update timestamp (epoch ms). */ updatedAt: number; }; /** @internal */ export declare const AiGatewayVirtualModelConfigInferenceRegionScope$inboundSchema: z.ZodNativeEnum<typeof AiGatewayVirtualModelConfigInferenceRegionScope>; /** @internal */ export declare const Providers$inboundSchema: z.ZodType<Providers, z.ZodTypeDef, unknown>; export declare function providersFromJSON(jsonString: string): SafeParseResult<Providers, SDKValidationError>; /** @internal */ export declare const AiGatewayVirtualModelConfigScope$inboundSchema: z.ZodNativeEnum<typeof AiGatewayVirtualModelConfigScope>; /** @internal */ export declare const InferenceRegion$inboundSchema: z.ZodType<InferenceRegion, z.ZodTypeDef, unknown>; export declare function inferenceRegionFromJSON(jsonString: string): SafeParseResult<InferenceRegion, SDKValidationError>; /** @internal */ export declare const Selector$inboundSchema: z.ZodNativeEnum<typeof Selector>; /** @internal */ export declare const Sort$inboundSchema: z.ZodNativeEnum<typeof Sort>; /** @internal */ export declare const Has$inboundSchema: z.ZodNativeEnum<typeof Has>; /** @internal */ export declare const Caching$inboundSchema: z.ZodNativeEnum<typeof Caching>; /** @internal */ export declare const ServiceTier$inboundSchema: z.ZodNativeEnum<typeof ServiceTier>; /** @internal */ export declare const ProviderTimeouts$inboundSchema: z.ZodType<ProviderTimeouts, z.ZodTypeDef, unknown>; export declare function providerTimeoutsFromJSON(jsonString: string): SafeParseResult<ProviderTimeouts, SDKValidationError>; /** @internal */ export declare const Speed$inboundSchema: z.ZodNativeEnum<typeof Speed>; /** @internal */ export declare const AiGatewayVirtualModelConfig$inboundSchema: z.ZodType<AiGatewayVirtualModelConfig, z.ZodTypeDef, unknown>; export declare function aiGatewayVirtualModelConfigFromJSON(jsonString: string): SafeParseResult<AiGatewayVirtualModelConfig, SDKValidationError>; //# sourceMappingURL=aigatewayvirtualmodelconfig.d.ts.map