Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add other ai provider #327

Merged

Conversation

Jakevin
Copy link
Contributor

@Jakevin Jakevin commented Apr 25, 2024

因應越來越多AI Saas公司推出自己的API串接服務,或是自架Ollama伺服器,

可使用的模型也越來越多元化,加上API也都兼容 Open-AI 的格式

所以發了這個PR

新增三個環境變數
PROVIDER_BASE_URL //供應商API網址
PROVIDER_BASE_TOKEN //供應商API金鑰
PROVIDER_BASE_MODEL //供應商模型名稱 ex:llama3-70b-8192

修改 BASE_OPENAI_URL 從 https://api.openai.com -> https://api.openai.com/v1
修改 原本 api.js裡的金鑰interceptors
修改 createAudioTranscriptions、createImage,加上API Header
修改 isChatCompletionModel 永遠為 ture,使用 `createTextCompletion` 情境幾乎不存在了

實測:
使用 openrouter 服務商的 lynn/soliloquy-l3
使用 groq 服務商的 llama3-70b-8192

截圖 2024-04-26 凌晨1 19 19

Copy link

vercel bot commented Apr 25, 2024

@Jakevin is attempting to deploy a commit to the Memo Chou's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Jakevin Jakevin changed the base branch from main to staging April 25, 2024 17:02
@memochou1993 memochou1993 merged commit 8287028 into memochou1993:staging May 3, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants