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

Vercel Deploy bug #6

Open
bean4896 opened this issue Jul 16, 2023 · 7 comments
Open

Vercel Deploy bug #6

bean4896 opened this issue Jul 16, 2023 · 7 comments

Comments

@bean4896
Copy link

image

@CNSeniorious000
Copy link
Owner

CNSeniorious000 commented Jul 16, 2023

Simplest solution: set an environment variable PUBLIC_TIKTOKEN_BG_WASM_URL = https://cdn.jsdelivr.net/npm/tiktoken/lite/tiktoken_bg.wasm. Like this:

environment variables

You can download it and upload it to your personal cdn, then put that url as this environment variable as well. As shown in the screenshot above, I use mine for a faster speed for Chinese users.

@bean4896
Copy link
Author

Thank you 谢谢老哥 我想问一下 我部署到vercel和netlify好像都没法在中国访问 有推荐的地方部署可以吗

@CNSeniorious000
Copy link
Owner

CNSeniorious000 commented Jul 17, 2023

部署到 Vercel / Netlify 后没法直接在中国访问是因为 .vercel.app.netlify.app 域名在中国被墙了。你在设置中的绑定自己的国内可访问的域名即可。

或者,你有自己的云服务器的话,可以直接 clone 这个仓库,然后:

  1. pnpm i
  2. pnpm dev

以启动开发服务器,如果要构建生产服务器就直接:

  1. pnpm build
  2. HOST=... PORT=... node dist/server/entry.mjs

如果你不用反向代理的话,就把 HOST 设为 0.0.0.0. 默认 PORT 的值为 3000.

修改环境变量的方式就是修改 .env 文件。你可以直接将 .env.example 文件重命名为 .env 然后一项项填写。基本上填写 OPENAI_API_KEY 一项即可。

@CNSeniorious000 CNSeniorious000 pinned this issue Jul 17, 2023
@bean4896
Copy link
Author

请问这个能接GPT4吗

@CNSeniorious000
Copy link
Owner

CNSeniorious000 commented Oct 16, 2023

可以啊 我自己给自己用的就接的 GPT4

Name Description Default
OPENAI_API_MODEL ID of the model to use. Model endpoint compatibility gpt-3.5-turbo-16k

改这个环境变量就行了

@bean4896
Copy link
Author

bean4896 commented Oct 16, 2023

image
我在vercel加好 gpt-4 环境变量了 还是用的gpt3.5

需要修改这个吗 const model = import.meta.env.OPENAI_API_MODEL || 'gpt-3.5-turbo-16k'

@CNSeniorious000
Copy link
Owner

不需要。但你改了配置之后需要重新部署才会生效

@CNSeniorious000 CNSeniorious000 unpinned this issue Nov 16, 2023
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

No branches or pull requests

2 participants