UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with external MCP server integration, multi-provider support, and professional CLI. Connect to 65+ MCP servers for filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major pr

52 lines (51 loc) 1.86 kB
/** * Ollama Provider for NeuroLink * * Local AI model deployment and management using Ollama. * Provides offline AI capabilities with local model hosting. * * Features: * - Local model deployment (privacy-first) * - Model management (download, list, remove) * - Health checking and service validation * - Streaming and non-streaming text generation */ import type { AIProvider, TextGenerationOptions, StreamTextOptions } from '../core/types.js'; import type { GenerateTextResult, StreamTextResult, ToolSet } from 'ai'; import type { ZodType, ZodTypeDef } from 'zod'; import type { Schema } from 'ai'; export declare class Ollama implements AIProvider { private baseUrl; private modelName; private timeout; constructor(modelName?: string); /** * Gets the appropriate model instance * @private */ private getModel; /** * Health check - verify Ollama service is running and accessible */ checkHealth(): Promise<boolean>; /** * List available models on the Ollama instance */ listModels(): Promise<string[]>; /** * Check if a specific model is available */ isModelAvailable(modelName: string): Promise<boolean>; /** * Pull/download a model to the local Ollama instance */ pullModel(modelName: string): Promise<void>; /** * Generate text using Ollama local models */ generateText(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<GenerateTextResult<ToolSet, unknown> | null>; /** * Generate streaming text using Ollama local models */ streamText(optionsOrPrompt: StreamTextOptions | string, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<StreamTextResult<ToolSet, unknown> | null>; }