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下獲得。