/** * Spitfire API Types * TypeScript definitions matching Ollama's API specification */ export type ImageData = string; export interface StatusError { statusCode: number; status: string; error: string; } export interface AuthorizationError { statusCode: number; status: string; signinUrl: string; } export interface ToolCallFunctionArguments { [key: string]: unknown; } export interface ToolCallFunction { index: number; name: string; arguments: ToolCallFunctionArguments; } export interface ToolCall { id?: string; function: ToolCallFunction; } export interface ToolProperty { anyOf?: ToolProperty[]; type?: string | string[]; items?: unknown; description?: string; enum?: unknown[]; } export interface ToolFunctionParameters { type: string; $defs?: unknown; items?: unknown; required?: string[]; properties: Record; } export interface ToolFunction { name: string; description?: string; parameters: ToolFunctionParameters; } export interface Tool { type: string; items?: unknown; function: ToolFunction; } export interface Message { role: 'system' | 'user' | 'assistant' | 'tool'; content: string; thinking?: string; images?: ImageData[]; toolCalls?: ToolCall[]; toolName?: string; toolCallId?: string; } export type ThinkValue = boolean | 'high' | 'medium' | 'low'; export type Duration = number | string; export interface RunnerOptions { numCtx?: number; numBatch?: number; numGpu?: number; mainGpu?: number; useMmap?: boolean; numThread?: number; } export interface ModelOptions extends RunnerOptions { numKeep?: number; seed?: number; numPredict?: number; topK?: number; topP?: number; minP?: number; typicalP?: number; repeatLastN?: number; temperature?: number; repeatPenalty?: number; presencePenalty?: number; frequencyPenalty?: number; stop?: string[]; } export interface TokenLogprob { token: string; logprob: number; bytes?: number[]; } export interface Logprob extends TokenLogprob { topLogprobs?: TokenLogprob[]; } export interface Metrics { totalDuration?: number; loadDuration?: number; promptEvalCount?: number; promptEvalDuration?: number; evalCount?: number; evalDuration?: number; } export interface DebugInfo { renderedTemplate: string; imageCount?: number; } export interface GenerateRequest { model: string; prompt: string; suffix?: string; system?: string; template?: string; context?: number[]; stream?: boolean; raw?: boolean; format?: unknown; keepAlive?: Duration; images?: ImageData[]; options?: ModelOptions; think?: ThinkValue; truncate?: boolean; shift?: boolean; logprobs?: boolean; topLogprobs?: number; } export interface ChatRequest { model: string; messages: Message[]; stream?: boolean; format?: unknown; keepAlive?: Duration; tools?: Tool[]; options?: ModelOptions; think?: ThinkValue; truncate?: boolean; shift?: boolean; logprobs?: boolean; topLogprobs?: number; } export interface EmbedRequest { model: string; input: string | string[]; keepAlive?: Duration; truncate?: boolean; dimensions?: number; options?: ModelOptions; } export interface EmbeddingRequest { model: string; prompt: string; keepAlive?: Duration; options?: ModelOptions; } export interface CreateRequest { model: string; stream?: boolean; quantize?: string; from?: string; remoteHost?: string; files?: Record; adapters?: Record; template?: string; license?: string | string[]; system?: string; parameters?: Record; messages?: Message[]; renderer?: string; parser?: string; info?: Record; } export interface DeleteRequest { model: string; } export interface ShowRequest { model: string; system?: string; template?: string; verbose?: boolean; options?: ModelOptions; } export interface CopyRequest { source: string; destination: string; } export interface PullRequest { model: string; stream?: boolean; } export interface PushRequest { model: string; insecure?: boolean; stream?: boolean; } export interface GenerateResponse extends Metrics { model: string; remoteModel?: string; remoteHost?: string; createdAt: string; response: string; thinking?: string; done: boolean; doneReason?: string; context?: number[]; toolCalls?: ToolCall[]; logprobs?: Logprob[]; } export interface ChatResponse extends Metrics { model: string; remoteModel?: string; remoteHost?: string; createdAt: string; message: Message; done: boolean; doneReason?: string; logprobs?: Logprob[]; } export interface EmbedResponse { model: string; embeddings: number[][]; totalDuration?: number; loadDuration?: number; promptEvalCount?: number; } export interface EmbeddingResponse { embedding: number[]; } export interface ProgressResponse { status: string; digest?: string; total?: number; completed?: number; } export interface ModelDetails { parentModel: string; format: string; family: string; families: string[]; parameterSize: string; quantizationLevel: string; } export interface Tensor { name: string; type: string; shape: number[]; } export interface ShowResponse { license?: string; modelfile?: string; parameters?: string; template?: string; system?: string; renderer?: string; parser?: string; details?: ModelDetails; messages?: Message[]; remoteModel?: string; remoteHost?: string; modelInfo?: Record; projectorInfo?: Record; tensors?: Tensor[]; capabilities?: string[]; modifiedAt?: string; } export interface ListModelResponse { name: string; model: string; remoteModel?: string; remoteHost?: string; modifiedAt: string; size: number; digest: string; details?: ModelDetails; } export interface ListResponse { models: ListModelResponse[]; } export interface ProcessModelResponse { name: string; model: string; size: number; digest: string; details?: ModelDetails; expiresAt: string; sizeVram: number; contextLength: number; } export interface ProcessResponse { models: ProcessModelResponse[]; } export declare const DEFAULT_OPTIONS: ModelOptions; export declare const DEFAULT_KEEP_ALIVE: Duration; //# sourceMappingURL=api.d.ts.map