Skip to content

Commit

Permalink
📝 docs: add env document about new providers
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 4, 2024
1 parent 4abc89c commit 058efff
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 48 deletions.
20 changes: 17 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# add a access code to lock your lobe-chat application, it should be a six length string
ACCESS_CODE=lobe66
# add a access code to lock your lobe-chat application, you can set a long password to avoid leaking. If this value contains a comma, it is a password array.
#ACCESS_CODE=lobe66

# add your custom model name, multi model separate by comma. for example gpt-3.5-1106,gpt-4-1106
# CUSTOM_MODELS=model1,model2,model3
Expand Down Expand Up @@ -37,7 +37,21 @@ OPENAI_API_KEY=sk-xxxxxxxxx
############ ZhiPu AI Service ##########
########################################

# ZHIPU_API_KEY=xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxx
#ZHIPU_API_KEY=xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxx

########################################
############ Google AI Service ##########
########################################

#GOOGLE_API_KEY=xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxx

########################################
############ AWS Bedrock Service ##########
########################################

#AWS_REGION=us-east-1
#AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxx
#AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
############ Market Service ############
Expand Down
88 changes: 65 additions & 23 deletions docs/Deployment/Environment-Variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ LobeChat provides additional configuration options during deployment, which can

- [General Variables](#general-variables)
- [`ACCESS_CODE`](#access_code)
- [Model Service Providers](#model-service-providers)
- [OpenAI](#openai)
- [`CUSTOM_MODELS`](#custom_models)
- [OpenAI](#openai)
- [`OPENAI_API_KEY`](#openai_api_key)
- [`OPENAI_PROXY_URL`](#openai_proxy_url)
- [Azure OpenAI](#azure-openai)
- [`USE_AZURE_OPENAI`](#use_azure_openai)
- [`AZURE_API_KEY`](#azure_api_key)
- [`AZURE_API_VERSION`](#azure_api_version)
- [Azure OpenAI](#azure-openai)
- [Zhipu AI](#zhipu-ai)
- [Google AI](#google-ai)
- [AWS Bedrock](#aws-bedrock)
- [Plugin Service](#plugin-service)
- [`PLUGINS_INDEX_URL`](#plugins_index_url)
- [`PLUGIN_SETTINGS`](#plugin_settings)
Expand All @@ -28,29 +27,22 @@ LobeChat provides additional configuration options during deployment, which can
### `ACCESS_CODE`

- Type: Optional
- Description: Add a password to access the LobeChat service, ; you can set a long password to avoid leaking. If this value contains a comma, it is a password array.
- Description: Add a password to access the LobeChat service; you can set a long password to avoid leaking. If this value contains a comma, it is a password array.
- Default: `-`
- Example: `awCTe)re_r74` or `rtrt_ewee3@09!` or `code1,code2,code3`

### `CUSTOM_MODELS`
## Model Service Providers

- Type: Optional
- Description: Used to control the model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model, separated by commas.
- Default: `-`
- Example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`
### OpenAI

The above example adds `qwen-7b-chat` and `glm-6b` to the model list, removes `gpt-3.5-turbo` from the list, and displays the model name `gpt-4-0125-preview` as `gpt-4-turbo`. If you want to disable all models first and then enable specific models, you can use `-all,+gpt-3.5-turbo`, which means only `gpt-3.5-turbo` will be enabled.

## OpenAI

### `OPENAI_API_KEY`
#### `OPENAI_API_KEY`

- Type: Required
- Description: This is the API key you apply for on the OpenAI account page, you can go [here][openai-api-page] to view
- Default: `-`
- Example: `sk-xxxxxx...xxxxxx`

### `OPENAI_PROXY_URL`
#### `OPENAI_PROXY_URL`

- Type: Optional
- Description: If you manually configure the OpenAI interface proxy, you can use this configuration item to override the default OpenAI API request base URL
Expand All @@ -70,25 +62,34 @@ Related discussions:
- [Reasons for errors when using third-party interfaces](https://github.com/lobehub/lobe-chat/discussions/734)
- [No response when filling in the proxy server address for chatting](https://github.com/lobehub/lobe-chat/discussions/1065)

## Azure OpenAI
### `CUSTOM_MODELS`

- Type: Optional
- Description: Used to control the model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model, separated by commas.
- Default: `-`
- Example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`

The above example adds `qwen-7b-chat` and `glm-6b` to the model list, removes `gpt-3.5-turbo` from the list, and displays the model name `gpt-4-0125-preview` as `gpt-4-turbo`. If you want to disable all models first and then enable specific models, you can use `-all,+gpt-3.5-turbo`, which means only `gpt-3.5-turbo` will be enabled.

### Azure OpenAI

If you need to use Azure OpenAI to provide model services, you can refer to the [Deploy with Azure OpenAI](Deploy-with-Azure-OpenAI.zh-CN.md) section for detailed steps. Here are the environment variables related to Azure OpenAI.

### `USE_AZURE_OPENAI`
#### `USE_AZURE_OPENAI`

- Type: Optional
- Description: Set this value to `1` to enable Azure OpenAI configuration
- Default: `-`
- Example: `1`

### `AZURE_API_KEY`
#### `AZURE_API_KEY`

- Type: Optional
- Description: This is the API key you apply for on the Azure OpenAI account page
- Default: `-`
- Example: `c55168be3874490ef0565d9779ecd5a6`

### `AZURE_API_VERSION`
#### `AZURE_API_VERSION`

- Type: Optional
- Description: Azure's API version, following the YYYY-MM-DD format
Expand All @@ -97,6 +98,47 @@ If you need to use Azure OpenAI to provide model services, you can refer to the

<br/>

### Zhipu AI

#### `ZHIPU_API_KEY`

- Type: Required
- Description: This is the API key you applied for in the Zhipu AI service
- Default Value: -
- Example: `4582d332441a313f5c2ed9824d1798ca.rC8EcTAhgbOuAuVT`

### Google AI

#### `GOOGLE_API_KEY`

- Type: Required
- Description: This is the API key you applied for on Google Cloud Platform, used to access Google AI services
- Default Value: -
- Example: `AIraDyDwcw254kwJaGjI9wwaHcdDCS__Vt3xQE`

### AWS Bedrock

#### `AWS_ACCESS_KEY_ID`

- Type: Required
- Description: The access key ID for AWS service authentication
- Default Value: -
- Example: `AKIA5STVRLFSB4S9HWBR`

#### `AWS_SECRET_ACCESS_KEY`

- Type: Required
- Description: The secret key for AWS service authentication
- Default Value: -
- Example: `Th3vXxLYpuKcv2BARktPSTPxx+jbSiFT6/0w7oEC`

#### `AWS_REGION`

- Type: Optional
- Description: The region setting for AWS services
- Default Value: `us-east-1`
- Example: `us-east-1`

## Plugin Service

### `PLUGINS_INDEX_URL`
Expand Down
86 changes: 64 additions & 22 deletions docs/Deployment/Environment-Variable.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进

- [通用变量](#通用变量)
- [`ACCESS_CODE`](#access_code)
- [模型服务商](#模型服务商)
- [OpenAI](#openai)
- [`CUSTOM_MODELS`](#custom_models)
- [OpenAI](#openai)
- [`OPENAI_API_KEY`](#openai_api_key)
- [`OPENAI_PROXY_URL`](#openai_proxy_url)
- [Azure OpenAI](#azure-openai)
- [`USE_AZURE_OPENAI`](#use_azure_openai)
- [`AZURE_API_KEY`](#azure_api_key)
- [`AZURE_API_VERSION`](#azure_api_version)
- [Azure OpenAI](#azure-openai)
- [智谱 AI](#智谱-ai)
- [Google AI](#google-ai)
- [AWS Bedrock](#aws-bedrock)
- [插件服务](#插件服务)
- [`PLUGINS_INDEX_URL`](#plugins_index_url)
- [`PLUGIN_SETTINGS`](#plugin_settings)
Expand All @@ -32,25 +31,18 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进
- 默认值:-
- 示例:`awCTe)re_r74` or `rtrt_ewee3@09!`

### `CUSTOM_MODELS`

- 类型:可选
- 描述:用来控制模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。
- 默认值:`-`
- 示例:`+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`

上面示例表示增加 `qwen-7b-chat``glm-6b` 到模型列表,而从列表中删除 `gpt-3.5-turbo`,并将 `gpt-4-0125-preview` 模型名字展示为 `gpt-4-turbo`。如果你想先禁用所有模型,再启用指定模型,可以使用 `-all,+gpt-3.5-turbo`,则表示仅启用 `gpt-3.5-turbo`
## 模型服务商

## OpenAI
### OpenAI

### `OPENAI_API_KEY`
#### `OPENAI_API_KEY`

- 类型:必选
- 描述:这是你在 OpenAI 账户页面申请的 API 密钥,可以前往[这里][openai-api-page]查看
- 默认值:-
- 示例:`sk-xxxxxx...xxxxxx`

### `OPENAI_PROXY_URL`
#### `OPENAI_PROXY_URL`

- 类型:可选
- 描述:如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL
Expand All @@ -70,31 +62,81 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进
- [使用第三方接口报错的原因](https://github.com/lobehub/lobe-chat/discussions/734)
- [代理服务器地址填了聊天没任何反应](https://github.com/lobehub/lobe-chat/discussions/1065)

## Azure OpenAI
### `CUSTOM_MODELS`

- 类型:可选
- 描述:用来控制模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。
- 默认值:`-`
- 示例:`+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`

上面示例表示增加 `qwen-7b-chat``glm-6b` 到模型列表,而从列表中删除 `gpt-3.5-turbo`,并将 `gpt-4-0125-preview` 模型名字展示为 `gpt-4-turbo`。如果你想先禁用所有模型,再启用指定模型,可以使用 `-all,+gpt-3.5-turbo`,则表示仅启用 `gpt-3.5-turbo`

### Azure OpenAI

如果你需要使用 Azure OpenAI 来提供模型服务,可以查阅 [使用 Azure OpenAI 部署](Deploy-with-Azure-OpenAI.zh-CN.md) 章节查看详细步骤,这里将列举和 Azure OpenAI 相关的环境变量。

### `USE_AZURE_OPENAI`
#### `USE_AZURE_OPENAI`

- 类型:可选
- 描述:设置该值为 `1` 开启 Azure OpenAI 配置
- 默认值:-
- 示例:`1`

### `AZURE_API_KEY`
#### `AZURE_API_KEY`

- 类型:可选
- 描述:这是你在 Azure OpenAI 账户页面申请的 API 密钥
- 默认值:-
- 示例:`c55168be3874490ef0565d9779ecd5a6`

### `AZURE_API_VERSION`
#### `AZURE_API_VERSION`

- 类型:可选
- 描述:Azure 的 API 版本,遵循 YYYY-MM-DD 格式
- 默认值:`2023-08-01-preview`
- 示例:`2023-05-15`,查阅[最新版本][azure-api-verion-url]

### 智谱 AI

#### `ZHIPU_API_KEY`

- 类型:必选
- 描述:这是你在 智谱 AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`4582d332441a313f5c2ed9824d1798ca.rC8EcTAhgbOuAuVT`

### Google AI

#### `GOOGLE_API_KEY`

- 类型:必选
- 描述:这是你在 Google AI Platform 申请的 API 密钥,用于访问 Google AI 服务
- 默认值:-
- 示例:`AIraDyDwcw254kwJaGjI9wwaHcdDCS__Vt3xQE`

### AWS Bedrock

#### `AWS_ACCESS_KEY_ID`

- 类型:必选
- 描述:用于 AWS 服务认证的访问键 ID
- 默认值:-
- 示例:`AKIA5STVRLFSB4S9HWBR`

#### `AWS_SECRET_ACCESS_KEY`

- 类型:必选
- 描述:用于 AWS 服务认证的密钥
- 默认值:-
- 示例:`Th3vXxLYpuKcv2BARktPSTPxx+jbSiFT6/0w7oEC`

#### `AWS_REGION`

- 类型:可选
- 描述:AWS 服务的区域设置
- 默认值:`us-east-1`
- 示例:`us-east-1`

## 插件服务

### `PLUGINS_INDEX_URL`
Expand Down

0 comments on commit 058efff

Please sign in to comment.