@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio
58 lines (57 loc) • 2.14 kB
TypeScript
import { type LanguageModel, type Schema } from "ai";
import type { ZodType } from "zod";
import type { AIProviderName } from "../constants/enums.js";
import { BaseProvider } from "../core/baseProvider.js";
import type { StreamOptions, StreamResult } from "../types/index.js";
/**
* LiteLLM Provider - BaseProvider Implementation
* Provides access to 100+ models via LiteLLM proxy server
*/
export declare class LiteLLMProvider extends BaseProvider {
private model;
private credentials?;
private static modelsCache;
private static modelsCacheTime;
private static readonly MODELS_CACHE_DURATION;
constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: {
apiKey?: string;
baseURL?: string;
});
protected getProviderName(): AIProviderName;
protected getDefaultModel(): string;
/**
* Returns the Vercel AI SDK model instance for LiteLLM
*/
protected getAISDKModel(): LanguageModel;
formatProviderError(error: unknown): Error;
/**
* LiteLLM supports tools for compatible models
*/
supportsTools(): boolean;
/**
* Provider-specific streaming implementation
* Note: This is only used when tools are disabled
*/
protected executeStream(options: StreamOptions, analysisSchema?: ZodType | Schema<unknown>): Promise<StreamResult>;
private createLiteLLMTransformedStream;
/**
* Generate an embedding for a single text input
* Uses the LiteLLM proxy with OpenAI-compatible embedding API
*/
embed(text: string, modelName?: string): Promise<number[]>;
/**
* Generate embeddings for multiple text inputs
* Uses the LiteLLM proxy with OpenAI-compatible embedding API
*/
embedMany(texts: string[], modelName?: string): Promise<number[][]>;
/**
* Get available models from LiteLLM proxy server
* Dynamically fetches from /v1/models endpoint with caching and fallback
*/
getAvailableModels(): Promise<string[]>;
/**
* Fetch available models from LiteLLM proxy /v1/models endpoint
* @private
*/
private fetchModelsFromAPI;
}