Sign inSign up

xiangfa/talk-with-gemini

By xiangfa

•Updated 10 months ago

Deploy your private Gemini application for free, supporting all Gemini models.

Image
Machine learning & AI
Web servers
1

50K+

xiangfa/talk-with-gemini repository overview

⁠Access Password

This project provides limited access control. Please add an environment variable named ACCESS_PASSWORD on the vercel environment variables page.

After adding or modifying this environment variable, please redeploy the project for the changes to take effect.

⁠访问密码

项目提供访问控制。请在 .env 文件或环境变量页面添加名为 ACCESS_PASSWORD 的环境变量。

添加或修改此环境变量后,请重新部署项目以使更改生效。

⁠Custom model list

This project supports custom model lists. Please add an environment variable named NEXT_PUBLIC_GEMINI_MODEL_LIST in the .env file or environment variables page.

The default model list is represented by all, and multiple models are separated by ,.

If you need to add a new model, please directly write the model name all,new-model-name, or use the + symbol plus the model name to add, that is, all,+new-model-name.

If you want to remove a model from the model list, use the - symbol followed by the model name to indicate removal, i.e. all,-existing-model-name. If you want to remove the default model list, you can use -all.

If you want to set a default model, you can use the @ symbol plus the model name to indicate the default model, that is, all,@default-model-name.

⁠自定义模型列表

本项目支持自定义模型列表。请在 .env 文件或环境变量页面添加名为 NEXT_PUBLIC_GEMINI_MODEL_LIST 的环境变量。

默认模型列表使用 all 表示,多个模型之间使用 , 分隔。

如果需要增加新的模型请直接写入模型名称 all,new-model-name,或使用 + 符号加上模型名称表示增加,即 all,+new-model-name。

如果要移除模型列表中的某个模型,请使用 - 符号加上模型名称表示移除,即 all,-existing-model-name。如果要移除默认模型列表,可以用 -all 表示。

如果要设定默认模型,可以使用 @ 符号加上模型名称表示默认模型,即 all,@default-model-name。

⁠Environment Variables

⁠GEMINI_API_KEY (optional)

Your Gemini api key. If you need to enable the server api, this is required.

⁠GEMINI_API_BASE_URL (optional)

Default: https://generativelanguage.googleapis.com

Examples: http://your-gemini-proxy.com

Override Gemini api request base url. **To avoid server-side proxy url leaks, links in front-end pages will not be overwritten. **

⁠GEMINI_UPLOAD_BASE_URL (optional)

Default: https://generativelanguage.googleapis.com

Example: http://your-gemini-upload-proxy.com

Override Gemini file upload api base url. **To avoid server-side proxy url leaks, links in front-end pages will not be overwritten. **

⁠NEXT_PUBLIC_GEMINI_MODEL_LIST (optional)

Custom model list, default: all.

⁠NEXT_PUBLIC_ASSISTANT_INDEX_URL (optional)

Default: https://chat-agents.lobehub.com

Examples: http://your-assistant-market-proxy.com

Override assistant market api request base url. The api link in the front-end interface will be adjusted synchronously.

⁠NEXT_PUBLIC_UPLOAD_LIMIT (optional)

File upload size limit. There is no file size limit by default.

⁠ACCESS_PASSWORD (optional)

Access password.

⁠HEAD_SCRIPTS (optional)

Injected script code can be used for statistics or error tracking.

⁠环境变量

⁠GEMINI_API_KEY(可选)

您的 Gemini api 密钥。 如果您需要“启用”服务器 api,这是必需的。

⁠GEMINI_API_BASE_URL(可选)

默认值:https://generativelanguage.googleapis.com

示例:http://your-gemini-proxy.com

覆盖 Gemini api 请求基本 url。为了避免服务端代理 url 泄漏,不会覆盖前端页面中的链接。

⁠GEMINI_UPLOAD_BASE_URL(可选)

默认值:https://generativelanguage.googleapis.com

示例:http://your-gemini-upload-proxy.com

覆盖 Gemini 文件上传 api 基本 url。为了避免服务端代理 url 泄漏,不会覆盖前端页面中的链接。

⁠NEXT_PUBLIC_GEMINI_MODEL_LIST(可选)

自定义模型列表,默认为: all。

⁠NEXT_PUBLIC_ASSISTANT_INDEX_URL(可选)

默认值:https://chat-agents.lobehub.com

示例:http://your-assistant-market-proxy.com

覆盖助理市场 api 请求基本 url。会同步调整前端界面中的 api 链接。

⁠NEXT_PUBLIC_UPLOAD_LIMIT(可选)

文件上传大小限制。默认不限制文件大小。

⁠ACCESS_PASSWORD(可选)

访问密码。

⁠HEAD_SCRIPTS (可选)

用于注入的脚本代码可用于统计或错误跟踪。

⁠Deployment

The Docker version needs to be 20 or above, otherwise it will prompt that the image cannot be found.

⚠️ Note: Most of the time, the docker version will lag behind the latest version by 1 to 2 days, so the "update exists" prompt will continue to appear after deployment, which is normal.

docker pull xiangfa/talk-with-gemini:latest

docker run -d --name talk-with-gemini -p 5481:3000 xiangfa/talk-with-gemini

You can also specify additional environment variables:

docker run -d --name talk-with-gemini \
   -p 5481:3000 \
   -e GEMINI_API_KEY=AIzaSy... \
   -e ACCESS_PASSWORD=your-password \
   xiangfa/talk-with-gemini

If you need to specify other environment variables, please add -e key=value to the above command to specify it.

Deploy using docker-compose.yml:

version: '3.9'
services:
   talk-with-gemini:
      image: xiangfa/talk-with-gemini
      container_name: talk-with-gemini
      environment:
         - GEMINI_API_KEY=AIzaSy...
         - ACCESS_PASSWORD=your-password
      ports:
         - 5481:3000

⁠部署

⁠容器部署(推荐)

Docker 版本需要在 20 及其以上,否则会提示找不到镜像。

⚠️ 注意:docker 版本在大多数时间都会落后最新的版本 1 到 2 天,所以部署后会持续出现“存在更新”的提示,属于正常现象。

docker pull xiangfa/talk-with-gemini:latest

docker run -d --name talk-with-gemini -p 5481:3000 xiangfa/talk-with-gemini

您也可以指定额外的环境变量:

docker run -d --name talk-with-gemini \
   -p 5481:3000 \
   -e GEMINI_API_KEY=AIzaSy... \
   -e ACCESS_PASSWORD=your-password \
   xiangfa/talk-with-gemini

如果您需要指定其他环境变量,请自行在上述命令中增加 -e 环境变量=环境变量值 来指定。

使用 docker-compose.yml 部署:

version: '3.9'
services:
   talk-with-gemini:
      image: xiangfa/talk-with-gemini
      container_name: talk-with-gemini
      environment:
         - GEMINI_API_KEY=AIzaSy...
         - ACCESS_PASSWORD=your-password
      ports:
         - 5481:3000

Tag summary

Content type

Image

Digest

sha256:2d843f3e0…

Size

51.2 MB

Last updated

10 months ago

docker pull xiangfa/talk-with-gemini