UNPKG

ai-sdk-ollama

Version:

Vercel AI SDK Provider for Ollama using official ollama-js library

34 lines 1.29 kB
import type { ImageModelV4, ImageModelV4CallOptions, ImageModelV4ProviderMetadata, ImageModelV4Usage } from '@ai-sdk/provider'; import type { SharedV4Warning } from '@ai-sdk/provider'; export interface OllamaImageModelConfig { provider: string; modelId: string; baseURL: string; headers: () => Record<string, string>; fetch?: typeof globalThis.fetch; } /** * Ollama image generation model (ImageModelV4). * Uses POST /api/generate with image models (e.g. x/z-image-turbo, x/flux2-klein). * Experimental; see https://ollama.com/blog/image-generation */ export declare class OllamaImageModel implements ImageModelV4 { private readonly config; readonly specificationVersion: 'v4'; readonly provider: string; readonly modelId: string; readonly maxImagesPerCall = 1; constructor(modelId: string, config: OllamaImageModelConfig); doGenerate(options: ImageModelV4CallOptions): Promise<{ images: Array<string>; warnings: Array<SharedV4Warning>; response: { timestamp: Date; modelId: string; headers: Record<string, string> | undefined; }; usage?: ImageModelV4Usage; providerMetadata?: ImageModelV4ProviderMetadata; }>; } //# sourceMappingURL=image-model.d.ts.map