UNPKG

ollama-api-facade-js

Version:

OllamaApiFacadeJS is an open-source library for running an ExpressJS backend as an Ollama API using LangChainJS. It supports local language models services like LmStudio and allows seamless message conversion and streaming between LangChainJS and Ollama c

19 lines 1.01 kB
import { Express } from 'express'; import { BaseChatModel } from '@langchain/core/language_models/chat_models'; import { OllamaApiFacade } from './core/OllamaApiFacade'; /** * Creates an instance of OllamaApiFacade. * This function sets up the necessary routes and middleware for the Express application * to handle chat requests from Ollama clients and stream responses back to them. * * @param {Express} app - The Express application instance. * @param {BaseChatModel} baseChatModel - The base chat model to handle chat messages. * @param {string} [modelName='nodeapi'] - The name of the chat model. * @returns {OllamaApiFacade} - The created OllamaApiFacade instance. */ export declare function createOllamaApiFacade(app: Express, baseChatModel: BaseChatModel | any, modelName?: string): OllamaApiFacade; export * from './models/ChatModels'; export * from './config/LMStudioConfig'; export * from './utils/MessageUtils'; export * from './core/ToolCallService'; //# sourceMappingURL=index.d.ts.map