UniLLM
1.0.0
Unillm允许您使用OpenAI API调用任何LLM,并具有100%的安全性。
使用Unillm,您甚至可以使用聊天完成,即使对于不本地支持的提供商/模型(例如人为)。
npm i unillm import { UniLLM } from 'unillm' ;
const unillm = new UniLLM ( ) ;
// OpenAI
const response = await unillm . createChatCompletion ( "openai/gpt-3.5-turbo" , { messages : ... } ) ;
const response = await unillm . createChatCompletion ( "openai/gpt-4" , { messages : ... } ) ;
// Anthropic
const response = await unillm . createChatCompletion ( "anthropic/claude-2" , { messages : ... } ) ;
const response = await unillm . createChatCompletion ( "anthropic/claude-1-instant" , { messages : ... } ) ;
// Azure OpenAI
const response = await unillm . createChatCompletion ( "azure/openai/<deployment-name>" , { messages : ... } ) ;
// More coming soon!想看更多示例吗?查看交互式文档。
要启用流媒体,只需在“选项对象”中提供stream: true 。这是一个示例:
const response = await unillm . createChatCompletion ( "openai/gpt-3.5-turbo" , {
messages : ... ,
stream : true
} ) ;想看更多示例吗?查看交互式文档。
我们欢迎社区的捐款!请随时提交拉动请求或为错误或功能建议创建问题。
如果您想做出贡献但不确定如何加入我们的不和谐,我们会很乐意为您提供帮助!
请在贡献前查看贡献。
该存储库的源代码可在MIT下获得。