# 创建语音转文本请求
Source: https://docs.siliconflow.cn/cn/api-reference/audio/create-audio-transcriptions
post /audio/transcriptions
Creates an audio transcription.
# 创建文本转语音请求
Source: https://docs.siliconflow.cn/cn/api-reference/audio/create-speech
post /audio/speech
从输入文本生成音频。根据输入的文本生成音频。接口生成的数据为音频的二进制数据,需要使用者自行处理。参考:https://docs.siliconflow.cn/capabilities/text-to-speech#5
# 删除参考音频
Source: https://docs.siliconflow.cn/cn/api-reference/audio/delete-voice
post /audio/voice/deletions
删除用户预置音色
# 上传参考音频
Source: https://docs.siliconflow.cn/cn/api-reference/audio/upload-voice
post /uploads/audio/voice
上传用户预置音色,支持以 base64 编码或者文件形式上传,参考https://docs.siliconflow.cn/capabilities/text-to-speech#2-2)
# 参考音频列表获取
Source: https://docs.siliconflow.cn/cn/api-reference/audio/voice-list
get /audio/voice/list
获取用户预置音色列表
# 创建文本对话请求
Source: https://docs.siliconflow.cn/cn/api-reference/chat-completions/chat-completions
post /chat/completions
Creates a model response for the given chat conversation.
# 创建嵌入请求
Source: https://docs.siliconflow.cn/cn/api-reference/embeddings/create-embeddings
post /embeddings
Creates an embedding vector representing the input text.
# 创建图片生成请求
Source: https://docs.siliconflow.cn/cn/api-reference/images/images-generations
post /images/generations
Creates an image response for the given prompt. Currently, FLUX.1-schnell serires and stable-diffusion-3-5-large-turbo model only support 4 steps. 根据给定的提示生成图片响应。目前,FLUX.1-schnell 系列和 stable-diffusion-3-5-large-turbo 模型仅支持 4 步生成,对应的num_inference_steps参数不能配置。生成的图片 URL 有效期1个小时,请及时做好转存工作,避免因 URL 过期而影响业务
# 获取用户模型列表
Source: https://docs.siliconflow.cn/cn/api-reference/models/get-model-list
get /models
Retrieve models information.
# 创建重排序请求
Source: https://docs.siliconflow.cn/cn/api-reference/rerank/create-rerank
post /rerank
Creates a rerank request.
# 获取用户账户信息
Source: https://docs.siliconflow.cn/cn/api-reference/userinfo/get-user-info
get /user/info
获取用户信息,包括余额和状态
# 获取视频生成链接请求
Source: https://docs.siliconflow.cn/cn/api-reference/videos/get_videos_status
post /video/status
获取用户生成的视频。 生成的视频 URL 有效期1个小时,请及时做好转存工作,避免因 URL 过期而影响业务。
# 创建视频生成请求
Source: https://docs.siliconflow.cn/cn/api-reference/videos/videos_submit
post /video/submit
通过输入prompt生成视频,该接口返回的是用户当前请求生成的requestId,用户需要通过轮询status接口获取具体的视频链接,生成后的结果在10分钟内有效,请及时取走视频链接。
# 实名认证
Source: https://docs.siliconflow.cn/cn/faqs/authentication
## 1. 为什么要进行实名认证?
《中华人民共和国网络安全法》 等法律法规要求:网络运营者为用户办理网络接入,在与用户签订协议或者确认提供服务时,应当要求用户提供真实身份信息。用户不提供真实身份信息的,网络运营者不得为其提供相关服务。
## 2. 如果不进行实名认证,会对账号产生什么影响?
如果不进行实名认证,账号将无法进行以下操作:
* 无法进行“账户充值”
* 无法申请“开具发票”
* 无法使用“海外厂商提供的大语言模型”,当前包括
* nvidia/Llama-3.1-Nemotron-70B-Instruct
* meta-llama/Meta-Llama-3.1-405B-Instruct
* meta-llama/Meta-Llama-3-70B-Instruct
* meta-llama/Meta-Llama-3.1-70B-Instruct
* meta-llama/Meta-Llama-3-8B-Instruct
* meta-llama/Meta-Llama-3.1-8B-Instruct
* google/gemma-2-27b-it
* google/gemma-2-9b-it
* Pro/meta-llama/Meta-Llama-3-8B-Instruct
* Pro/meta-llama/Meta-Llama-3.1-8B-Instruct
* Pro/google/gemma-2-9b-it
## 3. 个人实名和企业实名认证有哪些区别?
账号实名认证分为**个人实名认证**和**企业实名认证**两类:
* 个人实名认证:认证类型为个人,支持个人人脸识别认证。
* 企业实名认证:认证类型为企业(含普通企业、政府、事业单位、社会团体组织、个体工商户等),支持法人人脸识别认证、企业对公打款认证两种认证方式。
**实名认证类型对账号的影响:**
1. 影响账号的归属。
* 完成企业实名认证的账号**归属为企业**。
* 完成个人实名认证的账号**归属于个人**。
2. 影响账号的开票信息。
* 企业认证**可以开具企业抬头的增值税专用发票、增值税普通发票**。
* 个人认证**只能开具**个人抬头的增值税普通发票\*\*。
【注意事项】
* 实名认证信息对您的账号和资金安全等很重要,请**按实际情况**进行实名认证。
* 为了您的账号安全,企业用户不要进行个人实名认证。
* 当前账号只允许绑定一个认证主体,账号主体变更成功后原主体信息将与账号解绑。
## 4. 如何进行个人认证?
### 4.1 个人认证支持证件类型
个人认证支持证件类型有以下几种:
* 大陆身份证
* 港澳往来大陆通行证(回乡证)
* 台湾往来大陆通行证(台胞证)
* 港澳居民居住证
* 台湾居民居住证
* 外国人永久居留证
不具有以上证件的用户,暂时不支持线上个人认证,可以通过提交[表单](https://siliconflow.feishu.cn/share/base/form/shrcnF4a7pFS2eR4wJj9rneM7mc?auth_token=U7CK1RF-ddcuca83-7f21-437e-9ef2-208b950e9f7f-NN5W4\&ccm_open_type=form_v1_qrcode_share\&share_link_type=qrcode)的形式跟工作人员沟通,尝试进行其他方式认证。
### 4.2 个人认证流程
1. 登录 SiliconCloud 平台,点击[用户中心-实名认证](https://cloud.siliconflow.cn/account/authentication)。
2. 在实名认证页面,选择认证类型为"个人实名认证",然后填写个人信息。
3. 使用手机支付宝 App 扫描二维码,扫描后按照手机上的提示完成人脸识别认证,认证成功后,在网页端的弹窗上点击“已完成刷脸认证”。
4. 认证成功后您可以**修改认证信息**或者**变更为企业用户**,30 天内只可以完成一次变更或修改。
【注意事项】
* 实名认证直接影响账号的归属。如果是企业用户,请您进行企业实名认证,以免人员变动等因素引起的不必要纠纷。更多信息请参见个人实名认证和企业实名认证的区别。
* 根据相关法律法规,我们不对未满 14 周岁的个人提供在线实名认证服务。
## 5. 如何进行企业认证?
1. 登录 SiliconCloud 平台,点击“用户中心-实名认证”。
2. 在实名认证页面,选择认证类型为“企业实名认证”,然后选择认证方式。认证方式有以下两种:
* 选择法人人脸识别认证
1. 填写企业名称、统一社会信用代码、法人姓名和法人身份证号,勾选同意协议。
2. 法人使用手机支付宝 App 扫描二维码,扫描后按照手机上的提示完成人脸认证,验证成功即可完成认证。
* 选择企业对公打款认证
1. 填写企业名称、统一社会信用代码和法人姓名,勾选同意协议。
2. 填写企业对公银行卡号,填写对公银行(精确到支行)名称,选择具体的开户行,确认无误后点击获取验证金额。
3. 等待随机打款金额到账,通常在 10 分钟以内。
4. 打款成功后,请跟财务核实收到的 1 元以下随机金额,将该金额回填到该页面,核实无误后即可认证成功。
认证成功后您可以**修改认证信息**,30 天内只可进行一次修改。
# 错误处理
Source: https://docs.siliconflow.cn/cn/faqs/error-code
**1. 尝试获取 HTTP 错误代码,初步定位问题**
a. 在代码中,尽量把错误码和报错信息(message)打印出来,利用这些信息,可以定位大部分问题。
```shell
HTTP/1.1 400 Bad Request
Date: Thu, 19 Dec 2024 08:39:19 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 87
Connection: keep-alive
{"code":20012,"message":"Model does not exist. Please check it carefully.","data":null}
```
* 常见错误代码及原因:
* **400**:参数不正确,请参考报错信息(message)修正不合法的请求参数;
* **401**:API Key 没有正确设置;
* **403**:权限不够,最常见的原因是该模型需要实名认证,其他情况参考报错信息(message);
* **429**:触发了 rate limits;参考报错信息(message)判断触发的是 `RPM /RPD / TPM / TPD / IPM / IPD` 中的具体哪一种,可以参考 [Rate Limits](https://docs.siliconflow.cn/rate-limits/rate-limit-and-upgradation) 了解具体的限流策略
* **504 / 503**:
* 一般是服务系统负载比较高,可以稍后尝试;
* 对于对话和文本转语音请求,可以尝试使用流式输出("stream" : true),参考 [流式输出](https://docs.siliconflow.cn/faqs/stream-mode);
* **500**:服务发生了未知的错误,可以联系相关人员进行排查
b. 如果客户端没有输出相应的信息,可以考虑在命令行下运行 curl 命令 (以 LLM 模型为例):
```shell
curl --request POST \
--url https://api.siliconflow.cn/v1/chat/completions \
--header 'accept: application/json' \
--header 'authorization: Bearer 改成你的apikey' \
--header 'content-type: application/json' \
--data '
{
"model": "记得改模型",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128
}' -i
```
**2. 可以尝试换一个模型,看看问题是否依旧**
**3. 如果开了代理,可以考虑将代理关闭后再尝试访问**
**4. 尝试将接入点从 api.siliconflow\.cn 切到 api.siliconflow\.com ,后者具备全球负载均衡能力,会根据请求来源路由到相应的节点上**
如遇其他问题,请点击[硅基流动MaaS线上需求收集表](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3)反馈。
# 开具发票
Source: https://docs.siliconflow.cn/cn/faqs/invoice
## 1. 开票主体信息
开票主体:北京硅基流动科技有限公司
## 2. 开票时效性
3-7个工作日为您开具
## 3. 开票金额
按**实际使用金额**开具等额增值税电子发票
## 4. 发票类型
目前平台仅提供数电发票
企业认证用户可以开具企业抬头的增值税专用发票/增值税普通发票;
个人认证只能开具个人抬头的增值税普通发票
## 5. 开票流程
申请人发送邮件至:[finance@siliconflow.cn](mailto:finance@siliconflow.cn),邮件内容需包含如下信息:
* 1. 开票抬头名称
* 2. 税务登记证号/社会统一信用代码
* 3. 发票类型:增值税专用发票/增值税普通发票
* 4. SiliconCloud 注册账号
* 5. 申请开票内容:模型 API 调用 / Playground 使用 / 等级包
我司根据客户提供的注册账号,查询相关服务开通及使用情况,按实际使用金额开具等额增值税电子发票。
一般会在收到发票申请后的 3-7 个工作日为您开具(如遇特殊情况可能会有延迟)。发票开具完毕后通过邮件回传。
发票回传到对应申请邮箱。
# 模型问题
Source: https://docs.siliconflow.cn/cn/faqs/misc
## 1. 模型输出乱码
目前看到部分模型在不设置参数的情况下,容易出现乱码,遇到上述情况,可以尝试设置`temperature`,`top_k`,`top_p`,`frequency_penalty`这些参数。
对应的 payload 修改为如下形式,不同语言酌情调整
```python
payload = {
"model": "Qwen/Qwen2.5-Math-72B-Instruct",
"messages": [
{
"role": "user",
"content": "1+1=?",
}
],
"max_tokens": 200, # 按需添加
"temperature": 0.7, # 按需添加
"top_k": 50, # 按需添加
"top_p": 0.7, # 按需添加
"frequency_penalty": 0 # 按需添加
}
```
## 2. 关于`max_tokens`说明
平台提供的LLM模型中,
* max\_tokens 限制为 `16384` 的模型:
* Pro/deepseek-ai/DeepSeek-R1
* Qwen/QVQ-72B-Preview
* deepseek-ai/DeepSeek-R1-Distill-Llama-70B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* max\_tokens 限制为 `8192` 的模型:
* Qwen/QwQ-32B-Preview
* AIDC-AI/Marco-o1
* deepseek-ai/DeepSeek-R1
* max\_tokens 限制为 `4096`的模型:
* 除上述提到的其他LLM模型的
如有特殊需求,建议您点击[硅基流动MaaS线上需求收集表](\(https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3\))进行反馈。
## 3. 关于`context_length`说明
不同的LLM模型,`context_length`是有差别的,具体可以在[模型广场](https://cloud.siliconflow.cn/models)上搜索对应的模型,查看模型具体信息。
## 4. 关于 `DeepSeek-R1` 和 `DeepSeek-V3` 模型调用返回 `429` 说明
1. `未实名用户`用户:每天仅能访问 `100次`。如果当天访问次数超过 `100次`,将收到 `429` 错误,并提示 "Details: RPD limit reached. Could only send 100 requests per day without real name verification",可以通过实名解锁更高的 Rate Limit。
2. `实名用户`:拥有更高的 Rate Limit,具体值参考[模型广场](https://cloud.siliconflow.cn/models)
如果访问次数超过这些限制,也会收到 `429` 错误。
## 5. Pro 和非 Pro 模型有什么区别
1. 对于部分模型,平台同时提供免费版和收费版。免费版按原名称命名;收费版在名称前加上“Pro/”以示区分。免费版的 Rate Limits 固定,收费版的 Rate Limits 可变,具体规则请参考:[Rate Limits](https://docs.siliconflow.cn/cn/userguide/rate-limits/rate-limit-and-upgradation)。
2. 对于 `DeepSeek R1` 和 `DeepSeek V3` 模型,平台根据`支付方式`的不同要求区分命名。`Pro 版`仅支持`充值余额`支付,`非 Pro 版`支持`赠费余额`和`充值余额`支付。
## 6. 语音模型中,对用户自定义音色有时间音质要求么
* cosyvoice2 上传音色必须小于30s
* GPT-SoVITS 上传音色须在3~10s
* fishaudio 没有特殊限制
为保证生成语音效果,建议用户上传音色为:时间8~10s左右,发音吐字清晰,没有杂音/背景音。
## 7. 模型输出截断问题
可以从以下几方面进行问题的排查:
* 通过API请求时候,输出截断问题排查:
* max\_tokens设置:max\_token设置到合适值,输出大于max\_token的情况下,会被截断,deepseek R1系列的max\_token最大可设置为16384。
* 设置流式输出请求:非流式请求时候,输出内容比较长的情况下,容易出现504超时。
* 设置客户端超时时间:把客户端超时时间设置大一些,防止未输出完成,达到客户端超时时间被截断。
* 通过第三方客户端请求,输出截断问题排查:
* CherryStdio 默认的 max\_tokens 是 4096,用户可以通过设置,打开“开启消息长度限制”的开关,将max\_token设置到合适值
如遇其他问题,请点击[硅基流动MaaS线上需求收集表](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3)反馈。
# 财务问题
Source: https://docs.siliconflow.cn/cn/faqs/misc_finance
## 1. 如何充值
1. 电脑端登录 [SiliconCloud](https://cloud.siliconflow.cn/) 官网。
2. 点击左侧边栏 “[实名认证](https://cloud.siliconflow.cn/account/authentication)” 进行认证。
3. 点击左侧边栏 “[余额充值](https://cloud.siliconflow.cn/expensebill)” 进行充值。
## 2. 赠送余额有期限吗
赠送余额目前没有有效期限制。
## 3. 如何查询使用账单
1. 电脑端登录 [SiliconCloud](https://cloud.siliconflow.cn/) 官网。
2. 点击左侧边栏 “[费用账单](https://cloud.siliconflow.cn/bills)” 了解。
如您需要开发票,请根据 [开具发票](https://docs.siliconflow.cn/faqs/invoice) 发邮件,我们会根据您的实际消耗费用开发票。
## 4. 模型微调的计费规则
模型微调功能会按照训练和推理两个不同场景独立计费。
费用查看路径:[模型微调](https://cloud.siliconflow.cn/fine-tune) - 新建微调任务,选择所需的“基础模型”后,页面会显示对应的“微调训练价格”和“微调推理价格”。
如遇其他问题,请点击[硅基流动MaaS线上需求收集表](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3)反馈。
# Rate Limits 问题
Source: https://docs.siliconflow.cn/cn/faqs/misc_rate
## 1. 免费模型如何提升 Rate Limits
* 所有免费模型的 Rate Limits 是固定的。
* 对于部分模型,平台同时提供免费版和收费版。免费版按照原名称命名;收费版会在名称前加上“Pro/”以示区分。
* 收费版模型支持通过月消费金额解锁更宽松的 Rate Limits,也可以单独购买[等级包](https://cloud.siliconflow.cn/package)快速提升 Rate Limits。
* 对于 `DeepSeek R1` 和 `DeepSeek V3` 模型,Rate Limits 是固定的。
如遇其他问题,请点击[硅基流动MaaS线上需求收集表](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3)反馈。
# 使用问题
Source: https://docs.siliconflow.cn/cn/faqs/misc_use
## 1. 如何注销账号
暂时不支持在平台上注销账号。
## 2. 如何邀请
1. 电脑端登录 [SiliconCloud](https://cloud.siliconflow.cn/) 官网。
2. 点击左侧边栏 “[我的邀请](https://cloud.siliconflow.cn/invitation)” — “复制邀请链接”。
3. 分享邀请信息。
4. 邀请成功的具体信息会显示在 “[我的邀请](https://cloud.siliconflow.cn/invitation)”页面。
有三种邀请方式供选择:二维码、邀请码和邀请链接。
如遇其他问题,请点击[硅基流动MaaS线上需求收集表](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3)反馈。
# 流式输出
Source: https://docs.siliconflow.cn/cn/faqs/stream-mode
## 1. 在 python 中使用流式输出
### 1.1 基于 openai 库的流式输出
在一般场景中,推荐您使用 openai 的库进行流式输出。
```python
from openai import OpenAI
client = OpenAI(
base_url='https://api.siliconflow.cn/v1',
api_key='your-api-key'
)
# 发送带有流式输出的请求
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "user", "content": "SiliconCloud公测上线,每用户送3亿token 解锁开源大模型创新能力。对于整个大模型应用领域带来哪些改变?"}
],
stream=True # 启用流式输出
)
# 逐步接收并处理响应
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
### 1.2 基于 requests 库的流式输出
如果您有非 openai 的场景,如您需要基于 request 库使用 siliconcloud API,请您注意:
除了 payload 中的 stream 需要设置外,request 请求的参数也需要设置stream = True, 才能正常按照 stream 模式进行返回。
```python
import requests
url = "https://api.siliconflow.cn/v1/chat/completions"
payload = {
"model": "deepseek-ai/DeepSeek-V2.5", # 替换成你的模型
"messages": [
{
"role": "user",
"content": "SiliconCloud公测上线,每用户送3亿token 解锁开源大模型创新能力。对于整个大模型应用领域带来哪些改变?"
}
],
"stream": True # 此处需要设置为stream模式
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer your-api-key"
}
response = requests.post(url, json=payload, headers=headers, stream=True) # 此处request需要指定stream模式
# 打印流式返回信息
if response.status_code == 200:
for chunk in response.iter_content(chunk_size=8192):
if chunk:
decoded_chunk = chunk.decode('utf-8')
print(decoded_chunk, end='')
else:
print('Request failed with status code:', response.status_code)
```
# 主体变更协议
Source: https://docs.siliconflow.cn/cn/legals/agreement-for-account-ownership-transfer
更新日期:2025年2月12日
在您正式提交账号主体变更申请前,请您务必认真阅读本协议。**本协议将通过加粗或加下划线的形式提示您特别关注对您的权利及义务将产生重要影响的相应条款。** 如果您对本协议的条款有疑问的,请向[contact@siliconflow.cn](mailto:contact@siliconflow.cn)咨询,如果您不同意本协议的内容,或者无法准确理解Siliconcloud平台(本平台)对条款的解释,请不要进行后续操作。
当您通过网络页面直接确认、接受引用本页面链接及提示遵守内容、签署书面协议、以及本平台认可的其他方式,或以其他法律法规或惯例认可的方式选择接受本协议,即表示您与本平台已达成协议,并同意接受本协议的全部约定内容。自本协议约定的生效之日起,本协议对您具有法律约束力。
**请您务必在接受本协议,且确信通过账号主体变更的操作,能够实现您所希望的目的,且您能够接受因本次变更行为的相关后果与责任后,再进行后续操作。**
## 一、定义和解释
1.1 “本平台官网”:是指包含域名为[https://siliconflow.cn的网站。](https://siliconflow.cn的网站。)
1.2 “本平台账号”:是指本平台分配给注册用户的数字ID,以下简称为“本平台账号”、“账号”。
1.3 “本平台账号持有人”,是指注册、持有并使用本平台账号的用户。
已完成实名认证的账号,除有相反证据外,本平台将根据用户的实名认证信息来确定账号持有人,如用户填写信息与实名认证主体信息不同的,以实名认证信息为准;未完成实名认证的账号,本平台将根据用户的填写信息,结合其他相关因素合理判断账号持有人。
1.4 “账号实名认证主体变更”:是指某一本平台账号的实名认证主体(原主体),变更为另一实名认证主体(新主体),本协议中简称为“账号主体变更”。
1.5 本协议下的“账号主体变更”程序、后果,仅适用于依据账号原主体申请发起、且被账号新主体接受的本平台账号实名认证主体变更情形。
## 二. 协议主体、内容与生效
**2.1** 本协议是特定本平台账号的账号持有人(“您”、“原主体”)与本平台之间,就您申请将双方之前就本次申请主体变更的本平台账号所达成的《SiliconCloud平台产品用户协议》的权利义务转让给第三方,及相关事宜所达成的一致条款。
**2.2 本协议为附生效条件的协议,仅在以下四个条件同时满足的情况下,** 才对您及本平台产生法律效力:
2.2.1 您所申请变更的本平台账号已完成了实名认证,且您为该实名认证主体;
2.2.2 本平台审核且同意您的账号主体变更申请;
2.2.3 您申请将账号下权利义务转让给第三方(“新主体”),且其同意按照《SiliconCloud平台产品用户协议》的约定继续履行相应的权利及义务;
2.2.4 新主体仅为企业主体,不能为自然人主体。
**2.3 您与新主体就账号下所有的产品、服务、资金、债权、债务等(统称为“账号下资源”)转让等相关事项,由您与新主体之间另外自行约定。但如果您与新主体之间的约定如与本协议约定冲突的,应优先适用本协议的约定。**
## 三. 变更的条件及程序
**3.1** 本平台仅接受符合以下条件下的账号主体变更申请;
3.1.1 由于原账号主体发生合并、分立、重组、解散、死亡等原因,需要进行账号主体变更的;
3.1.2 根据生效判决、裁定、裁决、决定等生效法律文书,需要账号主体变更的;
3.1.3 账号实际持有人与账号实名认证主体不一致,且提供了明确证明的;
3.1.4 根据法律法规规定,应当进行账号主体变更的;
3.1.5 本平台经过审慎判断,认为可以进行账号主体变更的其他情形。
**3.2** 您发起账号主体变更,应遵循如下程序要求:
3.2.1 您应在申请变更的本平台账号下发起账号主体变更申请;
3.2.2 本平台有权通过手机号、人脸识别等进行二次验证、要求您出具授权证明(当您通过账号管理人发起变更申请时)、以及其他本平台认为有必要的材料,确认本次申请账号主体变更的行为确系您本人意愿;
3.2.3 您应同意本协议的约定,接受本协议对您具有法律约束力;
3.2.4 您应遵守与账号主体变更相关的其他本平台规则、制度等的要求。
**3.3 您理解并同意,**
**3.3.1 在新主体确认接受且完成实名认证前,您可以撤回、取消本账号主体变更流程;**
**3.3.2 当新主体确认接受且完成实名认证后,您的撤销或取消请求本平台将不予支持;**
**3.3.3 且您有义务配合新主体完成账号管理权的转交。**
**3.3.4 在您进行实名认证主体变更期间,本账号下的登录和操作行为均视为您的行为,您应注意和承担账号的操作风险。**
**3.4 您理解并同意,如果发现以下任一情形的,本平台有权随时终止账号主体变更程序或采取相应处理措施:**
**3.4.1 第三方对该账号发起投诉,且尚未处理完毕的;**
**3.4.2 该账号正处于国家主管部门的调查中;**
**3.4.3 该账号正处于诉讼、仲裁或其他法律程序中;**
**3.4.4 该账号下存在与本平台的信控关系、伙伴关系等与原主体身份关联的合作关系的;**
**3.4.5 存在其他可能损害国家、社会利益,或者损害本平台或其他第三方权利的情形的;**
**3.4.6 该账号因存在频繁变更引起的账号纠纷或账号归属不明确的情形。**
## 四. 账号主体变更的影响
**4.1** 当您的账号主体变更申请经本平台同意,且新主体确认并完成实名认证后,该账号主体将完成变更,变更成功以本平台系统记录为准,变更成功后会对您产生如下后果:
**4.1.1您本账号下的权益转让给变更后的实名主体,权益包括不限于账号控制权、账号下已开通的服务、账号下未消耗的充值金额等;**
4.1.2 该账号及该账号下的全部资源的归属权全部转由新主体拥有。**但本平台有权终止,原主体通过该账号与本平台另行达成的关于优惠政策、信控、伙伴合作等相关事项的合作协议,或与其他本平台账号之间存在的关联关系等;**
**4.1.3 本平台不接受您以和新主体之间的协议为由或以其他理由,要求将该账号下一项或多项业务、权益转移给您指定的其他账号的要求;**
**4.1.4 本平台有权拒绝您以和新主体之间存在纠纷为由或以其他理由,要求撤销该账号主体变更的请求;**
**4.1.5 本平台有权在您与新主体之间就账号管理权发生争议或纠纷时,采取相应措施使得新主体获得该账号的实际管理权。**
**4.2 您理解并确认,账号主体变更并不代表您自变更之时起已对该账号下的所有行为和责任得到豁免或减轻:**
**4.2.1 您仍应对账号主体变更前,该账号下发生的所有行为承担责任;**
**4.2.2 您还需要对于变更之前已经产生,变更之后继续履行的合同及其他事项,对新主体在变更之后的履行行为及后果承担连带责任。**
## 五. 双方权利与义务
**5.1** 您应承诺并保证,
5.1.1 您在账号主体变更流程中所填写的内容及提交的资料均真实、准确、有效,且不存在任何误导或可能误导本平台同意接受该项账号主体变更申请的行为;
5.1.2 您不存在利用本平台的账号主体变更服务进行任何违反法律、法规、部门规章和国家政策等,或侵害任何第三方权利的行为;
**5.1.3 您进行账号主体变更的操作不会置本平台于违约或者违法的境地。因该账号主体变更行为而产生的任何纠纷、争议、损失、侵权、违约责任等,本平台不承担法律明确规定外的责任。**
**您进一步承诺,如上述原因给本平台造成损失的,您应向本平台承担相应赔偿责任。**
**5.2** 您理解并同意,
5.2.1 本平台有权在您发起申请后的任一时刻,要求您提供书面材料或其他证明,证明您有权进行变更账号主体的操作;
5.2.2 本平台有权依据自己谨慎的判断来确定您的申请是否符合法律法规或政策的规定及账号协议的约定,如存在违法违规或其他不适宜变更的情形的,本平台有权拒绝;
5.2.3 本平台有权记录账号实名认证主体变更前后的账号主体、交易流水、合同等相关信息,以遵守法律法规的规定,以及维护自身的合法权益;
5.2.4 如果您存在违反本协议第5.1条的行为的,本平台一经发现,有权直接终止账号主体变更流程,或者撤销已完成的账号主体变更操作,将账号主体恢复为没有进行变更前的状态。
## 六. 附则
**6.1** 您理解并接受,本协议的订立、执行和解释及争议的解决均应适用中华人民共和国法律,与法律规定不一致或存在冲突的,该不一致或冲突条款不具有法律约束力。
**6.2** 就本协议内容或其执行发生任何争议,双方应进行友好协商;协商不成时,任一方均可向被告方所在地有管辖权的人民法院提起诉讼。
**6.3** 本协议如果与双方以前签署的有关条款或者本平台的有关陈述不一致或者相抵触的,以本协议约定为准。
**您在此再次保证已经完全阅读并理解了上述《申请账号主体变更协议》,并自愿正式进入账号主体变更的后续流程,接受上述条款的约束。**
# 隐私政策
Source: https://docs.siliconflow.cn/cn/legals/privacy-policy
更新日期:2025年02月07日
欢迎您使用Siliconcloud,高性价比的GenAI开放平台北京硅基流动科技有限公司及其关联方(**“硅基流动”或“我们”**)非常重视用户(**“您”**)信息的保护。您在注册、登录、使用 [https://siliconflow.cn/zh-cn/siliconcloud](https://siliconflow.cn/zh-cn/siliconcloud) (**“本平台”**)时,我们收集您基于使用本平台所主动提供的信息,以及我们通过自动化手段收集的您在使用服务过程中产生的信息,称为 **“用户信息”**。我们将按照本隐私政策的相关规定收集、使用、存储、转移及保护您的用户信息。如我们的服务可能包含指向第三方网站、应用程序或服务的链接,本政策不适用于第三方提供的任何产品、服务、网站或内容。如您的公司等经营实体借助我们的产品或服务为您的客户提供服务,您需要自行制定符合交易场景的用户信息保护政策。我们希望通过本隐私政策向您介绍我们对您的用户信息的处理方式。在您开始使用我们的服务前,请您务必先仔细阅读和理解本政策,特别应重点阅读我们以**粗体**标识的条款,确保您充分理解和同意后再开始使用。如果您不同意本隐私政策,您应当立即停止使用服务。当您选择使用服务时,将视为您接受和认可我们按照本隐私政策对您的相关信息进行处理。
# 概述
本隐私政策将帮助您了解:
1. 我们如何收集和使用您的用户信息
2. 对Cookie和同类技术的使用
3. 我们如何存储您的用户信息
4. 我们如何共享、转让、公开披露您的信息
5. 我们如何保护您的信息安全
6. 我们如何管理您的用户信息
7. 未成年人使用条款
8. 隐私政策的修订和通知
9. 适用范围
## 1. 我们如何收集和使用您的用户信息
### 1.1 我们主动收集您的用户信息
为了保证您正常使用我们的平台,且在法律允许的情况下,我们会在如下场景和业务活动中收集您在使用服务时主动提供的用户信息,以及我们通过自动化手段收集您在使用服务过程中产生的用户信息,包括但不限于您提供的个人信息。**特别提示您注意,如信息无法单独或结合其他信息识别到您的个人身份且与您无关,其不属于法律意义上您的个人信息**;当您的信息可以单独或结合其他信息识别到您的个人身份或与您有关时,或我们将无法与任何特定用户建立联系的数据与其他您的用户信息结合使用时,则在结合使用期间,这些信息将作为您的用户信息按照本隐私政策处理与保护。**需要澄清的是,个人信息不包括经匿名化处理后的信息。**
**1.1.1 您注册、认证、登录本平台账号时**
当您在本平台注册账号时,您可以通过手机号创建账号。我们将通过发送短信验证码来验证您的身份是否有效,收集这些信息是为了帮助您完成注册和登录。 如果您使用其他平台的账号登录本平台,您授权我们获得您其他平台账号的相关信息,例如微信等第三方平台的账户/账号信息(包括但不限于名称、头像以及您授权的其他信息)。
**1.1.2 您订购及开通使用服务时**
在您订购或开通使用我们提供的任一项服务前,根据中华人民共和国大陆地区(不含中国香港、澳门、台湾地区)相关法律法规的规定,我们需要对您进行实名认证。
(1) 如果您是个人用户,您可能需要提供您的真实身份信息,包括真实姓名、身份证件号码、身份证件正反面照片、中国银联成员机构I类银行账户卡号或 信用卡 号、银行预留手机号码等信息以完成实名认证。
(2) 如果您是单位用户,您可能需要提供您的相关信息,包括您的主体名称、统一社会信用代码、就注册账号所出具的授权委托书(加盖单位公章)、法人或组织的登记/资格证明(证件类型包括:企业营业执照、组织机构代码证、事业单位法人证书、社会团体法人登记证书、行政执法主体资格证等)、开户行、开户行账号(中国银联成员机构I类银行账户或信用卡号)、法定代表人或被授权人姓名、身份证件号码、身份证件正反面照片、法定代表人证件照片等信息以完成实名认证。另外,您可能需要提供企业联系人的个人信息,包括姓名、手机号码、电子邮箱。我们可能通过这些信息验证您的用户身份,并向您推广、介绍服务,发送业务通知、开具发票或与您进行业务沟通等。如您提供的上述信息包含第三方的个人信息或用户信息,您承诺并保证您向我们提供这些信息前已经获得了相关权利人的授权许可。
(3) 上述实名认证过程中,如果您通过人脸识别来进行实名认证的,您还需要提供面部特征的生物识别信息,并授权我们通过国家权威可信身份认证机构进行信息核验。
**1.1.3 您使用服务时**
(1) 我们致力于为您提供安全、可信的产品与使用环境,提供优质而可靠的服务与信息是我们的核心目标。为了维护我们服务的正常运行,保护您或其他用户或公众的合法利益免受损失,我们会收集用于维护产品或服务安全稳定运行的必要信息。
(2) 当您浏览或使用本平台时,为了保障网站和服务的正常运行及运营安全,预防网络攻击、侵入风险,更准确地识别违反法律法规或本平台的相关协议、服务规则的情况,我们会收集您的分辨率、时区和语言等设备信息、网络接入方式及类型信息、网页浏览记录。这些信息是我们提供服务和保障服务正常运行和网络安全所必须收集的基本信息。
(3) 为让您体验到更好的服务,并保障您的使用安全,我们可能记录网络日志信息,以及使用本平台及相关服务的频率、崩溃数据、使用情况及相关性能数据信息。
(4) 当您参与本平台调研、抽奖活动时,本平台可能会留存您的账号ID、姓名、地址、手机号、职务身份、产品和服务使用情况等信息,以后续与您取得联系,核实身份信息,并按照有关活动规则为您提供奖励(如有),具体调研、抽奖活动规则与本协议不一致的,以活动规则为准。
(5) 我们可能收集您使用本平台及相关服务而产生的用户咨询记录、报障记录和针对用户故障的排障过程(如通信或通话记录),我们将通过记录、分析这些信息以便更及时响应您的帮助请求,以及用于改进服务。
(6) 合同信息,如果您需要申请线下交付或进行产品测试等,请联系[contact@siliconflow.cn](mailto:contact@siliconflow.cn)。
(7) 为了向您提供域名服务,依据工信部相关要求,我们会收集域名持有者名称、联系人姓名、通讯地址、地区、邮编、电子邮箱、固定电话/手机号码、证件号码、证件照片。您理解并授权我们和第三方域名服务机构使用这些信息资料为您提供域名服务。
(8) 为了向您提供证书中心服务,依据数字证书认证机构相关要求,我们会收集联系人姓名、联系人邮箱、联系人手机号码、企业名称、企业所在城市、企业地址。您理解并授权我们和第三方证书服务机构使用这些信息资料为您提供证书中心服务。
(9) 您知悉并同意,对于您在使用产品及/或服务的过程中提供的您的联系方式(即联系电话及电子邮箱),我们在运营中可能会向其中的一种或多种发送通知,用于用户消息告知、身份验证、安全验证、用户使用体验调研等用途;此外,我们也可能会向在前述过程中收集的手机号码通过短信、电话的方式,为您提供您可能感兴趣的服务、功能或活动等商业性信息的用途,但请您放心,如您不愿接受这些信息,您可以通过手机短信或回复邮件退订方式进行退订,也可以直接与我们联系进行退订。
### 1.2 我们可能从第三方获得的用户信息
为了给您提供更好、更优、更加个性化的服务,或共同为您提供服务,或为了预防互联网欺诈的目的,我们的关联公司、合作伙伴可能会依据法律规定或与您的约定或征得您同意前提下,向我们分享您的信息。我们会根据相关法律法规规定和/或该身份认证功能所必需,采用行业内通行的方式及尽最大的商业努力来保护您用户信息的安全。
### 1.3 收集、使用用户信息目的变更的处理
请您了解,随着我们业务的发展,我们提供的功能或服务可能有所调整变化。原则上,当新功能或服务与我们当前提供的功能或服务相关时,收集与使用的用户信息将与原处理目的具有直接或合理关联。仅在与原处理目的无直接或合理关联的场景下,我们收集、使用您的用户信息,会再次按照法律法规及国家标准的要求以页面提示、交互流程、协议确认方式另行向您进行告知说明。
### 1.4 业务和客户数据
请您理解,您的业务和客户数据不同于用户信息,本平台将按如下方式处理:
**1.4.1** 您通过本平台提供的服务(不包括第三方服务)进行输入、反馈、修正、加工、存储、上传、下载、分发以及通过其他方式处理(“处理”)的数据,均为您的业务和客户数据(“交互数据”),您完全拥有您的交互数据。本平台作为中立的技术服务提供者,本平台提供的技术服务只会严格执行您的指示处理您的交互数据,除非法律法规另有规定、依据特定产品规则另行约定或基于您的要求为您提供技术协助进行故障排除或解决技术问题,我们不会访问您的交互数据,亦不会对您的交互数据进行任何非授权的使用或披露。
**1.4.2** 您应对您的交互数据来源及内容负责,我们提示您谨慎判断数据来源及内容的合法性。您应保证有权授权本平台通过提供技术服务对该等交互数据进行处理,且前述处理活动均符合相关法律法规的要求,不存在任何违法违规、侵权或违反与第三方合同约定的情形,亦不会将数据用于违法违规目的。若因您的交互数据内容或您处理以及您授权本平台处理交互数据行为违反法律法规、部门规章或国家政策而造成的全部结果及责任均由您自行承担。
**1.4.3** 受限于前款规定,对于本平台自您提供的信息中获取的包括交互数据在内的任何数据中的个人信息,您应当依法提前向相关个人信息主体履行告知义务,并取得相关个人信息主体的单独同意,并保证:
(1) 根据我们要求的方式,就个人信息来源及其合法性提供书面说明和确认;
(2) 在我们要求时,提供个人信息处理的授权同意范围,包括使用目的,个人信息主体同意您使用本平台对其个人信息进行处理;
(3) 如您使用本平台及相关服务所需进行的个人信息处理活动超出该等个人信息的授权同意范围的,您应在提供个人信息后的合理期限内或在我们处理个人信息前,由您负责征得个人信息主体的明示同意并在我们要求时向我们提供书面证明。
您理解并同意,除非满足上述条件及法律要求的其他义务,您不得向我们提供包含个人信息的交互数据。如您违反上述义务,或未按照要求向我们提供合理满意的证明,或我们收到个人信息主体举报或投诉,我们有权单方决定拒绝传输您的相关数据(根据实际情形,包括通过限制相关服务功能,冻结、注销或收回账号等方式),或拒绝按照您的指令处理相关个人信息及其相关的数据,由此产生的全部责任均由您自行承担。
**1.4.4** 您理解并同意,您应根据自身需求自行对您的交互数据进行存储,我们仅依据相关法律法规要求或特定的服务规则约定,提供数据存储服务(例如:您和我们的数据中心就存储您的业务和客户数据有专项约定)。您理解并同意,除非法律法规另有规定或依据服务规则约定,我们没有义务存储您的数据或信息,亦不对您的数据存储工作或结果承担任何责任。
## 2. 对Cookie和同类技术的使用
Cookie和同类技术是互联网中的通用常用技术。当您使用本平台时,我们可能会使用相关技术向您的设备发送一个或多个Cookie或匿名标识符,以收集和存储您的账号信息、搜索记录信息以及登录状态信息。通过Cookie和同类技术可以帮助您省去重复填写账号信息、输入搜索内容的步骤和流程,还可以帮助我们改进服务效率、提升登录和响应速度。
您可以通过浏览器设置拒绝或管理Cookie。但请注意,如果停用Cookie,您有可能无法享受最佳的服务体验,某些功能的可用性可能会受到影响。我们承诺,我们不会将通过Cookie或同类技术收集到的您的用户信息用于本隐私政策所述目的之外的任何其他用途。
## 3. 我们如何存储您的用户信息
### 3.1 信息存储的地点
出于服务专业性考虑,我们可能委托关联公司或其他法律主体向您提供本平台上一项或多项具体服务。我们依照法律法规的规定,将在境内运营本网站和相关服务过程中收集和产生的用户信息存储于中华人民共和国境内。
### 3.2 信息存储的期限
**3.2.1** 我们将仅在为提供本平台及相关服务之目的所必需的期间内保留您的用户信息,但您理解并认可基于不同的服务及其功能需求,必要存储期限可能会有所不同。我们用于确定存储期限的标准包括:
(1) 完成该业务目的需要留存用户信息的时间,包括提供服务,依据法律要求维护相应的交易及业务记录,保证系统和服务的安全,应对可能的用户查询或投诉、问题定位等;
(2) 用户同意的更长的留存期间;
(3) 法律、合同等对保留用户信息的特殊要求等。
**3.2.2** 在您未撤回授权同意、删除或注销账号期间,我们会保留相关信息。超出必要期限后,我们将对您的信息进行删除或匿名化处理,**前述情况若法律法规有强制留存要求的情况下,即使您注销您的账户或要求删除您的用户信息,我们亦无法删除或匿名化处理您的用户信息。**
## 4.我们如何共享、转让、公开披露您的信息
### 4.1 数据使用过程中涉及的合作方
**4.1.1** 原则
(1) 合法原则:与合作方合作过程中涉及数据使用活动的,必须具有合法目的、符合法定的合法性基础。如果合作方使用信息不再符合合法原则,则其不应再使用您的用户信息,或在获得相应合作性基础后再行使用。
(2) 正当与最小必要原则:数据使用必须具有正当目的,且应以达成目的必要为限。
(3) 安全审慎原则:我们将审慎评估合作方使用数据的目的,对这些合作方的安全保障能力进行综合评估,并要求其遵循合作法律协议。我们会对合作方获取信息的软件工具开发包(SDK)、应用程序接口(API)进行严格的安全监测,以保护数据安全。
**4.1.2** 委托处理
对于委托处理用户信息的场景,我们会与受托合作方根据法律规定签署相关处理协议,并对其用户信息使用活动进行监督。
**4.1.3** 共同处理
对于共同处理用户信息的场景,我们会与合作方根据法律规定签署相关协议并约定各自的权利和义务,确保在使用相关用户信息的过程中遵守法律的相关规定、保护数据安全。
**4.1.4** 合作方的范围
若具体功能和场景中涉及由我们的关联方、第三方提供服务,则合作方范围包括我们的关联方与第三方。
### 4.2 用户信息共同数据处理或数据委托处理的情形
**4.2.1** 本平台及相关服务功能中的某些具体模块或功能由合作方提供,对此您理解并同意,在我们与任何合作方合作中,我们仅会基于合法、正当、必要及安全审慎原则,在为提供服务所最小的范围内向其提供您的用户信息,并且我们将努力确保合作方在使用您的信息时遵守本隐私政策及我们要求其遵守的其他适当的保密和安全措施,承诺不得将您的信息用于其他任何用途。
**4.2.2** 为提供更好的服务,我们可能委托合作方向您提供服务,包括但不限于客户服务、支付功能、实名认证、技术服务等,因此,为向您提供服务所必需,我们会向合作方提供您的某些信息。例如:
(1) 为进行用户实名认证在您使用身份认证的功能或相关服务所需时,根据相关法律法规的规定及相关安全保障要求可能需要完成实名认证以验证您的身份。在实名认证过程中,与我们合作的认证服务机构可能需要使用您的真实姓名、身份证号码、手机号码等。
(2) 支付功能由与我们合作的第三方支付机构向您提供服务。第三方支付机构为提供功能可能使用您的姓名、银行卡类型及卡号、有效期、身份证号码及手机号码等。
(3) 为及时处理您的投诉、建议以及其他诉求,我们的客户服务提供商(若有)可能需要使用您的账号及所涉及的事件的相关信息,以及时了解、处理和相应相关问题。
**4.2.3** 为保障服务安全与分析统计的数据使用
(1) 保障使用安全:我们非常重视账号与服务安全,为保障您和其他用户的账号与财产安全,使您和我们的正当合法权益免受不法侵害,我们和我们的合作方可能需要使用必要的设备、账号及日志信息。
(2) 分析服务使用情况:为分析我们服务的使用情况,提升用户使用的体验,我们和我们的合作方可能需要使用您的服务使用情况(崩溃、闪退)的统计性数据,这些数据难以与其他信息结合识别您的身份或与您的身份相关联。
### 4.3 用户信息的转移
我们不会转移您的用户信息给任何其他第三方,但以下情形除外:
**4.3.1** 基于您的书面请求,并符合国家网信部门规定条件的,我们会向您提供转移的途径。
**4.3.2** 获得您的明确同意后,我们会向其他第三方转移您的用户信息。
**4.3.3** 在涉及本平台运营主体变更、合并、收购或破产清算时,如涉及到用户信息转移,我们会依法向您告知有关情况,并要求新的持有您的信息的公司、组织继续接受本隐私政策的约束或按照不低于本隐私政策所要求的安全标准继续保护您的信息,否则我们将要求该公司、组织重新向您征求授权同意。如发生破产且无数据承接方的,我们将对您的信息做删除处理。
### 4.4 用户信息的公开披露
**4.4.1** 原则上我们不会公开披露您的用户信息,除非获得您明确同意或遵循国家法律法规规定的披露。
(1) 获得您明确同意或基于您的主动选择,我们可能会公开披露您的用户信息;
(2) 为保护您或公众的人身财产安全免遭侵害,我们可能根据适用的法律或本平台相关协议、规则披露关于您的用户信息。
**4.4.2** 征得授权同意的例外
请您理解,在下列情形中,根据法律法规及相关国家标准,我们收集和使用您的用户信息不必事先征得您的授权同意:
(1) 与我们履行法律法规规定的义务相关的;
(2) 与国家安全、国防安全直接相关的;
(3) 与公共安全、公共卫生、重大公共利益直接相关的;
(4) 与刑事侦查、起诉、审判和判决执行等直接相关的;
(5) 出于维护您或他人的生命、财产等重大合法权益但又很难得到本人授权同意的;
(6) 您自行向社会公众公开的信息;
(7) 根据用户信息主体要求签订和履行合同所必需的;
(8) 从合法公开披露的信息中收集的您的信息的,如合法的新闻报道、政府信息公开等渠道;
(9) 用于维护软件及相关服务的安全稳定运行所必需的,例如发现、处置软件及相关服务的故障;
(10) 为开展合法的新闻报道所必需的;
(11) 为学术研究机构,基于公共利益开展统计或学术研究所必要,且对外提供学术研究或描述的结果时,对结果中所包含的个人信息进行去标识化处理的;
(12) 法律法规规定的其他情形。
特别提示您注意,如信息无法单独或结合其他信息识别到您的个人身份,其不属于法律意义上您的个人信息;当您的信息可以单独或结合其他信息识别到您的个人身份时,这些信息在结合使用期间,将作为您的用户信息按照本隐私政策处理与保护。
## 5. 我们如何保护您的信息安全
我们非常重视用户信息的安全,将努力采取合理的安全措施(包括技术方面和管理方面)来保护您的信息,防止您提供的信息被不当使用或未经授权的情况下被访问、公开披露、使用、修改、损坏、丢失或泄漏。 我们会使用不低于行业通行的加密技术、匿名化处理等合理可行的手段保护您的信息,并使用安全保护机制尽可能地降低您的信息遭到恶意攻击的可能性。
我们会有专门的人员和制度保障您的信息安全。我们采取严格的数据使用和访问制度。尽管已经采取了上述合理有效措施,并已经遵守了相关法律规定要求的标准,但请您理解,由于技术的限制以及可能存在的各种恶意手段,在互联网行业,即便竭尽所能加强安全措施,也不可能始终保证信息百分之百的安全,我们将尽力确保您提供给我们的信息的安全性。您知悉并理解,您接入我们的服务所用的系统和通讯网络,有可能因我们可控范围外的因素而出现问题。因此,我们强烈建议您采取积极措施保护用户信息的安全,包括但不限于使用复杂密码、定期修改密码、不将自己的账号密码等信息透露给他人。
我们会制定应急处理预案,并在发生用户信息安全事件时立即启动应急预案,努力阻止该等安全事件的影响和后果扩大。一旦发生用户信息安全事件(泄露、丢失等)后,我们将按照法律法规的要求,及时向您告知:安全事件的基本情况和可能的影响、我们已经采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施等。我们将及时将事件相关情况以推送通知、邮件、信函或短信等形式告知您,难以逐一告知时,我们会采取合理、有效的方式发布公告。同时,我们还将按照相关监管部门要求,上报用户信息安全事件的处置情况。
我们谨此特别提醒您,本隐私政策提供的用户信息保护措施仅适用于本平台及相关服务。一旦您离开本平台及相关服务,浏览或使用其他网站、产品、服务及内容资源,我们即没有能力及义务保护您在本平台及相关服务之外的软件、网站提交的任何信息,无论您登录、浏览或使用上述软件、网站是否基于本平台的链接或引导。
## 6. 我们如何管理您的用户信息
我们非常重视对用户信息的管理,并依法保护您对于您信息的查阅、复制、更正、补充、删除以及撤回授权同意、注销账号、投诉举报等权利,以使您有能力保障您的隐私和信息安全。
### 6.1 您在用户信息处理活动中的权利
**6.1.1** 一般情况下,您可以查阅、复制、更正、补充、访问、修改、删除您主动提供的用户信息。
**6.1.2** 在以下情形中,您可以向我们提出删除用户信息的请求:
(1) 如果处理目的已实现、无法实现或者为实现处理目的不再必要;
(2) 如果我们处理用户信息的行为违反法律法规;
(3) 如果我们收集、使用您的用户信息,却未征得您的同意;
(4) 如果我们处理用户信息的行为违反了与您的约定;
(5) 如果我们停止提供产品或者服务,或用户信息的保存期限已届满;
(6) 如果您撤回同意授权;
(7) 如果我们不再为您提供服务;
(8) 法律、行政法规规定的其他情形。
### 6.2 撤回或改变您授权同意的范围
**6.2.1** 您理解并同意,每项服务均需要一些基本用户信息方得以完成。除为实现业务功能收集的基本用户信息外,对于额外收集的用户信息的收集和使用,您可以选择撤回您的授权,或改变您的授权范围。您也可以通过注销账号的方式,撤回我们继续收集您用户信息的全部授权。
**6.2.2** 您理解并同意,当您撤回同意或授权后,将无法继续使用与撤回的同意或授权所对应的服务,且本平台也不再处理您相应的用户信息。但您撤回同意或授权的决定,不会影响此前基于您的授权而开展的用户信息处理。
### 6.3 如何获取您的用户信息副本
我们将根据您的书面请求,为您提供以下类型的用户信息副本:您的基本资料、用户身份信息。但请注意,我们为您提供的信息副本仅以我们直接收集的信息为限。
### 6.4 响应您的请求
您享有注销账号、举报或投诉的权利。为保障安全,您可能需要提供书面请求,并以其它方式证明您的身份。 对于您合理的请求,我们原则上不收取费用。但对多次重复、超出合理限度的请求,我们将视具体情形收取一定成本费用。对于那些无端重复、需要过多技术手段(例如,需要开发新系统或从根本上改变现行惯例)、给他人合法权益带来风险或者不切实际(例如,涉及备份磁带上存放的信息)的请求,我们可能会予以拒绝。
您理解并认可,在以下情形中,我们将无法响应您的请求:
(1) 与我们履行法律法规规定的义务相关的;
(2) 与国家安全、国防安全直接相关的;
(3) 与公共安全、公共卫生、重大公共利益直接相关的;
(4) 与刑事侦查、起诉、审判和执行判决等直接相关的;
(5) 我们有充分证据表明用户信息主体存在主观恶意或滥用权利的;
(6) 出于维护用户信息主体或其他个人的生命、财产等重大合法权益但又很难得到本人同意的;
(7) 响应用户信息主体的请求将导致用户信息主体或其他个人、组织的合法权益受到严重损害的;
(8) 涉及商业秘密的。
### 6.5 停止运营向您告知
如我们停止运营,我们将停止收集您的用户信息,并将停止运营的通知以逐一送达或公告等商业上可行的形式通知您,并对我们所持有的您的用户信息进行删除或匿名化处理。
## 7. 未成年人使用条款
我们的服务主要面向企业或相关组织。未成年人(不满十四周岁)不应创建任何账户或使用本平台及其服务。如果我们发现在未事先获得可证实的监护人同意的情况下提供了用户信息,经未成年人的监护人书面告知后我们会设法尽快删除相关信息。
## 8. 隐私政策的修订和通知
为了给您提供更好的服务,本平台及相关服务将不时更新与变化,我们会适时对本隐私政策进行修订,该等修订构成本隐私政策的一部分并具有等同于本隐私政策的效力。但未经您明确同意,我们不会严重减少您依据当前生效的隐私政策所应享受的权利。
本隐私政策更新后,我们会在本平台公布更新版本,并在更新后的条款生效前通过官方网站公告或其他适当的方式提醒您更新的内容,以便您及时了解本隐私政策的最新版本。如您继续使用本平台及相关服务,视为您同意接受修订后的本隐私政策的全部内容。
对于重大变更,我们还会提供更为显著的通知(包括但不限于电子邮件、短信、系统消息或在浏览页面做特别提示等方式),向您说明本隐私政策的具体变更。
本隐私政策所指的重大变更包括但不限于:
(1) 我们的服务模式发生重大变化。如处理用户信息的目的、处理用户信息的类型、用户信息的使用方式等;
(2) 我们在所有权结构、组织架构等方面发生重大变化。如业务调整、破产并购等引起的所有变更等;
(3) 用户信息传输、转移或公开披露的主要对象发生变化;
(4) 您参与用户信息处理方面的权利及其行使方式发生重大变化;
(5) 我们的联络方式及投诉渠道发生变化时。
## 9. 适用范围
本隐私政策适用于本平台提供产品、服务、解决方案以及公司后续可能不时推出的纳入服务范畴内的其他产品、服务或解决方案。
本隐私政策不适用于有单独的隐私政策且未纳入本隐私政策的第三方通过本平台向您提供的产品或服务(“第三方服务”)。您使用这些第三方服务(包括您向这些第三方提供的任何含用户信息在内的信息),将受这些第三方的服务条款及隐私政策约束(而非本隐私政策),并通过其建立的用户信息主体请求和投诉等机制,提出相关请求、投诉举报,具体规定请您仔细阅读第三方的条款。请您妥善保护自己的用户信息,仅在必要的情况下向第三方提供。
需要特别说明的是,作为本平台的用户,若您利用本平台的技术服务,为您的用户再行提供服务,因您与客户的业务合作所产生的数据属于您所有,您应当与您的用户自行约定相关隐私政策,本隐私政策不作为您与您的用户之间的隐私政策的替代。
# 用户充值协议
Source: https://docs.siliconflow.cn/cn/legals/recharge-policy
更新日期:2024年8月15日
尊敬的用户,为保障您的合法权益,请您在点击“购买”按钮前,完整、仔细地阅读本充值协议,当您点击“立即购买”按钮,即表示您已阅读、理解本协议内容,并同意按照本协议约定的规则进行充值和使用余额行为。如您不接受本协议的部分或全部内容,请您不要点击“立即购买”按钮。
## 1. 接受条款
欢迎您使用SiliconCloud平台。以下所述条款和条件为平台充值的用户(以下简称“用户“或“您“)和北京硅基流动科技有限公司(以下简称“硅基流动”)就充值以及余额使用所达成的协议。
当您以在线点击“立即购买”等方式确认本协议或实际进行充值时,即表示您已理解本协议内容并同意受本协议约束,包括但不限于本协议正文及所有硅基流动已经发布的或将来可能发布的关于服务的各类规则、规范、公告、说明和(或)通知等,以及其他各项网站规则、制度等。所有前述规则为本协议不可分割的组成部分,与协议正文具有同等法律效力。
硅基流动有权根据国家法律法规的变化以及实际业务运营的需要不时修改本协议相关内容,并提前公示于软件系统、网站等以通知用户。修改后的条款应于公示通知指定的日期生效。如果您选择继续充值即表示您同意并接受修改后的协议且受其约束;如果您不同意我们对本协议的修改,请立即放弃充值或者停止使用本服务。
请注意,本协议限制了硅基流动的责任,还限制了您的责任,具体条款将以加粗并加下划线的形式提示您注意,硅基流动督促您仔细阅读。如果您对本协议的条款有疑问的,请通过客服渠道(电子邮箱:[contact@siliconflow.cn](mailto:contact@siliconflow.cn))进行询问,硅基流动将向您解释条款内容。如果您不同意本协议的任意内容,或者无法准确理解硅基流动对条款的解释,请不要同意本协议或使用本协议项下的服务。
## 2. 定义
**2.1** SiliconCloud平台个人充值消耗账户:简称“消耗账户”,指由硅基流动根据用户的SiliconCloud平台账户为用户自动配置的账户。用户向该账户充值的行为视为用户向硅基流动预付服务费,预付服务费可用于购买SiliconCloud平台提供的产品或服务。
**2.2** 充值包:指硅基流动向用户提供的金额不等的服务费预存充值包。充值包一般指自定义充值包,即指用户自定义金额的预存费用。
## 3. 充值条件
当您充值时,您应该具有经实名认证成功后的SiliconCloud平台账户。
## 4. 账户安全
**4.1** 当用户进行充值时,用户应仔细确认自己的账号及信息,若因为用户自身操作不当、不了解或未充分了解充值计费方式等因素造成充错账号、错选充值种类等情形而损害自身权益,应由用户自行承担责任。
**4.2** 用户在充值时使用第三方支付企业提供的服务的,应当遵守与该第三方的各项协议及其服务规则;在使用第三方支付服务过程中用户应当妥善保管个人信息,包括但不限于银行账号、密码、验证码等;用户同意并确认,硅基流动对因第三方支付服务产生的纠纷不承担任何责任。
## 5. 充值方式
**5.1** 用户充值可以选择硅基流动认可的第三方支付企业(目前支持支付宝和微信)支付充值金额。
**5.2** 用户如委托第三方对其消耗账户充值,则用户承诺并保证其了解和信任第三方,且第三方亦了解和同意接受用户委托,为用户充值;否则,如硅基流动被第三方告知该等充值非经第三方同意,则硅基流动有权立即锁定用户的消耗账户(账户锁定期间,硅基流动将暂停用户使用服务,同时锁定用户 API keys,下同)。自用户的消耗账户被锁定之日起30日内,用户应提供充足证据证实第三方事先同意为其充值,否则用户同意并授权硅基流动配合第三方的要求,自用户被锁定的消耗账户中将相应款项退还第三方。如届时用户的消耗账户余额不足以退还,则短缺部分,用户同意最晚在30日内充值相应金额,委托硅基流动退还,或自其微信账户或支付宝账户自行退还,除非第三方同意用户可不退还这部分款项。
**5.3** 用户承诺并保证用于其消耗账户充值的资金来源的合法性,否则硅基流动有权配合司法机关或其他政府主管机关的要求,对用户的消耗账户进行相应处理,包括但不限于锁定用户的消耗账户等。
## 6. 充值金额和充值优惠
**6.1** 充值金额,是指您进行在线充值并实际支付的金额(人民币),不包括充值赠送的金额,可在SiliconCloud平台自由消耗使用。
**6.2** 充值赠送金额,是指根据SiliconCloud平台不时推出的充值优惠活动,在充值金额以外、额外赠予的金额(包括但不限于红包等)。充值赠送金额不可提现、不可转让,不可开具发票。充值赠送金额将依据对应的活动规则发放并依据对应的使用规则使用。
**6.3** 用户可根据其实际需求及软件系统要求的最低金额选择订购充值包对其消耗账户充值。充值包成功订购后立即生效,无有效期,可叠加使用。用户消耗账户内金额消耗完毕或余额不足时,用户将无法使用平台服务。
## 7. 账户金额使用
**7.1** 您充值后,账户余额的使用不设有效期,不能转移、转赠。因此,请您根据自己的消耗情况选择充值金额,硅基流动对充值次数不做限制。
**7.2** 您成功充值可以立即开始使用相应产品(或服务)。
## 8. 发票
硅基流动将在您的充值金额消耗后,按照实际消耗金额,根据您订购的产品(或服务)协议开具相应发票。
## 9. 关于退款
**9.1** 您应充分预估实际需求并确定充值金额,由于平台接口对tokens连续消耗的特性,消耗账户通常不支持退款。如您因特殊情况必须退款,尚未消费的充值金额申请退款的可联系平台客服并配合提供相关证明材料,硅基流动将对用户的退款事宜进行审核。如审核通过的,将会根据用户充值时选取的支付手段将相应充值金额原路返还给用户,并扣除对应手续费。
**9.2** 充值金额仅支持一次性退款,充值赠送金额(包括但不限于红包及同类非现金折扣等)不支持申请退款。一旦发起退款申请,充值赠送金额将于退款申请之时失效。
**9.3** 您完成充值并已经消耗的或根据相关产品(或服务)协议应予扣除的,将不予退还。
## 10. 争议解决
本协议适用中华人民共和国大陆地区法律。用户如因本协议与硅基流动发生争议的,双方应首先友好协商解决,如协商不成的,该等争议将由北京市海淀区人民法院管辖。
# 用户协议
Source: https://docs.siliconflow.cn/cn/legals/terms-of-service
更新日期:2025年02月12日
这是您与北京硅基流动科技有限公司及其关联方(**“硅基流动”**或**“我们”**)之间的协议(**“本协议”**),您确认:在您开始试用或购买我们 **SiliconCloud**平台(**本平台**)的产品或服务前,您已充分阅读、理解并接受本协议的全部内容,**一旦您选择“同意”并开始使用本服务或完成购买流程,即表示您同意遵循本协议之所有约定。不具备前述条件的,您应立即终止注册或停止使用本服务**。如您与我们已就您使用本平台服务事宜另行签订其他法律文件,则本协议与该等法律文件冲突的部分对您不适用。**另本平台的详细数据使用政策请见《隐私政策》。**
## 1. 账户管理
**1.1** 您保证自身具有法律规定的完全民事权利能力和民事行为能力,是能够独立承担民事责任的自然人或法人;本协议内容不会被您所属国家或地区的法律禁止。您知悉,**无民事行为能力人、限制民事行为能力人(本平台指十四周岁以下的未成年人)不当注册为平台用户的,其与平台之间的服务协议自始无效,一经发现,平台有权立即停止为该用户服务或注销该用户账号。**
**1.2 账户**
1.2.1 在您按照本平台的要求填写相关信息并确认同意履行本协议的内容后,我们为您注册账户并开通本平台的使用权限,您的账户仅限您本人使用并使您能够访问某些服务和功能,我们可能根据我们的独立判断不时地修改和维护这些服务和功能。
1.2.2 个人可代表公司或其他实体访问和使用本平台,在这种情况下,本协议不仅在我们与该个人之间的产生效力,亦在我们与该等公司或实体之间产生效力。
1.2.3 如果您通过第三方连接/访问本服务,即表明允许我们访问和使用您的信息,并存储您的登录凭据和访问令牌。
1.2.4 账户安全。当您创建帐户时,您有权使用您设置或确认的手机号码及您设置的密码登陆本平台。**我们建议您使用强密码(由大小写字母、数字和符号组合而成的密码)来保护您的帐户。** 您的账户由您自行设置并由您保管,本平台在任何时候均不会主动要求您提供您的账户密码。因此,建议您务必保管好您的账户,**若账户因您主动泄露或因您遭受他人攻击、诈骗等行为导致的损失及后果,本平台不承担责任,您应通过司法、行政等救济途径向侵权行为人追偿。** 您向我们提供您的电子邮件地址作为您的有效联系方式,即表明您同意我们使用该电子邮件地址向您发送相关通知,请您务必及时关注。
**1.3** 变更、暂停和终止。**我们**在尽最大努力以本平台公告、站内信、邮件或短信等一种或多种方式进行事先通知的情况下,**我们可以变更、暂停或终止向您提供服务,或对服务设置使用限制,而无需承担责任。可以在任何时候停用您的帐户**。即便您的账户因任何原因而终止后,您将继续受本协议的约束。
**1.4** 在法律有明确规定要求的情况下,本平台作为平台服务提供者若必须对用户的信息进行核实的情况下,本平台将依法不时地对您的信息进行检查核实,您应当配合提供最新、真实、完整、有效的信息。**若本平台无法依据您提供的信息进行核验时,本平台可向您发出询问或要求整改的通知,并要求您进行重新认证,直至中止、终止对您提供部分或全部平台服务,本平台对此不承担任何责任。**
**1.5** 您应当为自己与其他用户之间的交互、互动、交流、沟通负责。我们保留监督您与其他用户之间争议的权利。我们不因您与其他用户之间的互动以及任何用户的作为或不作为而承担任何责任,包括与用户内容(定义见下文)相关的责任。
## 2. 访问服务及服务限制
**2.1** 访问服务。在您遵守本协议的前提下,您在此被授予非排他性的、不可转让的访问和使用本服务的权利,仅用于您个人使用或您代表的公司或其他实体内部业务目的。我们保留本协议中未明确授予的所有权利。
**2.2 服务限制**
2.2.1 对服务的任何部分进行反汇编、反向工程、解码或反编译;
2.2.2 将本服务上或通过本服务提供的任何内容(包括任何标题信息、关键词或其他元数据)用于任何机器学习和人工智能培训或开发目的,或用于旨在识别自然人身份的任何技术;
2.2.3 未经我们事先书面同意,购买、出售或转让API密钥;
2.2.4 复制、出租、出售、贷款、转让、许可或意图转授、转售、分发、修改本服务任何部分或我们的任何知识产权(定义见下文);
2.2.5 采取可能对我们的服务器、基础设施等造成不合理的巨大负荷的任何行为;
**2.2.6 以下列任何方式或目的使用本平台服务:(i)反对宪法所确定的基本原则的;(ii)危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;(iii)损害国家荣誉和利益的;(iv)煽动地域歧视、地域仇恨的;(v)煽动民族仇恨、民族歧视,破坏民族团结的;(vi)破坏国家宗教政策,宣扬邪教和封建迷信的;(vii)散布谣言,扰乱社会秩序,破坏社会稳定的;(viii)散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;(ix)侮辱或者诽谤他人,侵害他人合法权益的;(x)煽动非法集会、结社、游行、示威、聚众扰乱社会秩序的;(xi)以非法民间组织名义活动的(xii) 有可能涉及版权纠纷的非本人作品的;(xiii)有可能侵犯他人在先权利的;(xiv)对他人进行暴力恐吓、威胁,实施人肉搜索的;(xv)涉及他人隐私、个人信息或资料的;(xvi)侵犯他人隐私权、名誉权、肖像权、知识产权等合法权益内容的;(xvii) 侵害未成年人合法权益或者损害未成年人身心健康的(xviii)未获他人允许,偷拍、偷录他人,侵害他人合法权利的;(xix)违反法律法规底线、社会主义制度底线、国家利益底线、公民合法权益底线、社会公共秩序底线、道德风尚底线和信息真实性底线的“七条底线”要求的;(xx)相关法律、行政法规等禁止的。**
2.2.7 绕开我们可能用于阻止或限制访问服务的措施,包括但不限于阻止或限制使用或复制任何内容或限制使用服务或其任何部分的功能;
2.2.8 试图干扰、破坏运行服务的服务器的系统完整性或安全性,或破译与运行服务的服务器之间的任何传输;
2.2.9 使用本服务发送垃圾邮件、连锁信或其他未经请求的电子邮件;
2.2.10 通过本服务传输违法数据、病毒或其他软件代理;
2.2.11 冒充他人或实体,歪曲您与某人或实体的关系,隐藏或试图隐藏您的身份,或以其他方式为任何侵入性或欺诈性目的使用本服务;或从本服务收集或获取包括用户姓名在内的任何个人信息。
2.2.12 从本服务收集或获取包括但不限于其他用户姓名在内的任何个人信息。
2.2.13 其他未经我们明示授权的行为或可能损害我们利益的使用方式。
## 3. 用户内容
**3.1** 本服务可能允许用户在注册后,基于平台使用目的在使用模型过程中进行输入、反馈、修正、加工、存储、上传、下载、分发相关个人资料信息、视频、图像、音频、评论、问题和其他内容、文件、数据和信息(“用户内容”)。**详细数据使用政策请见本平台的《隐私政策》。**
**3.2** 如用户内容存在任何违反法律法规或本协议的情况,我们有权利删除任何用户内容。
**3.3** 关于您的用户内容,您确认、声明并保证:
**3.3.1 您已获得用户内容中提及的每一个可识别自然人(如有)的书面同意,可以按照本协议所设想的方式合法地使用该等自然人的姓名、声音和形象,该等自然人已免除您因该等使用而可能产生的任何责任;
3.3.2 您已获得适用法律所要求的与第三方有关的用户内容的所有同意、授权,且您就本服务提供或上传到平台的用户内容不侵犯任何第三方的任何权利;
3.3.3 您的用户内容,以及我们根据本协议对用户内容的使用,不会违反任何适用法律或侵犯任何第三方的任何权利,包括但不限于任何知识产权和隐私权;
3.3.4 您的用户内容不包括任何被政府机构视为敏感或保密的信息或材料,且您就本服务提供的用户内容不侵犯任何第三方的任何保密权利;
3.3.5 您不会上传或通过本服务直接或通过其他方式提供14岁以下儿童的任何个人信息;
3.3.6 您的用户内容不包括裸体或其他性暗示内容;不包括对个人或团体的仇恨言论、威胁或直接攻击;不包括辱骂、骚扰、侵权、诽谤、低俗、淫秽或侵犯他人隐私的内容;不包括性别歧视或种族、民族或其他歧视性内容;不包括含有自残或过度暴力的内容;不包括伪造或冒名顶替的档案;不包括非法内容或助长有害或非法活动的内容;不包括恶意程式或程式码;不包括未经本人同意的任何人的个人信息;不包括垃圾邮件、机器生成的内容或未经请求的信息及其他令人反感的内容;**
3.3.7 据您所知,您提供给我们的所有用户内容和其他信息都是真实和准确的。
**3.4 本平台作为独立的技术支持者,您利用本平台接入大模型所产生的全部用户内容及义务和责任均由您承担,本平台不对由此造成的任何损失负责。**
**3.5 本平台作为独立的技术支持者,您利用本平台向任何第三方提供服务,相应的权利义务和责任均由您承担,本平台不对由此造成的任何损失负责。**
**3.6 免责声明。我们对任何用户内容概不负责。您将对您输入、反馈、修正、加工、存储、上传、下载、分发在本平台及模型服务上的用户内容负责并承担全部责任。本平台提供的技术服务只会严格执行您的指示处理您的用户内容,除非法律法规另有规定、依据特定产品规则另行约定或基于您的要求为您提供技术协助进行故障排除或解决技术问题,我们不会访问您的用户内容,您理解并认同我们及本平台只是作为用户内容的被动技术支持者或渠道,对于用户内容我们没有义务进行存储,亦不会对您的用户内容进行任何非授权的使用或披露。同时我们仅在合法合规的基础上且基于向您提供本平台服务的前提下使用您的用户内容。**
## 4. 知识产权
**4.1** 定义。就本协议而言,“知识产权”系指所有专利权、著作权、精神权利、人格权、商标权、商誉、商业秘密权、技术、信息、资料等,以及任何可能存在或未来可能存在的知识产权和所有权,以及根据适用法律提出的所有申请中、已注册、续期的知识产权。
**4.2** 硅基流动知识产权。您理解并承认,我们拥有并将持续拥有本服务的所有权利(包括知识产权),您不得访问、出售、许可、出租、修改、分发、复制、传输、展示、发布、改编、编辑或创建任何该等知识产权的衍生作品。严禁将任何知识产权用于本协议未明确许可的任何目的。本协议中未明确授予您的权利将由硅基流动保留。
**4.3** 输出。在您遵守如下事项且在合法合规的基础上,可以将大模型产出的结果进行使用:(i)您对服务和输出的使用不会转移或侵犯任何知识产权(包括不会侵犯硅基流动知识产权和其他第三方知识产权);(ii)如果我们酌情认为您对输出的使用违反法律法规或可能侵犯任何第三方的权利,我们可以随时限制您对输出的使用并要求您停止使用输出(并删除其任何副本);(iii)您不得表示大模型的输出结果是人为生成的;(iv)您不得违反任何模型提供商的授权许可或使用限制。
您同意,我们不对您或任何第三方声称因由我们提供的技术服务而产生的任何输出内容或结果承担任何责任。
**4.4 用户使用数据。我们可能会收集或您可能向我们提供诊断、技术、使用的相关信息,包括有关您的计算机、移动设备、系统和软件的信息(“用户使用数据”)。我们可能出于平台维护运营的需要,且在法律许可的范围内使用、维护和处理用户使用数据或其中的任何部分,包括但不限于:(a)提供和维护服务;(b)改进我们的产品和服务或开发新的产品或服务。详细数据使用政策请见本平台的《隐私政策》。**
**4.5** 反馈。 如果您向我们提供有关本服务或任何其他硅基流动产品或服务的任何建议或反馈(“反馈”),则您在此将所有对反馈的权益转让给我们,我们可自由使用反馈以及反馈中包含的任何想法、专有技术、概念、技术和知识产权。反馈被视为我们的保密信息(定义如下)。
## 5. 保密信息
本服务可能包括硅基流动和其他用户的非公开、专有或保密信息(“保密信息”)。保密信息包括任何根据信息的性质和披露情况应被合理理解为保密的信息,包括非公开的商业、产品、技术和营销信息。您将:(a)至少以与您保护自己高度敏感的信息相同的谨慎程度保护所有保密信息的隐私性,但在任何情况下都不得低于合理的谨慎程度;(b)除行使您在本协议下的权利或履行您的义务外,不得将任何保密信息用于任何目的;以及(c)不向任何个人或实体披露任何保密信息。
## 6. 计费政策及税费
您理解并同意,本平台提供的部分服务可能会收取使用费用、售后费用或其他费用(“费用”)。您通过选择使用本服务即表示您同意您注册网站上载明的适用于您的定价和付款条款(受限于我们的不时更新的定价/付款条件/充值协议等文件),您同意我们相应监控您的使用数据以便完成本服务计费。定价、付款条件和充值协议特此通过引用并入本协议。您同意,我们可能会添加新产品和/或服务的额外费用、增加或修改现有产品和/或服务的费用,我们可能会按照您的实际使用地点设定不同的价格费用,和/或停止随时提供任何服务。未经我们书面同意或本平台有其他相关政策,付款义务一旦发生不可取消,并且已支付的费用不予退还。如存在任何政府要求的税费,您将负责支付与您的所有使用/开通服务相关的税款。若您在购买服务时有任何问题,您可以通过[contact@siliconflow.cn](mailto:contact@siliconflow.cn)联系我们。
## 7. 隐私与数据安全
**7.1** 隐私。基于您注册以及开通相关服务时主动提供给本平台的相关信息(“用户信息”),且为了确保您正常使用本平台的相关服务,我们可能对您提供的用户信息进行收集、整理、使用,但我们将持续遵守《中华人民共和国个人信息保护法》及相关适用法律。
**7.2** 数据安全。我们关心您个人信息的完整性和安全性,然而,我们不能保证未经授权的第三方永远无法破坏我们的安全保护措施。
## 8. 使用第三方服务
本服务可能包含非我们拥有或控制的第三方网站、资料和服务(“第三方服务”)的链接,本服务的某些功能可能需要您使用第三方服务。我们不为任何第三方服务背书或承担任何责任。如果您通过本服务访问第三方服务或在任何第三方服务上共享您的用户内容,您将自行承担风险,并且您理解本协议不适用于您对任何第三方服务的使用。您明确免除我们因您访问和使用任何第三方服务而产生的所有责任。
## 9. 赔偿
您将为我们及我们的子公司和关联公司及各自的代理商、供应商、许可方、员工、承包商、管理人员和董事(“硅基流动受偿方”)进行辩护、赔偿并使其免受因以下原因而产生的任何和所有索赔、损害(无论是直接的、间接的、偶然的、后续的或其他的)、义务、损失、负债、成本、债务和费用(包括但不限于法律费用)的损害:(a)您访问和使用本服务,包括您对任何输出的使用;(b)您违反本协议的任何条款,包括但不限于您违反本协议中规定的任何陈述和保证;(c)您对任何第三方权利的侵犯,包括但不限于任何隐私权或知识产权;(d)您违反任何适用法律;(e)用户内容或通过您的用户账户提交的任何内容,包括但不限于任何误导性、虚假或不准确的信息;(f)您故意的或者存在重大过失的不当行为;或(g)任何第三方使用您的用户名、密码或其他认证凭证访问和使用本服务。
## 10. 免责声明
**您使用本服务的风险自负。我们明确否认任何明示、暗示或法定的保证、条件或其他条款,包括但不限于与适销性、适用于特定目的、设计、条件、性能、效用、所有权以及未侵权有关的保证、条件或其他条款。我们不保证服务将不中断或无错误运行,也不保证所有错误将得到纠正。此外,我们不保证服务或与使用服务相关的任何设备、系统或网络不会遭受入侵或攻击。
通过使用本服务下载或以其他方式获得的任何内容,其获取风险由您自行承担,您的计算机系统或移动设备的任何损坏和由于上述情况或由于您访问和使用本服务而导致的数据丢失,您应承担全部责任。此外,硅基流动不为任何第三方通过本服务或任何超链接网站或服务宣传或提供的任何产品或服务提供担保、背书、保证、推荐或承担责任,硅基流动不参与或以任何方式监控您与第三方产品或服务提供商之间的任何交易。**
## 11. 责任限制和免责
硅基流动在任何情况下均不对以下损害负责:(a)间接、偶发、示范性、特殊或后果性损害;或者(b)数据丢失或受损,或者业务中断或损失;或者(c)收入、利润、商誉或预期销量或收益损失,无论是在何种法律下,无论此种损害是否因使用或无法使用软件或其他产品引起,即使硅基流动已被告知此种损害的可能性。硅基流动及其关联方、管理人员、董事、员工、代理、供应商和许可方对您承担的所有责任(无论是因保证、合同或侵权(包括疏失))无论因何原因或何种行为方式产生,始终不超过您已支付给硅基流动的费用。本协议任何内容均不限制或排除适用法律规定不得限制或排除的责任。
## 12. 适用法律及争议解决条款
本协议受中华人民共和国(仅为本协议之目的,不包括香港特别行政区、澳门特别行政区及台湾地区)法律管辖。
若在执行本协议过程中如发生纠纷,双方应及时协商解决。协商不成时,我们与您任一方均有权提请北京仲裁委员会按照其届时有效仲裁规则进行仲裁,而此仲裁规则由此条款纳入本协议。仲裁语言为中文。仲裁地将为北京。仲裁结果为终局且对双方都有约束力。
## 13. 其他条款
**13.1** 可转让性。未经我们事先明确书面同意,您不得转让或转让本协议及本协议项下授予的任何权利和许可,但我们可无限制地转让。任何违反本协议的转让或让渡均属无效。
**13.2** 可分割性。如果本协议的某一条款或某一条款的一部分无效或不可执行,不影响本协议其他条款的有效性,无效或不可执行的条款将被视作已从本协议中删除。
**13.3** 不时修订。根据相关法律法规变化及硅基流动运营需要,我们将不时地对本协议进行修改,修改后的协议将替代修订前的协议。您在使用本平服务时,可及时查阅了解。如您继续使用本服务,则视为对修改内容的同意,当发生有关争议时,以最新的用户协议为准;您在不同意修改内容的情况下,有权停止使用本协议涉及的服务。
# 更新公告
Source: https://docs.siliconflow.cn/cn/release-notes/overview
### 平台服务调整通知
为保障平台服务质量与资源合理分配,现调整Rate Limits策略如下:
一、调整内容
1. 新增 RPH 限制(Requests Per Hour,每小时请求数)
* 模型范围:deepseek-ai/DeepSeek-R1、deepseek-ai/DeepSeek-V3
* 适用对象:所有用户
* 限制标准:30次/小时
2. 新增 RPD 限制(Requests Per Day,每日请求数)
* 模型范围:deepseek-ai/DeepSeek-R1、deepseek-ai/DeepSeek-V3
* 适用对象:未完成实名认证用户
* 限制标准:100次/天
随着流量和负载变化,策略可能会不定时调整,硅基流动保留解释权。
### 平台服务调整通知
#### 1. 模型下线通知
为了提供更稳定、高质量、可持续的服务,以下模型将于 **2025 年 02 月 27 日**下线:
* [meta-llama/Meta-Llama-3.1-405B-Instruct](https://cloud.siliconflow.cn/models?target=meta-llama/Meta-Llama-3.1-405B-Instruct)
* [google/gemma-2-27b-it](https://cloud.siliconflow.cn/models?target=google/gemma-2-27b-it)
* [google/gemma-2-9b-it](https://cloud.siliconflow.cn/models?target=google/gemma-2-9b-it)
* [Pro/google/gemma-2-9b-it](https://cloud.siliconflow.cn/models?target=Pro/google/gemma-2-9b-it)
* [01-ai/Yi-1.5-34B-Chat-16K](https://cloud.siliconflow.cn/models?target=01-ai/Yi-1.5-34B-Chat-16K)
* [01-ai/Yi-1.5-6B-Chat](https://cloud.siliconflow.cn/models?target=01-ai/Yi-1.5-6B-Chat)
* [01-ai/Yi-1.5-9B-Chat-16K](https://cloud.siliconflow.cn/models?target=01-ai/Yi-1.5-9B-Chat-16K)
* [stabilityai/stable-diffusion-3-medium](https://cloud.siliconflow.cn/models?target=stabilityai/stable-diffusion-3-medium)
如果您有使用上述模型,建议尽快迁移至平台上的其他模型。
### 平台服务调整通知
#### deepseek-ai/DeepSeek-V3 模型的价格于北京时间 2025年2月9日00:00 起恢复至原价
具体价格:
* 输入:¥2/ M Tokens
* 输出:¥8/ M Tokens
### 推理模型输出调整通知
推理模型思维链的展示方式,从之前的 `content` 中的 `` 独立成单独的单独的 `reasoning_content` 字段,兼容 `openai` 和 `deepseek` api 规范,便于各个框架和上层应用在进行多轮会话时进行裁剪。使用方式详见[推理模型(DeepSeek-R1)使用](/capabilities/reasoning)。
### 平台服务调整通知
#### 支持deepseek-ai/DeepSeek-R1和deepseek-ai/DeepSeek-V3模型
具体价格如下:
* `deepseek-ai/DeepSeek-R1` 输入:¥4/ M Tokens 输出:¥16/ M Tokens
* `deepseek-ai/DeepSeek-V3`
* **即日起至北京时间 2025-02-08 24:00 享受限时折扣价**:输入:¥2¥1/ M Tokens 输出:¥8¥2/ M Tokens,2025-02-09 00:00恢复原价。
### 平台服务调整通知
#### 生成图片及视频 URL 有效期调整为 1 小时
为了持续为您提供更先进、优质的技术服务,从 2025 年 1 月 20 日起,大模型生成的图片、视频 URL 有效期将调整为 1 小时。
若您正在使用图片、视频生成服务,请及时做好转存工作,避免因 URL 过期而影响业务。
### 平台服务调整通知
#### LTX-Video 模型即将开始计费通知
为了持续为您提供更先进、优质的技术服务,平台将于 2025 年 1 月 6 日起对 Lightricks/LTX-Video 模型的视频生成请求进行计费,价格为 0.14 元 / 视频。
### 平台服务调整通知
#### 1.新增全局接入 API 端点
新增全局接入API端点:[https://api.siliconflow.com](https://api.siliconflow.com)。如果您在使用源端点 [https://api.siliconflow.cn](https://api.siliconflow.cn) 时遇到网络连接问题,建议切换至新端点尝试。
### 平台服务调整通知
#### 1. 模型下线通知
为了提供更稳定、高质量、可持续的服务,以下模型将于 **2024 年 12 月 19 日**下线:
* [deepseek-ai/DeepSeek-V2-Chat](https://cloud.siliconflow.cn/models?target=deepseek-ai/DeepSeek-V2-Chat)
* [Qwen/Qwen2-72B-Instruct](https://cloud.siliconflow.cn/models?target=Qwen/Qwen2-72B-Instruct)
* [Vendor-A/Qwen/Qwen2-72B-Instruct](https://cloud.siliconflow.cn/models?target=Vendor-A/Qwen/Qwen2-72B-Instruct)
* [OpenGVLab/InternVL2-Llama3-76B](https://cloud.siliconflow.cn/models?target=OpenGVLab/InternVL2-Llama3-76B)
如果您有使用上述模型,建议尽快迁移至平台上的其他模型。
### 平台服务调整通知
#### 1. 模型下线通知
为了提供更稳定、高质量、可持续的服务,以下模型将于 **2024 年 12 月 13 日**下线:
* [Qwen/Qwen2.5-Math-72B-Instruct](https://cloud.siliconflow.cn/models?target=Qwen/Qwen2.5-Math-72B-Instruct)
* [Tencent/Hunyuan-A52B-Instruct](https://cloud.siliconflow.cn/models?target=Tencent/Hunyuan-A52B-Instruct)
* [nvidia/Llama-3.1-Nemotron-70B-Instruct](https://cloud.siliconflow.cn/models?target=nvidia/Llama-3.1-Nemotron-70B-Instruct)
如果您有使用上述模型,建议尽快迁移至平台上的其他模型。
如果您有使用上述模型,建议尽快迁移至平台上的其他模型。
### 平台服务调整通知
#### 1. 模型下线通知
为了提供更稳定、高质量、可持续的服务,以下模型将于 **2024 年 11 月 22 日**下线:
* [deepseek-ai/DeepSeek-Coder-V2-Instruct](https://cloud.siliconflow.cn/models?target=deepseek-ai/DeepSeek-Coder-V2-Instruct)
* [meta-llama/Meta-Llama-3-70B-Instruct](https://cloud.siliconflow.cn/models?target=meta-llama/Meta-Llama-3-70B-Instruct)
* [meta-llama/Meta-Llama-3-8B-Instruct](https://cloud.siliconflow.cn/models?target=meta-llama/Meta-Llama-3-8B-Instruct)
* [Qwen/Qwen2-57B-A14B-Instruct](https://cloud.siliconflow.cn/models?target=Qwen/Qwen2-57B-A14B-Instruct)
* [Pro/internlm/internlm2\_5-7b-chat](https://cloud.siliconflow.cn/models?target=Pro/internlm/internlm2_5-7b-chat)
* [Pro/meta-llama/Meta-Llama-3-8B-Instruct](https://cloud.siliconflow.cn/models?target=Pro/meta-llama/Meta-Llama-3-8B-Instruct)
* [Pro/THUDM/chatglm3-6b](https://cloud.siliconflow.cn/models?target=Pro/THUDM/chatglm3-6b)
* [Pro/01-ai/Yi-1.5-9B-Chat-16K](https://cloud.siliconflow.cn/models?target=Pro/01-ai/Yi-1.5-9B-Chat-16K)
* [Pro/01-ai/Yi-1.5-6B-Chat](https://cloud.siliconflow.cn/models?target=Pro/01-ai/Yi-1.5-6B-Chat)
如果您有使用上述模型,建议尽快迁移至平台上的其他模型。
#### 2.邮箱登录方式更新
为进一步提升服务体验,平台将于 **2024 年 11 月 22 日起**调整登录方式:由原先的“邮箱账户 + 密码”方式更新为“**邮箱账户 + 验证码**”方式。
#### 3. 新增海外 API 端点
新增支持海外用户的平台端点:[https://api-st.siliconflow.cn](https://api-st.siliconflow.cn)。如果您在使用源端点 [https://api.siliconflow.cn](https://api.siliconflow.cn) 时遇到网络连接问题,建议切换至新端点尝试。
### 部分模型计价调整公告
为了提供更加稳定、优质、可持续的服务,[Vendor-A/Qwen/Qwen2-72B-Instruct](https://cloud.siliconflow.cn/models?target=17885302571) 限时免费模型将于 2024 年 10 月 17 日开始计费。计费详情如下:
* 限时折扣价:¥ 1.00 / M tokens
* 原价:¥ 4.13 / M tokens(恢复原价时间另行通知)
# 社区场景与应用
Source: https://docs.siliconflow.cn/cn/usercases/awesome-user-cases
# SiliconCloud 场景与应用案例
将 SiliconCloud 平台大模型能力轻松接入各类场景与应用案例
{/* ### 1. 应用程序集成 */}
{/* */}
{/*
SiliconCloud 团队
SiliconCloud 团队
SiliconCloud 团队
SiliconCloud 团队
*/}
{/*
Cherry Studio 团队
Chatbox 团队
*/}
{/* */}
### 1. 翻译场景使用
SiliconCloud 团队
沧海九粟
ohnny\_Van
mingupup
行歌类楚狂
### 2. 搜索与 RAG 场景使用
MindSearch 团队
LogicAI
白牛
沧海九粟
### 3. 编码场景使用
xDiexsel
野原广志2\_0
### 4. 分析场景使用
行歌类楚狂
### 5. 通讯场景使用
大大大维维
### 6. 生图场景使用
mingupup
baiack
糯.米.鸡
### 7. 使用评测
真知浩见
湖光橘鸦
自牧生
### 8. 开源项目
郭垒
laughing
### 9. 其它
mingupup
郭垒
free-coder
三千酱
# 在 302.AI 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-302ai
## 1 关于 302.AI
302.AI是一个按需付费的AI应用平台,提供丰富的AI在线应用和全面的AI API的接入。
近期302.AI和硅基流动进行了合作,让302.AI的用户可以在302的平台内直接接入硅基流动的所有模型,无需额外充值;也让硅基流动的用户可以在302的平台内直接使用开箱即用的AI应用,无需自己开发或部署。
### 1.1 进入 302.AI 官网或打开客户端
* [官网](https://302.ai/)
* [客户端下载](https://302.ai/download/)
进入后注册账号,如已注册,直接登录即可
## 2 在 302.AI 中配置 SiliconCloud 的模型服务
### 2.1 创建聊天机器人
1. 登录 302.AI 官网或客户端的管理后台,依次点击:\
**使用机器人 → 聊天机器人 → 模型**。
2. 下滑到【硅基流动】,选择模型(如 `deepseek-ai/deepseek-vl2`),点击 **确定 → 创建聊天机器人**。
3. 创建成功后,机器人会在页面下方展示,可进一步选择 **聊天、分享、编辑** 等操作。
#### 2.2 使用聊天机器人
1. 进入聊天机器人,在输入框键入文字即可开始对话。输入框左侧的按钮支持上传图片或文件,根据模型特性选择使用。
2. 点击界面左下角的 **设置**,可开启聊天机器人的 **实时预览功能**,实时查看模型生成代码的运行效果。
#### 2.3 在全能工具箱中使用
除了以上创建聊天机器人的方法,还可以通过 **全能工具箱** 使用 SiliconCloud 模型:
1. 点击 **全能工具箱 → 快捷使用**。
2. 依次点击:\
**聊天机器人 → 应用商店 → 硅基流动**,选择模型后即可开始对话。
### 3. 在模型竞技场使用 SiliconCloud 模型
#### 3.1 创建模型竞技场
在管理后台菜单栏选择: **使用工具 → 工具超市 → 工具效率 → 模型竞技场**, 打开后点击 **创建**。
#### 3.2 选择模型开始竞技
进入模型竞技场后,下滑找到【硅基流动】,并按需勾选模型。勾选完成后,输入提示词即可在页面右侧直观对比不同模型的回答。
### 4. 接入 SiliconCloud 模型的 API
(以语言模型为例)
#### 4.1 查看文档
点击 **API 超市**,在分类中选择 **语言大模型**,找到**硅基流动**。
#### 4.2 在线调试
1. 点击 **查看文档** 即可进入 API 文档。
2. 进入 API 文档后,点击 **在线调试 → 去设置变量值**,确认 API KEY 是否已自动赋值。
3. 根据参数模板填写要使用的 **模型 ID** 和 **文本内容**,点击 **发送**,等待输出结果即可。
# 在 DB-GPT 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-DB-GPT
## 1.关于 DB-GPT
[DB-GPT](https://github.com/eosphoros-ai/DB-GPT) **是一个开源的AI原生数据应用开发框架(AI Native Data App Development framework with AWEL(Agentic Workflow Expression Language) and Agents)。**
目的是构建大模型领域的基础设施,通过开发多模型管理(SMMF)、Text2SQL效果优化、RAG框架以及优化、Multi-Agents框架协作、AWEL(智能体工作流编排)等多种技术能力,让围绕数据库构建大模型应用更简单,更方便。
## 2.获取 API Key
2.1 打开 [SiliconCloud 官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2.2 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 3.部署 DB-GPT
### 3.1 克隆 DB-GPT 源码
```bash
git clone https://github.com/eosphoros-ai/DB-GPT.git
```
### 3.2 创建虚拟环境并安装依赖
```bash
# cd 到 DB-GPT 源码根目录
cd DB-GPT
# DB-GPT 要求python >= 3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
# 这里选择代理模型类依赖安装
pip install -e ".[proxy]"
```
### 3.3 配置基础的环境变量
```bash
# 复制模板 env 文件为 .env
cp .env.template .env
```
### 3.4 修改环境变量文件`.env`,配置 SiliconCloud 模型
```bash
# 使用 SiliconCloud 的代理模型
LLM_MODEL=siliconflow_proxyllm
# 配置具体使用的模型名称
SILICONFLOW_MODEL_VERSION=Qwen/Qwen2.5-Coder-32B-Instruct
SILICONFLOW_API_BASE=https://api.siliconflow.cn/v1
# 记得填写您在步骤2中获取的 API Key
SILICONFLOW_API_KEY={your-siliconflow-api-key}
# 配置使用 SiliconCloud 的 Embedding 模型
EMBEDDING_MODEL=proxy_http_openapi
PROXY_HTTP_OPENAPI_PROXY_SERVER_URL=https://api.siliconflow.cn/v1/embeddings
# 记得填写您在步骤2中获取的 API Key
PROXY_HTTP_OPENAPI_PROXY_API_KEY={your-siliconflow-api-key}
# 配置具体的 Embedding 模型名称
PROXY_HTTP_OPENAPI_PROXY_BACKEND=BAAI/bge-large-zh-v1.5
# 配置使用 SiliconCloud 的 rerank 模型
RERANK_MODEL=rerank_proxy_siliconflow
RERANK_PROXY_SILICONFLOW_PROXY_SERVER_URL=https://api.siliconflow.cn/v1/rerank
# 记得填写您在步骤2中获取的 API Key
RERANK_PROXY_SILICONFLOW_PROXY_API_KEY={your-siliconflow-api-key}
# 配置具体的 rerank 模型名称
RERANK_PROXY_SILICONFLOW_PROXY_BACKEND=BAAI/bge-reranker-v2-m3
```
注意,上述的 `SILICONFLOW_API_KEY`、 `PROXY_HTTP_OPENAPI_PROXY_SERVER_URL` 和`RERANK_PROXY_SILICONFLOW_PROXY_API_KEY`环境变量是您在步骤 2 中获取的 SiliconCloud 的 Api Key。语言模型(`SILICONFLOW_MODEL_VERSION`)、 Embedding 模型(`PROXY_HTTP_OPENAPI_PROXY_BACKEND`)和 rerank 模型(`RERANK_PROXY_SILICONFLOW_PROXY_BACKEND`) 可以从 [获取用户模型列表 - SiliconFlow](https://docs.siliconflow.cn/api-reference/models/get-model-list) 中获取。
### 3.5 启动 DB-GPT 服务
```bash
dbgpt start webserver --port 5670
```
在浏览器打开地址 [http://127.0.0.1:5670/](http://127.0.0.1:5670/) 即可访问部署好的 DB-GPT
## 4.通过 DB-GPT Python SDK 使用 SiliconCloud 的模型
### 4.1 安装 DB-GPT Python 包
```bash
pip install "dbgpt>=0.6.3rc2" openai requests numpy
```
为了后续验证,额外安装相关依赖包。
### 4.2. 使用 SiliconCloud 的大语言模型
```python
import asyncio
import os
from dbgpt.core import ModelRequest
from dbgpt.model.proxy import SiliconFlowLLMClient
model = "Qwen/Qwen2.5-Coder-32B-Instruct"
client = SiliconFlowLLMClient(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_alias=model
)
res = asyncio.run(
client.generate(
ModelRequest(
model=model,
messages=[
{"role": "system", "content": "你是一个乐于助人的 AI 助手。"},
{"role": "human", "content": "你好"},
]
)
)
)
print(res)
```
### 4.3 使用 SiliconCloud 的 Embedding 模型
```python
import os
from dbgpt.rag.embedding import OpenAPIEmbeddings
openai_embeddings = OpenAPIEmbeddings(
api_url="https://api.siliconflow.cn/v1/embeddings",
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-large-zh-v1.5",
)
texts = ["Hello, world!", "How are you?"]
res = openai_embeddings.embed_documents(texts)
print(res)
```
### 4.4 使用 SiliconCloud 的 rerank 模型
```python
import os
from dbgpt.rag.embedding import SiliconFlowRerankEmbeddings
embedding = SiliconFlowRerankEmbeddings(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-reranker-v2-m3",
)
res = embedding.predict("Apple", candidates=["苹果", "香蕉", "水果", "蔬菜"])
print(res)
```
## 5. 上手指南
以数据对话案例为例,数据对话能力是通过自然语言与数据进行对话,目前主要是结构化与半结构化数据的对话,可以辅助做数据分析与洞察。以下为具体操作流程:
### 1. 添加数据源
首先选择左侧数据源添加,添加数据库,目前DB-GPT支持多种数据库类型。选择对应的数据库类型添加即可。这里我们选择的是MySQL作为演示,演示的测试数据参见测试样例([https://github.com/eosphoros-ai/DB-GPT/tree/main/docker/examples/sqls)。](https://github.com/eosphoros-ai/DB-GPT/tree/main/docker/examples/sqls)。)
### 2. 选择对话类型
选择ChatData对话类型。
### 3. 开始数据对话
注意:在对话时,选择对应的模型与数据库。同时DB-GPT也提供了预览模式与编辑模式。
编辑模式:
# 在 Bob 翻译中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-bob
## 1. 关于 Bob
[Bob](https://bobtranslate.com) 是一款 macOS 平台的翻译和 OCR 软件,您可以在任何应用程序中使用 Bob 进行翻译和 OCR,即用即走,简单、快捷、高效!
本文将介绍如何借助 SiliconCloud 提供的 API 服务在 Bob 中进行翻译。
## 2. 安装 Bob
前往 Mac App Store 安装 Bob。[Mac App Store 安装](https://apps.apple.com/cn/app/id1630034110)
## 3. 在 Bob 中使用 SiliconCloud
### 3.1 默认配置
安装完 Bob 之后,在任意软件选中一段文本,然后按下 `⌥` `D` 快捷键即可翻译,SiliconCloud 的免费模型会作为默认翻译服务进行翻译,如下图所示。
### 3.2 使用 SiliconCloud 的其他免费模型
默认使用的模型是 `Qwen/Qwen2.5-7B-Instruct`,可以使用**鼠标右键**点击翻译窗口右上角的服务图标前往「翻译-服务」页面切换其他免费模型。
如下图所示,标注为**免费**的模型均可直接使用。
### 3.3 使用 SiliconCloud 的其他文本生成模型
如需使用没有标注为免费的模型,需要自行获取 SiliconCloud API Key。
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开 [API 密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
3. 进入之前提到的 Bob「翻译-服务」页面,将 API Key 填入**硅基流动翻译**服务的 API Key 设置项中,然后切换到需要使用的其他模型,点击保存即可使用。
# 在 Chatbox 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-chatbox
## 1 关于 Chatbox
Chatbox 是一个流行的大语言模型的全平台聊天客户端,特点是功能强大、安装简单。你可以用它接入各种大语言模型,然后在任何设备(电脑、手机、网页)上和 AI 聊天。
Chatbox 不仅提供简单好用的 AI 聊天功能,还提供了一系列强大功能:
* Artifact 预览:在 Chatbox 中你可以预览 AI 生成代码的实际效果,比如让 AI 帮你做一个网页、贪吃蛇游戏,然后在 Chatbox 中直接运行。
* 图表制作:让 AI 绘制思维导图、流程图、统计图表
* 文档理解和图形视觉:可以向 AI 发送文档或者图片
-网页解析与识别:可以向 AI 发送链接,讨论网页内容等
## 2 安装使用 Chatbox
浏览器访问 [Chatbox 官网](https://chatboxai.app/)下载安装包。
Chatbox 支持所有的主流操作系统,包括 Windows、MacOS 和 Linux,手机系统支持 iOS 和 Android。下载安装包后,在系统中直接安装即可。或者也可以访问和使用 Chatbox 的网页版本。
## 3 在 Chatbox 中使用 SiliconCloud 模型
### 3.1 配置 SiliconCloud API 密钥
访问[API 密钥](https://cloud.siliconflow.cn/account/ak)新建或复制已有密钥。
### 3.2 在 Chatbox 中配置
#### 3.2.1 打开 Chatbox,进入设置
#### 3.2.2 创建自定义模型提供方
先点击“模型提供方”切换按钮,在弹出菜单的底部点击“添加自定义提供方”
#### 3.2.3 配置 SiliconCloud 的接入信息
请在打开的表单中填写 SiliconCloud 的接入配置即可:
* 名称(比如可以是 SiliconCloud,方面后续使用区分)
* API 域名填写:[https://api.siliconflow.cn/](https://api.siliconflow.cn/)
* API 路径填写:/v1/chat/completions
* API 密钥:填写在 SiliconCloud 后台新建的 API 密钥
* 在模型输入框添加你需要使用的模型(比如 Qwen/Qwen2.5-7B-Instruct),你可以在[模型广场](https://cloud.siliconflow.cn/models)找到 SiliconCloud 所有模型选项
* 点击保存,即可开始聊天
### 3.2.4 开始聊天
按照上面步骤,基本上已经配置成功了,简单聊天测试一下。
### 3.3 使用技巧
在结尾这里在顺带介绍一些 Chatbox 的使用技巧。
#### 3.3.1 利用 Chatbox 的图表能力,在聊天中生成可视化图表
Chatbox 的“做图表”助手会生成各种图表,在聊天中可以更方便地让你理解一些数据。
注意:为了更好的效果,需要选择更聪明更强大的模型。模型能力将直接决定图表的效果。
#### 3.3.2 利用 Chatbox 的 Artifact 预览功能,查看 AI 生成代码的运行效果
Chatbox 的 Artifact 预览功能,则可以让你直接预览 AI 生成前端代码的实际运行效果。
注意:为了更好的效果,需要选择更聪明更强大的模型。模型能力将直接决定生成代码的效果。
除了这些技巧外,在 Chatbox 简单易用的外表下,还隐藏着非常多强大的功能,有很多值得探索的地方。
## 4 参考资料
* [Chatbox 官网](https://chatboxai.app/)
* [如何在 Chatbox 中接入 SiliconCloud - 超简单完整教程](https://bennhuang.com/posts/chatbox-siliconcloud-integration-guide/)
# 在 ChatHub 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-chathub
## 关于 ChatHub
[ChatHub](https://chathub.gg/zh) 是一个流行的大语言模型聚合插件,特点是可以同时和多个模型聊天,方便对比回答。ChatHub 在全球拥有数十万活跃用户。
## 安装 ChatHub
浏览器打开 [ChatHub 官网](https://chathub.gg/zh),点击“新增至Chrome”按钮安装 ChatHub 浏览器插件:
安装后,将自动打开 ChatHub 设置页面.
## 在ChatHub中使用SiliconCloud模型
1、在 ChatHub 设置中找到“自定义机器人”模块,点击“添加”按钮
2、在弹窗中,依次:
1. 输入机器人名称
2. 选择 SiliconFlow 作为提供方
3. 输入 SiliconFlow 密钥
4. 填写 SiliconFlow 支持的任何模型
3、点击“确认”后模型即配置成功
4、开始聊天
## 在 ChatHub 中进行多模型对比
你可以重复上面的步骤在 ChatHub 添加其他模型,然后你就可以使用 ChatHub 的 All-in-One 功能同时和多个模型聊天(最多可以同时和 6 个模型对话):
除了核心的对比功能外,ChatHub 还有提示词库、代码预览等强大的功能,可以在 [ChatHub 官方文档](https://doc.chathub.gg/introduction)了解更多。
# 在 Cherry Studio 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-cherry-studio
## 1 关于 Cherry Studio
开发者可以打开 [Github](https://github.com/kangfenmao/cherry-studio) 项目链接点亮 ⭐️ 来支持开源项目
🍒 Cherry Studio 是一款支持多模型服务的桌面客户端,内置了超过 30 个行业的智能助手,旨在帮助用户在多种场景下提升工作效率。它适用于 Windows、Mac 和 Linux 系统,无需复杂设置即可使用。
🚀 Cherry Studio 集成了主流的 LLM 云服务和 AI Web 服务,同时支持本地模型运行。
🌟 Cherry Studio 提供了诸如完整的 Markdown 渲染、智能体创建、翻译功能、文件上传和多模态对话等个性化功能,并具有友好的界面设计和灵活的主题选项,旨在为用户提供全面而高效的 AI 交互体验。
### 1.1 下载 Cherry Studio
* [官网下载](https://cherry-ai.com/)
* [开源下载](https://github.com/kangfenmao/cherry-studio/releases/latest)
### 1.2 安装教程
* [Windows 安装](https://cherry-ai.com/docs/windows-install)
* [macOS 安装](https://cherry-ai.com/docs/mac-install)
## 2. 配置 SiliconCloud 的模型服务
### 2.1 点击左下角的设置,在模型服务中选择【硅基流动】
### 2.2 点击链接获取 SiliconCloud API 密钥
1. 登录[SiliconCloud](https://cloud.siliconflow.cn)(若未注册首次登录会自动注册账号)
2. 访问[API 密钥](https://cloud.siliconflow.cn/account/ak)新建或复制已有密钥
{/* [cherry-studio-api-key](/images/usercases/cherry-studio/cherry-studio-2-api-key.png) */}
### 2.3 点击管理添加模型
### 2.4 添加嵌入模型
1. 在模型管理服务中查找模型,可以点击“嵌入模型”快速筛选;
2. 找到需要的模型,添加到我的模型。
## 3. 模型服务使用
### 3.1 使用语言模型服务聊天
1. 点击左侧菜单栏的“对话”按钮
2. 在输入框内输入文字即可开始聊天
3. 可以选择顶部菜单中的模型名字切换模型
### 3.2 使用嵌入模型服务创建知识库并使用
#### 3.2.1 创建知识库
1. 知识库入口:在 CherryStudio左侧工具栏,点击知识库图标,即可进入管理页面;
2. 添加知识库:点击添加,开始创建知识库;
3. 命名:输入知识库的名称并添加嵌入模型,以 bge-m3为例,即可完成创建。
#### 3.2.2 添加文件并向量化
1. 添加文件:点击添加文件的按钮,打开文件选择;
2. 选择文件:选择支持的文件格式,如 pdf,docx,pptx,xlsx,txt,md,mdx 等,并打开;
3. 向量化:系统会自动进行向量化处理,当显示完成时(绿色✓),代表向量化已完成。
#### 3.2.3 添加多种来源的数据
CherryStudio 支持多种添加数据的方式:
1. 文件夹目录:可以添加整个文件夹目录,该目录下支持格式的文件会被自动向量化;
2. 网址链接:支持网址 url,如[https://docs.siliconflow.cn/introduction](https://docs.siliconflow.cn/introduction);
3. 站点地图:支持 xml 格式的站点地图,如[https://docs.siliconflow.cn/sitemap.xml](https://docs.siliconflow.cn/sitemap.xml);
4. 纯文本笔记:支持输入纯文本的自定义内容。
#### 3.2.4 搜索知识库
当文件等资料向量化完成后,即可进行查询:
1. 点击页面下方的搜索知识库按钮;
2. 输入查询的内容;
3. 呈现搜索的结果;
4. 并显示该条结果的匹配分数。
#### 3.2.5 对话中引用知识库生成回复
1. 创建一个新的话题,在对话工具栏中,点击知识库,会展开已经创建的知识库列表,选择需要引用的知识库;
2. 输入并发送问题,模型即返回通过检索结果生成的答案 ;
3. 同时,引用的数据来源会附在答案下方,可快捷查看源文件。
# 在 Cline 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-cline
## 1. 安装 Cline
[安装地址](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev)
## 2. 打开cline
在VSCode中,通过 Ctrl/Command+Shift+P 打开命令工具,在新 tab 中打开 Cline 进行配置
## 3. 在新窗口中进行配置
1. API Provider:选择 “OpenAI Compatible”
2. Base Url:[https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
3. API Key:从 [https://cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak) 中获取
4. Model ID:从 [https://cloud.siliconflow.cn/models](https://cloud.siliconflow.cn/models) 中获取
## 4. 开始使用
# 在麦悠电台中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-cube-sugar-studio
麦悠电台(my.ft07.com)是独立开发者方糖开发的一款独具特色的 AI 电台 App,借助 AI 大模型为你打造专属播客。
通过与 RSS Hub、Wewe-rss 订阅器的配合,麦悠电台用户可在麦悠电台订阅上千个媒体平台和微信公众号来获取资讯。电台支持本地/云端 TTS 合成,可自由选择多种 AI 音效。在电台中生成的播客还支持分享、导出音频/视频格式,为内容创作者提供了极大便利。
本文将介绍如何借助 SiliconCloud 提供的 API 服务,在麦悠电台创建你的个性化播客节目。
## 1. 获取 API Key
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 2. 在 Sider 中使用 SiliconCloud 语言模型系列
### 2.1 下载安装麦悠电台
IOS 用户可打开苹果商店进行搜索安装。Android 用户可[下载 APK](https://the7.ft07.com/Maidio/maidio-byok-1.0.9-b29.apk) 安装。
### 2.2 配置 SiliconCloud 的 API 服务
打开麦悠电台 App 首页,点击左上角任务栏中的“设置”,在“AI 设置”中粘贴从 SiliconCloud 获取的 API Key,保存设置,就可以使用 SiliconCloud 上的相应模型了。
### 2.3 设置语音
1. 点击顶部导航栏的“语音”标签,在“本地语音”页面选择主持人和助理的语音引擎,调整语速、音调和音量,点击“声音”按钮可以试听效果。
Android 系统,请先在系统设置中安装中文语音包,推荐使用小米和 Google 的语音引擎,选择合适的中文语音。
如iOS 系统,进入设置→辅助功能→朗读所选内容→声音→中文→月/瀚→下载高质量语音,重启应用,即可在本地 TTS 中选择使用 Yue/Han 的高质量语音。
2. 接入 SiliconCloud 提供的 API Key 后,通过平台的音频模型 `fishaudio/fish-speech-1.5`,用户可以进一步测试 "云端语音",享受 8 种开箱即用预置音色。
{/* */}
### 2.4 创建电台,获取新闻
1. 点击主界面右上角的“+”按钮,自定义电台名称,添加 RSS 订阅源,直接输入 RSS 地址(每行一个)或导入 OPML 文件。
2. 在主界面点击电台右侧的 RSS 图标,点击右上角的刷新按钮,获取最新内容,等待新闻加载完成。
### 2.5 生成节目,收听节目
1. 在新闻列表中选择感兴趣的新闻,点击底部的”创建节目”按钮,根据自己的兴趣选择新闻喜好(分为详细、摘要、略过、原文四个选项),等待 AI 生成对话内容。
2. 返回主界面,点击电台右侧的播放按钮,即可享受 AI 主持人为你播报定制化的新闻内容。
{/* */}
### 3. 总结
如果你想开发一个麦悠电台这样的 AI 应用,想快速地测试各类大模型效果或让用户使用高性价比的模型服务,可以选择接入 SiliconCloud 的 API 模型进行快速体验。
# 在 Deep Research 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-deep-research
## 1. 介绍
Deep Research Web UI 是一个由人工智能驱动的研究助手,通过结合搜索引擎、网络抓取和大语言模型,可以让 AI 根据某个问题自己搜索资料并且不断深挖,最后输出一份研究报告。
本项目的特性:
* 💰 **低成本**:可以用很低的成本实现类似 ChatGPT、Perplexity、秘塔等产品的“深度研究”效果
* 🚀 **隐私安全**:所有配置和 API 请求均在浏览器端完成,并且可以自部署
* 🕙 **实时反馈**:流式传输 AI 响应并在界面实时展示
* 🌳 **搜索可视化**:使用树状结构展示研究过程,支持使用英文搜索词
* 📄 **支持导出 PDF**:将最终研究报告导出为 Markdown 和 PDF 格式
* 🤖 **多模型支持**:底层使用纯提示词而非结构化输出等新特性,兼容更多大模型供应商
项目开源地址: [GitHub](https://github.com/AnotiaWang/deep-research-web-ui)
## 2. 如何使用
打开 [Deep Research Web UI 官网](https://deep-research.ataw.top),点击右上角的“⚙️”按钮打开设置弹窗。
### 2.1 配置 AI 大模型服务
1. 在硅基流动官网注册或者登录一个账号。
2. 在 [API 密钥](https://cloud.siliconflow.cn/account/ak)中生成一个新的 API key,然后复制一下。
3. 回到 Deep Research 网页,在设置的 AI 服务部分,选择“SiliconFlow 硅基流动”,在“API 密钥”一栏里粘贴刚才生成的 API key。
4. 在“模型名称”一栏,点击右侧的下拉按钮(也可以在输入框里输入模型名称来筛选),选择想要使用的模型。
5. (可选)设置上下文长度:如果要做大规模的研究,建议配置“上下文长度”选项,不要超过所选模型的最大上下文长度,避免请求失败。
### 2.2 配置联网搜索模型
目前支持 Tavily 和 Firecrawl,后续会增加支持更多搜索服务。这里我们选择 Tavily,因为它提供了每月 1000 次的免费搜索,足够大部分场景使用。
1. 在 [Tavily 官网](https://app.tavily.com/home)注册一个账号。然后在控制台里新建一个 API key 并复制。
* Key Name 可以填写 Deep Research。
* Key Type 根据你的使用情况决定,如果是轻度使用,可以选择“Development”;重度使用则选择“Production”,支持更高的请求频率。
* 注意保管好 API key 不要泄露。
2. 回到 Deep Research 网页,在设置的“联网搜索服务”部分,选择 “Tavily”;在“API 密钥”一栏填写刚才生成的 API key。
3. (可选)设置搜索时使用的语言。AI 模型默认会使用你网页的当前语言来搜索和回复,不过如果你想用英文搜索词来查找更高质量的资料,可以把“使用语言”设置成 English。
这样就设置完毕,可以开始使用了!
### 3. 开始使用
本项目在每一步都做了说明,力求降低使用门槛。可以用它来查找第一手资料、了解自己感兴趣的话题、查找新闻并汇总等等。例如,查找一下 NVIDIA RTX 50 系列显卡的信息:
本项目正在活跃更新中,如果遇到问题可以前往 [GitHub 仓库](https://github.com/AnotiaWang/deep-research-web-ui)反馈。
# 在 Dify 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-dify
结合 SiliconCloud 模型多,速度快的优势,在 Dify 中快速实现工作流/Agent
## 1. 获取 API Key
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 2. 在 Dify 中使用 SiliconCloud 语言模型系列
### 2.1 调用 Dify 中内置的 SiliconCloud 模型的 API
1. 打开 SiliconCloud 官网 并注册账号(如果注册过,直接登录即可)。 完成注册后,打开 API 密钥 ,创建新的 API Key,点击密钥进行复制,以备后续使用。
2. 在 Dify 首页右上角选择“设置”,选择左上角“模型供应商”。
3. 找到“ SiliconCloud ”,粘贴先前在 SiliconCloud 平台复制的 API Key,然后点击“保存”按钮。
4. 校验成功后可以在模型提供商的顶部区域看到 SiliconCloud 提供的模型,并在应用中使用 SiliconCloud 模型。
### 2.2 使用目前不在 Dify 源代码中的 SiliconCloud 模型
1. 打开 Dify 的“ Settings ”进行设置。
2. 选择导航栏“ Model Provider ”,添加兼容 OpenAI 接口的模型服务平台。
3. 在其中设置对应的 SiliconCloud 对应的 Model Name 、 API Key 、 API 端点。
* **Model Name:** 从[model-list](/api-reference/models/get-model-list) 文档中选择
* **API Key:** 从[https://cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak) 中获取,请注意,如果您需要使用海外模型,请先进行实名认证
* **API 端点 URL:** [https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
4. 设置完成后,可以在模型列表中看到上述新增的模型。
## 3. 在 Dify 中使用 SiliconCloud 生图模型系列
参考[在 Dify 中使用 SiliconCloud 生图模型系列](https://docs.dify.ai/zh-hans/guides/tools/tool-configuration/siliconflow)
# 在 FastGPT 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-fastgpt
本文转载自 [FastGPT](https://fastgpt.run) 的官方文档,介绍了如何在 FastGPT 中使用 SiliconCloud 的模型。[原文地址](https://doc.tryfastgpt.ai/docs/development/modelconfig/one-api/)
[SiliconCloud(硅基流动)](https://cloud.siliconflow.cn/i/TR9Ym0c4) 是一个以提供开源模型调用为主的平台,并拥有自己的加速引擎。帮助用户低成本、快速的进行开源模型的测试和使用。实际体验下来,他们家模型的速度和稳定性都非常不错,并且种类丰富,覆盖语言、向量、重排、TTS、STT、绘图、视频生成模型,可以满足 FastGPT 中所有模型需求。
如果你想部分模型使用 SiliconCloud 的模型,可额外参考[OneAPI接入硅基流动](https://doc.tryfastgpt.ai/docs/development/modelconfig/one-api/#%E7%A1%85%E5%9F%BA%E6%B5%81%E5%8A%A8--%E5%BC%80%E6%BA%90%E6%A8%A1%E5%9E%8B%E5%A4%A7%E5%90%88%E9%9B%86)。
本文会介绍完全使用 SiliconCloud 模型来部署 FastGPT 的方案。
## 1. 注册 SiliconCloud 账号
1. [点击注册硅基流动账号](https://cloud.siliconflow.cn/i/TR9Ym0c4)
2. 进入控制台,获取 API key: [https://cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak)
## 2. 修改 FastGPT 环境变量
```bash
OPENAI_BASE_URL=https://api.siliconflow.cn/v1
# 填写 SiliconCloud 控制台提供的 Api Key
CHAT_API_KEY=sk-xxxxxx
```
## 3. 修改 FastGPT 配置文件
我们选取 SiliconCloud 中的模型作为 FastGPT 配置。这里配置了 `Qwen2.5 72b` 的纯语言和视觉模型;选择 `bge-m3` 作为向量模型;选择 `bge-reranker-v2-m3` 作为重排模型。选择 `fish-speech-1.5` 作为语音模型;选择 `SenseVoiceSmall` 作为语音输入模型。
注意:ReRank 模型仍需配置一次 Api Key
```json
{
"llmModels": [
{
"provider": "Other", // 模型提供商,主要用于分类展示,目前已经内置提供商包括:https://github.com/labring/FastGPT/blob/main/packages/global/core/ai/provider.ts, 可 pr 提供新的提供商,或直接填写 Other
"model": "Qwen/Qwen2.5-72B-Instruct", // 模型名(对应OneAPI中渠道的模型名)
"name": "Qwen2.5-72B-Instruct", // 模型别名
"maxContext": 32000, // 最大上下文
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 30000, // 最大引用内容
"maxTemperature": 1, // 最大温度
"charsPointsPrice": 0, // n积分/1k token(商业版)
"censor": false, // 是否开启敏感校验(商业版)
"vision": false, // 是否支持图片输入
"datasetProcess": true, // 是否设置为文本理解模型(QA),务必保证至少有一个为true,否则知识库会报错
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
"usedInQueryExtension": true, // 是否用于问题优化(务必保证至少有一个为true)
"toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。)
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式)
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
"customExtractPrompt": "", // 自定义内容提取提示词
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
"defaultConfig": {}, // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p)
"fieldMap": {} // 字段映射(o1 模型需要把 max_tokens 映射为 max_completion_tokens)
},
{
"provider": "Other",
"model": "Qwen/Qwen2-VL-72B-Instruct",
"name": "Qwen2-VL-72B-Instruct",
"maxContext": 32000,
"maxResponse": 4000,
"quoteMaxToken": 30000,
"maxTemperature": 1,
"charsPointsPrice": 0,
"censor": false,
"vision": true,
"datasetProcess": false,
"usedInClassify": false,
"usedInExtractFields": false,
"usedInToolCall": false,
"usedInQueryExtension": false,
"toolChoice": false,
"functionCall": false,
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"defaultConfig": {}
}
],
"vectorModels": [
{
"provider": "Other",
"model": "Pro/BAAI/bge-m3",
"name": "Pro/BAAI/bge-m3",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 5000,
"weight": 100
}
],
"reRankModels": [
{
"model": "BAAI/bge-reranker-v2-m3", // 这里的model需要对应 siliconflow 的模型名
"name": "BAAI/bge-reranker-v2-m3",
"requestUrl": "https://api.siliconflow.cn/v1/rerank",
"requestAuth": "siliconflow 上申请的 key"
}
],
"audioSpeechModels": [
{
"model": "fishaudio/fish-speech-1.5",
"name": "fish-speech-1.5",
"voices": [
{
"label": "fish-alex",
"value": "fishaudio/fish-speech-1.5:alex",
"bufferId": "fish-alex"
},
{
"label": "fish-anna",
"value": "fishaudio/fish-speech-1.5:anna",
"bufferId": "fish-anna"
},
{
"label": "fish-bella",
"value": "fishaudio/fish-speech-1.5:bella",
"bufferId": "fish-bella"
},
{
"label": "fish-benjamin",
"value": "fishaudio/fish-speech-1.5:benjamin",
"bufferId": "fish-benjamin"
},
{
"label": "fish-charles",
"value": "fishaudio/fish-speech-1.5:charles",
"bufferId": "fish-charles"
},
{
"label": "fish-claire",
"value": "fishaudio/fish-speech-1.5:claire",
"bufferId": "fish-claire"
},
{
"label": "fish-david",
"value": "fishaudio/fish-speech-1.5:david",
"bufferId": "fish-david"
},
{
"label": "fish-diana",
"value": "fishaudio/fish-speech-1.5:diana",
"bufferId": "fish-diana"
}
]
}
],
"whisperModel": {
"model": "FunAudioLLM/SenseVoiceSmall",
"name": "SenseVoiceSmall",
"charsPointsPrice": 0
}
}
```
## 4. 重启 FastGPT
## 5. 体验测试
### 测试对话和图片识别
随便新建一个简易应用,选择对应模型,并开启图片上传后进行测试:
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
可以看到,72B 的模型,性能还是非常快的,这要是本地没几个 4090,不说配置环境,输出怕都要 30s 了。
### 测试知识库导入和知识库问答
新建一个知识库(由于只配置了一个向量模型,页面上不会展示向量模型选择)
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
导入本地文件,直接选择文件,然后一路下一步即可。79 个索引,大概花了 20s 的时间就完成了。现在我们去测试一下知识库问答。
首先回到我们刚创建的应用,选择知识库,调整一下参数后即可开始对话:
| | | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |  |
对话完成后,点击底部的引用,可以查看引用详情,同时可以看到具体的检索和重排得分:
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
### 测试语音播放
继续在刚刚的应用中,左侧配置中找到语音播放,点击后可以从弹窗中选择语音模型,并进行试听:

### 测试语言输入
继续在刚刚的应用中,左侧配置中找到语音输入,点击后可以从弹窗中开启语言输入

开启后,对话输入框中,会增加一个话筒的图标,点击可进行语音输入:
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
## 总结
如果你想快速的体验开源模型或者快速的使用 FastGPT,不想在不同服务商申请各类 Api Key,那么可以选择 SiliconCloud 的模型先进行快速体验。
如果你决定未来私有化部署模型和 FastGPT,前期可通过 SiliconCloud 进行测试验证,后期再进行硬件采购,减少 POC 时间和成本。
# 在沉浸式翻译中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-immersive-translate
在沉浸式翻译中,调用 SiliconCloud 的 API,实现快速跨语言翻译的目标
作为全网口碑炸裂的双语对照网页翻译插件,[沉浸式翻译](https://immersivetranslate.com/)使用大语言模型,具备跨语种理解能力,能够实时翻译外语内容,可应用于网页阅读、 PDF 翻译、 EPUB 电子书翻译、视频双语字幕翻译等场景,并支持各种浏览器插件和应用使用。自 2023 年上线以来,这款备受赞誉的 AI 双语对照网页翻译插件,已帮助超过 100 万用户跨越语言障碍,汲取全球智慧。
硅基流动的 SiliconCloud 第一时间提供 GLM4 、 Qwen2 、 DeepSeek V2 、零一万物等大模型,将三方大模型和沉浸式翻译插件相结合,极大改善翻译时的速度和准确度。
## 1. 获取 API Key
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 2. 在沉浸式翻译中使用 SiliconCloud
### 2.1 默认配置
1. 在“沉浸式翻译”[官网](https://immersivetranslate.com/zh-Hans/)选择“安装浏览器插件”,选择合适的浏览器版本,根据提示进行安装。如您已安装对应插件,请跳过本步骤。
2. 点击沉浸式翻译拓展,点击设置,出现弹窗,将弹窗中的“翻译服务”设置为“ SiliconCloud 翻译”
3. 设置成功后即可开始使用 SiliconCloud 翻译服务。
### 2.2 使用 SiliconCloud 的其他免费模型:
1. 设置的默认模型是 SiliconCloud 的“ Qwen/Qwen2-7B-Instruct ”,如果需要切换成 SiliconCloud 的其他模型,请点击图标中的“设置”,打开设置界面。
2. 在“基本设置”中选择其他模型,即可使用 SiliconCloud 的其他免费模型。
### 2.3 使用 SiliconCloud 的其他文本生成模型:
1. 如需使用 SiliconCloud 其他模型,点击沉浸式翻译的扩展图标,找到“设置”按钮并点击,选择“更多翻译服务”。
2. 代开设置页后点击“翻译服务”,划到底部,点击`添加兼容 Open AI 接口的自定义 AI 翻译服务?`。
3.根据要求添加 SiliconCloud 模型的相关信息
* **自定义翻译服务名称:** 按照自己的实际情况填写即可。
* **自定义 API 接口地址:** [https://api.siliconflow.cn/v1/chat/completions](https://api.siliconflow.cn/v1/chat/completions)
* **API Key:** 将 SiliconCloud 平台的密钥粘贴到此处。
* **模型名称:** 模型在 SiliconCloud 中的名称
3. 完成配置后,点击右上角的测试,进行验证。
4. 配置成功后即可开始使用其他文本生成大模型。
# 在 MindSearch 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-mindsearch
## 1. 获取 API Key
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 2. 部署MindSearch
1. 复制 MindSearch 到本地并安装相关依赖后(参考 [https://github.com/InternLM/MindSearch/blob/main/README.md)](https://github.com/InternLM/MindSearch/blob/main/README.md)) ,
2. 修改:
`/path/to/MindSearch/mindsearch/models.py`
3. 加上调用硅基流动 API 的相关配置。配置如下:
```
internlm_silicon = dict(type=GPTAPI,
model_type='internlm/internlm2_5-7b-chat',
key=os.environ.get('SILICON_API_KEY', 'YOUR SILICON API KEY'),
openai_api_base='https://api.siliconflow.cn/v1/chat/completions',
meta_template=[
dict(role='system', api_role='system'),
dict(role='user', api_role='user'),
dict(role='assistant', api_role='assistant'),
dict(role='environment', api_role='system')
],
top_p=0.8,
top_k=1,
temperature=0,
max_new_tokens=8192,
repetition_penalty=1.02,
stop_words=['<|im_end|>'])
```
加入这段配置后,可以执行相关指令来启动 MindSearch。
4. 启动后端:
```
# 指定硅基流动的 API Key
export SILICON_API_KEY=上面流程中复制的密钥
# 启动
python -m mindsearch.app --lang en --model_format internlm_silicon --search_engine DuckDuckGoSearch
```
5. 启动前端。这里以gradio前端为例,其他前端启动可以参考MindSearch的README:
`python frontend/mindsearch_gradio.py`
## 3. 上传到 HuggingFace Space
我们也可以选择部署到 HuggingFace 的 Space 当中。
1. 在 [https://huggingface.co/new-space](https://huggingface.co/new-space) 创建一个新的Space,
配置为:
Gradio
Template:Blank
Hardware:CPU basic·2 vCPU·16GB·FREE
2. 创建成功后,进入" Settings "设置 API Key。
3. 把第二步中的 MindSearch 目录、requirements.txt 和一个 app.py 一并上传。
app.py 详细内容请参考:[https://huggingface.co/spaces/SmartFlowAI/MindSearch\_X\_SiliconFlow/blob/main/app.py](https://huggingface.co/spaces/SmartFlowAI/MindSearch_X_SiliconFlow/blob/main/app.py)
# 在 NextChat 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-nextchat
## 1. 获取 API Key
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 2. 部署 NextChat
访问[ NextChat ](https://app.nextchat.dev/)官网,或者本地安装[ ChatGPT-Next-Web ](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web)之后:
1. 点击页面左下角的“设置”按钮
2. 找到其中的“自定义接口”选项并选中
3. 填入参数:
* **接口地址:** [https://api.siliconflow.cn](https://api.siliconflow.cn)
* **API Key:** 输入“ API 密钥页签 ”生成的 API Key 并填入“自定义模型名”和“模型( model )”
其它自定义模型名可以在 [https://docs.siliconflow.cn/api-reference/chat-completions/chat-completions](https://docs.siliconflow.cn/api-reference/chat-completions/chat-completions) 中查找
# 在 Obsidian Copilot 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-obsidian
Obsidian Copilot 是一款开源的 AI 助手插件,设计简洁,使用方便。用户可通过自带的 API 密钥或本地模型与多种模型交互。支持自定义提示,快速与整个笔记库对话,获取答案和见解。旨在成为注重隐私的终极 AI 助手,深入理解您的个人知识库。
如何在 Obsidian 中使用 SiliconCloud 模型呢?
## 1. 获取 API Key
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 2. 在 Obsidian Copilot 中使用 SiliconCloud 语言模型系列
### 2.1 安装 Obsidian Copilot
1. 安装 Obsidian 应用,详见[Obsidian 官网](https://obsidian.md/)
2. 在 Obsidian 中安装 Copilot 插件:
### 2.2 在 Obsidian Copilot中配置 SiliconCloud 模型
#### 2.2.1 设置 LLM 模型
* 模型: [SiliconCloud 平台 LLM 列表](https://cloud.siliconflow.cn/models?types=chat)
* Provider: 3rd party (openai-format)
* Base URL: [https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
* API Key: [获取 API Key](use-siliconcloud-in-obsidian#1-api-key)
#### 2.2.2 设置 Embedding 模型
* 模型: 详见 [SiliconCloud 平台 Embedding 列表](https://cloud.siliconflow.cn/models?types=embedding)
* Provider: 3rd party (openai-format)
* Base URL: [https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
* API Key: [获取 API Key](use-siliconcloud-in-obsidian#1-api-key)
#### 2.2.3 加载配置
### 2.3 在 Obsidian Copilot中使用 SiliconCloud 模型
接下来就可以基于 SiliconCloud 模型和本地知识库进行检索和问答了。
# 在轻流无代码开发平台中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-qingflow
## 1. 关于轻流
[轻流](https://qingflow.com)是一款领先的无代码开发平台,致力于为企业提供便捷、高效、智能的业务系统搭建工具。通过轻流平台,企业用户无需编写复杂代码即可快速构建个性化业务应用,轻松实现业务流程的自动化与智能化!
本文将介绍如何借助 SiliconCloud 提供的 API 服务在轻流中快捷使用,赋能企业业务系统。
## 2. 使用轻流
无需下载安装,前往轻流官网,注册即可使用。[注册入口](https://qingflow.com/passport/register)
## 3. 在轻流中使用 SiliconCloud 连接器
### 3.1 订阅连接器
注册轻流之后,进入工作区点击“更多”-“轻商城”进入轻流连接中心,点击“硅基流动”,点击“订阅”,如下图所示。
### 3.2 在业务系统中使用硅基流动连接器
在应用中插入“Q-Linker”字段,配置模式选择“使用连接中心模板”“硅基流动”后,即可选择你所需要的AI大模型;发布后即可投入使用。
值得注意的是,在轻流平台使用硅基流动提供的大模型服务时,无需额外填写自己的 API key,轻流平台已自动配置与硅基流动账户的对接,大家可以轻松享受便捷的服务接入体验。
# 在 Sider 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-sider
作为 2023 年度 “Chrome 年度精选插件”,Sider 获得了 50K+ “5星好评”,并有 6+百万 的活跃用户。Sider 浏览器插件主要解决:
* Sider(ChatGPT 侧边栏)是您有用的人工智能助手,您可以在浏览任何网站时使用它。
* Sider 帮助您在所有网站的侧边栏中阅读和撰写文章。它支持 GPT-4o mini/GPT-4o 模型、智能互联网访问、YouTube 摘要、ChatPDF、AI 绘画,以及与 ChatGPT、Claude、Gemini 和 Llama 的 AI 聊天机器人!
开发者可以打开 [Sider官网](https://sider.ai/zh-CN/) 来使用 Sider 应用。 Sider 为满足软件开发者的需求,提供了 OpenAI API的兼容模型注册方式,以便大家可以更加便利的使用大家想要的模型。 作为集合顶尖大模型的一站式云服务平台,SiliconCloud 致力于为开发者提供更快、更便宜、更全面、体验更丝滑的模型API。
那么怎么在 Sider 中使用 SiliconCloud 呢?
## 1. 获取 API Key
1. 打开 SiliconCloud [官网](https://cloud.siliconflow.cn/) 并注册账号(如果注册过,直接登录即可)。
2. 完成注册后,打开[API密钥](https://cloud.siliconflow.cn/account/ak) ,创建新的 API Key,点击密钥进行复制,以备后续使用。
## 2. 在 Sider 中使用 SiliconCloud 语言模型系列
按照下图操作即可
# 在 ToMemo 中使用
Source: https://docs.siliconflow.cn/cn/usercases/use-siliconcloud-in-tomemo
## 添加 SiliconFlow 供应商
进入添加页面后,直接点击「供应商」选项,在里面选择 SiliconFlow (硅基流动),此时,会自动填入名称、Base URL 和接口类型。
## 从 SiliconFlow 获取 API Key
SiliconFlow 的 API Key 获取地址:[点击打开 ](https://cloud.siliconflow.cn/account/ak)
点击后,完成登录,进入到下面所展示的页面。
点击「创建API密钥」按钮,逐步完成创建。
需要**拷贝 API 密钥**, 并妥善保管。
### 拉取模型
将上面获取的 API Key,填入到当前页面的 API Key 输入框中。
点击「拉取模型」按钮,会自动拉取模型。
然后选择需要加载的模型,最后点击「保存」按钮,完成 SiliconFlow 的集成。
💡
**Tip**
需要选择文字生成模型,应用暂时不支持图片输入和输出。
## 添加单词助理 🤓
进入「AI助手」页面,开始添加 AI 助手。
我们从模版中添加「单词助理 🤓」。
## 键盘中的单词助理 🤓
在键盘中使用「单词助理」,需要先在「AI助手」中添加「单词助理」的助手。
# 生图模型
Source: https://docs.siliconflow.cn/cn/userguide/capabilities/images
## 1.生图模型简介
平台提供的生图模型主要有以下两种使用方式:一种是根据prompt输入直接生成图像;一种是根据现有图像,加上prompt输入,生成图像变体。
* **根据文本提示创建图像**
在使用文生图的大模型时,为了生成更高质量的图像,输入的prompt(提示词)需要精心设计。以下是一些有助于提高生成图像质量的提示词输入技巧:
* **具体描述**:尽量详细地描述你想要生成的图像内容。比如,如果你想生成一幅日落的海滩风景,不要仅仅输入“海滩日落”,而是可以尝试输入“一个宁静的海滩上,夕阳西下,天空呈现出橙红色,海浪轻轻拍打着沙滩,远处有一艘小船”。
* **情感和氛围**:除了描述图像的内容,还可以加入对情感或氛围的描述,比如“温馨的”、“神秘的”、“充满活力的”等,这样可以帮助模型更好地理解你想要的风格。
* **风格指定**:如果你有特定的艺术风格偏好,比如“印象派”、“超现实主义”等,可以在prompt中明确指出,这样生成的图像更有可能符合你的期待。
* **避免模糊不清的词汇**:尽量避免使用过于抽象或模糊不清的词汇,比如“美”、“好”等,这些词汇对于模型来说难以具体化,可能会导致生成的图像与预期相差较大。
* **使用否定词**:如果你不希望图像中出现某些元素,可以使用否定词来排除。例如,“生成一幅海滩日落的图片,但不要有船”。
* **分步骤输入**:对于复杂场景,可以尝试分步骤输入提示词,先生成基础图像,再根据需要调整或添加细节。
* **尝试不同的描述方式**:有时候,即使描述的是同一个场景,不同的描述方式也会得到不同的结果。可以尝试从不同的角度或使用不同的词汇来描述,看看哪种方式能得到更满意的结果。
* **利用模型的特定功能**:一些模型可能提供了特定的功能或参数调整选项,比如调整生成图像的分辨率、风格强度等,合理利用这些功能也可以帮助提高生成图像的质量。
通过上述方法,可以有效地提高使用文生图大模型时生成图像的质量。不过,由于不同的模型可能有不同的特点和偏好,实际操作中可能还需要根据具体模型的特性和反馈进行适当的调整。
可以参考如下示例:
> A futuristic eco-friendly skyscraper in central Tokyo. The building incorporates lush vertical gardens on every floor, with cascading plants and trees lining glass terraces. Solar panels and wind turbines are integrated into the structure's design, reflecting a sustainable future. The Tokyo Tower is visible in the background, contrasting the modern eco-architecture with traditional city landmarks.
> An elegant snow leopard perched on a cliff in the Himalayan mountains, surrounded by swirling snow. The animal’s fur is intricately detailed with distinctive patterns and a thick winter coat. The scene captures the majesty and isolation of the leopard's habitat, with mist and mountain peaks fading into the background.
* **根据现有图像,生成图像变体**
有部分生图模型支持通过已有图像生成图像变体,这种情况下,仍然需要输入适当的prompt,才能达到预期的效果,具体prompt输入,可以参考上面内容。
## 2.体验地址
可以通过 [图像生成](https://cloud.siliconflow.cn/playground/image) 体验生图的功能,也可以通过 [API文档](https://docs.siliconflow.cn/api-reference/images/images-generations) 介绍,通过API进行调用。
* **重点参数介绍**
* **image\_size**:控制参数的图像分辨率,API请求时候,可以自定义多种分辨率。
* **num\_inference\_steps**:控制图像生成的步长,有部分模型可以通过调整步长,获取生成效果更好的图像,其中模型black-forest-labs/FLUX.1-schnell、Pro/black-forest-labs/FLUX.1-schnell和stabilityai/stable-diffusion-3-5-large-turbo不支持调整步长,默认的步长是4。
* **prompt\_enhancement**:prompt增强开关,该开关打开后,会对输入的prompt进行一些增强,对于中文用户,想要快速通过中文生成图像,可以打开该开关,更好的适配中文。
* **batch\_size**:一次生成图像的个数,默认值是1,最大值可以设置为4
* **negative\_prompt**:这里可以输入图像中不想出现的某些元素,消除一些影响影响因素。
* **seed**:如果想要每次都生成固定的图片,可以把seed设置为固定值。
## 3.生图计费介绍
平台的生图计费分为两种计费方式:
* **根据图像大小及图像步长进行计费,单价是 ¥x/M px/Steps,即每M像素每步长是x元。**
比如想要生成一个`宽1024*高512`、4步长的图像,选择单价是`¥0.0032/M px/Steps`的stabilityai/stable-diffusion-3-5-large-turbo模型,那么生成一张图片的价格就是`(1024x512)/(1024x1024)x4x0.0032=0.0064元`,其中2代表`宽1024*高512`像素的大小是0.5M,生成一张图像的价格跟生成图像的像素大小和价格都有关系。
* **根据图片张数进行计费,单价是`¥x/Image`,即每张图片的价格是x元。**
比如想要生成一个`宽1024*高512`像素,4步长的图像,选择单价是`¥0.37/Image`的black-forest-labs/FLUX.1-pro模型,那么生成一张图片的价格就是`0.37元`,生成一张图像的价格,跟像素和步长都无关。
注意:选择的模型不一样,计费方式可能不同,请用户根据自身需求,选择相应计费方式的模型。
## 4.支持模型列表
目前已支持的生图模型:
* 文生图系列:
* black-forest-labs系列:
* black-forest-labs/FLUX.1-dev
* black-forest-labs/FLUX.1-schnell
* Pro/black-forest-labs/FLUX.1-schnell
* black-forest-labs/FLUX.1-pro
* stabilityai系列:
* stabilityai/stable-diffusion-3-5-large
* stabilityai/stable-diffusion-3-5-large-turbo
* stabilityai/stable-diffusion-3-medium
* stabilityai/stable-diffusion-xl-base-1.0
* stabilityai/stable-diffusion-2-1
* deepseekai系列:
* deepseek-ai/Janus-Pro-7B
默认出图为 `384*384` 分辨率
* 图生图系列:
* stabilityai系列:
* stabilityai/stable-diffusion-xl-base-1.0
* stabilityai/stable-diffusion-2-1
注意:支持的生图模型可能发生调整,请在「模型广场」筛选“生图”标签,了解支持的模型列表。
# 推理模型
Source: https://docs.siliconflow.cn/cn/userguide/capabilities/reasoning
## 概述
DeepSeek-R1 是一系列由 deepseek-ai 开发的高级语言模型,旨在通过输出思维链内容(reasoning\_content)来提升最终回答的准确性。目前该接口和 deepseek 接口兼容,在使用该模型时,建议先升级 OpenAI SDK 以支持新参数。
### 支持模型列表:
* deepseek-ai/DeepSeek-R1
* Pro/deepseek-ai/DeepSeek-R1
* deepseek-ai/DeepSeek-R1-Distill-Llama-70B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
## 安装与升级
在使用 DeepSeek-R1 之前,请确保已安装最新版本的 OpenAI SDK。可以通过以下命令进行升级:
```bash
pip3 install -U openai
```
## API 参数
* 输入参数:
* max\_tokens:回答的最大长度(包含思维链输出),其中上述模型列表中,deepseek-ai/DeepSeek-R1 的 max\_tokens 最大为8K,其他模型 max\_tokens 最大为16k。
* 返回参数:
* reasoning\_content:思维链内容,与 content 同级。
* content:最终回答内容
* 使用建议:
* 将温度设置在 0.5-0.7 范围内(推荐值为 0.6),以防止无限循环或不连贯的输出。
* 避免添加系统提示,所有指令应包含在用户提示中。
* 对于数学问题,建议在提示中包含一个指令,例如:“请逐步推理,并将最终答案写在 \boxed{} 中。”
* DeepSeek-R1 系列模型在回应某些查询时倾向于绕过思考模式(即输出 "\n\n"),这可能会影响模型的性能。为了确保模型进行充分的推理,建议强制模型在每次输出的开头使用 "\n"。
{/*
- 使用特定提示词用于文件上传和网页搜索,以提供更好的用户体验。
* 对于文件上传,请按照模板创建提示,其中`{file_name}`、`{file_content}` 和 `{question}` 是参数。
```bash
file_template = \
"""[file name]: {file_name}
[file content begin]
{file_content}
[file content end]
{question}"""
```
* 对于网页搜索,`{search_results}`、`{cur_data}` 和 `{question}`是参数。
* 对于中文查询,使用提示:
```bash
search_answer_zh_template = \
'''# 以下内容是基于用户发送的消息的搜索结果:
{search_results}
在我给你的搜索结果中,每个结果都是[webpage X begin]...[webpage X end]格式的,X代表每篇文章的数字索引。请在适当的情况下在句子末尾引用上下文。请按照引用编号[citation:X]的格式在答案中对应部分引用上下文。如果一句话源自多个上下文,请列出所有相关的引用编号,例如[citation:3][citation:5],切记不要将引用集中在最后返回引用编号,而是在答案对应部分列出。
在回答时,请注意以下几点:
- 今天是{cur_date}。
- 并非搜索结果的所有内容都与用户的问题密切相关,你需要结合问题,对搜索结果进行甄别、筛选。
- 对于列举类的问题(如列举所有航班信息),尽量将答案控制在10个要点以内,并告诉用户可以查看搜索来源、获得完整信息。优先提供信息完整、最相关的列举项;如非必要,不要主动告诉用户搜索结果未提供的内容。
- 对于创作类的问题(如写论文),请务必在正文的段落中引用对应的参考编号,例如[citation:3][citation:5],不能只在文章末尾引用。你需要解读并概括用户的题目要求,选择合适的格式,充分利用搜索结果并抽取重要信息,生成符合用户要求、极具思想深度、富有创造力与专业性的答案。你的创作篇幅需要尽可能延长,对于每一个要点的论述要推测用户的意图,给出尽可能多角度的回答要点,且务必信息量大、论述详尽。
- 如果回答很长,请尽量结构化、分段落总结。如果需要分点作答,尽量控制在5个点以内,并合并相关的内容。
- 对于客观类的问答,如果问题的答案非常简短,可以适当补充一到两句相关信息,以丰富内容。
- 你需要根据用户要求和回答内容选择合适、美观的回答格式,确保可读性强。
- 你的回答应该综合多个相关网页来回答,不能重复引用一个网页。
- 除非用户要求,否则你回答的语言需要和用户提问的语言保持一致。
# 用户消息为:
{question}'''
```
* 对于英文查询,使用提示:
```bash
search_answer_en_template = \
'''# The following contents are the search results related to the user's message:
{search_results}
In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
When responding, please keep the following points in mind:
- Today is {cur_date}.
- Not all content in the search results is closely related to the user's question. You need to evaluate and filter the search results based on the question.
- For listing-type questions (e.g., listing all flight information), try to limit the answer to 10 key points and inform the user that they can refer to the search sources for complete information. Prioritize providing the most complete and relevant items in the list. Avoid mentioning content not provided in the search results unless necessary.
- For creative tasks (e.g., writing an essay), ensure that references are cited within the body of the text, such as [citation:3][citation:5], rather than only at the end of the text. You need to interpret and summarize the user's requirements, choose an appropriate format, fully utilize the search results, extract key information, and generate an answer that is insightful, creative, and professional. Extend the length of your response as much as possible, addressing each point in detail and from multiple perspectives, ensuring the content is rich and thorough.
- If the response is lengthy, structure it well and summarize it in paragraphs. If a point-by-point format is needed, try to limit it to 5 points and merge related content.
- For objective Q&A, if the answer is very brief, you may add one or two related sentences to enrich the content.
- Choose an appropriate and visually appealing format for your response based on the user's requirements and the content of the answer, ensuring strong readability.
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
- Unless the user requests otherwise, your response should be in the same language as the user's question.
# The user's message is:
{question}'''
```*/}
## 上下文拼接
在每一轮对话过程中,模型会输出思维链内容(reasoning\_content)和最终回答(content)。在下一轮对话中,之前轮输出的思维链内容不会被拼接到上下文中。
## openai请求示例
### 流式输出请求
```python
from openai import OpenAI
url = 'https://api.siliconflow.cn/v1/'
api_key = 'your api_key'
client = OpenAI(
base_url=url,
api_key=api_key
)
# 发送带有流式输出的请求
content = ""
reasoning_content=""
messages = [
{"role": "user", "content": "奥运会的传奇名将有哪些?"}
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=True, # 启用流式输出
max_tokens=4096
)
# 逐步接收并处理响应
for chunk in response:
if chunk.choices[0].delta.content:
content += chunk.choices[0].delta.content
if chunk.choices[0].delta.reasoning_content:
reasoning_content += chunk.choices[0].delta.reasoning_content
# Round 2
messages.append({"role": "assistant", "content": content})
messages.append({'role': 'user', 'content': "继续"})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=True
)
```
### 非流式输出请求
```python
from openai import OpenAI
url = 'https://api.siliconflow.cn/v1/'
api_key = 'your api_key'
client = OpenAI(
base_url=url,
api_key=api_key
)
# 发送非流式输出的请求
messages = [
{"role": "user", "content": "奥运会的传奇名将有哪些?"}
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=False,
max_tokens=4096
)
content = response.choices[0].message.content
reasoning_content = response.choices[0].message.reasoning_content
# Round 2
messages.append({"role": "assistant", "content": content})
messages.append({'role': 'user', 'content': "继续"})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=False
)
```
## 注意事项
* API 密钥:请确保使用正确的 API 密钥进行身份验证。
* 流式输出:流式输出适用于需要逐步接收响应的场景,而非流式输出则适用于一次性获取完整响应的场景。
{/* - 上下文管理:在每一轮对话中,模型输出的思维链内容不会被拼接到下一轮对话的上下文中,因此需要手动管理上下文。*/}
## 常见问题
* 如何获取 API 密钥?
请访问 [SiliconFlow](https://cloud.siliconflow.cn/) 注册并获取 API 密钥。
* 如何处理超长文本?
可以通过调整 max\_tokens 参数来控制输出的长度,但请注意最大长度为 16K。
# 语言模型
Source: https://docs.siliconflow.cn/cn/userguide/capabilities/text-generation
语言模型(LLM)使用说明手册
## 一、模型核心能力
### 1.1 基础功能
文本生成:根据上下文生成连贯的自然语言文本,支持多种文体和风格。
语义理解:深入解析用户意图,支持多轮对话管理,确保对话的连贯性和准确性。
知识问答:覆盖广泛的知识领域,包括科学、技术、文化、历史等,提供准确的知识解答。
代码辅助:支持多种主流编程语言(如Python、Java、C++等)的代码生成、解释和调试。
### 1.2 进阶能力
长文本处理:支持4k至64k tokens的上下文窗口,适用于长篇文档生成和复杂对话场景。
指令跟随:精确理解复杂任务指令,如“用Markdown表格对比A/B方案”。
风格控制:通过系统提示词调整输出风格,支持学术、口语、诗歌等多种风格。
多模态支持:除了文本生成,还支持图像描述、语音转文字等多模态任务。
## 二、接口调用规范
### 2.1 基础请求结构
您可以通过openai sdk进行端到端接口请求
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a haiku about recursion in programming."}
],
temperature=0.7,
max_tokens=1024,
stream=True
)
# 逐步接收并处理响应
for chunk in response:
print(chunk.choices[0].delta.content)
```
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="deepseek-ai/deepseek-vl2",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/658c7434-ec12-49cc-90e6-fe22ccccaf62_00001_.png",
},
},
{
"type": "text",
"text": "What's in this image?"
}
],
}
],
temperature=0.7,
max_tokens=1024,
stream=True
)
# 逐步接收并处理响应
for chunk in response:
print(chunk.choices[0].delta.content)
```
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
{"role": "user", "content": "? 2020 年世界奥运会乒乓球男子和女子单打冠军分别是谁? "
"Please respond in the format {\"男子冠军\": ..., \"女子冠军\": ...}"}
],
response_format={"type": "json_object"}
)
print(response.choices[0].message.content)
```
### 2.2 消息体结构说明
| 消息类型 | 功能描述 | 示例内容 |
| --------- | ------------------------------- | ------------------ |
| system | 模型指令,设定AI角色,描述模型应一般如何行为和响应 | 例如:"你是有10年经验的儿科医生" |
| user | 用户输入,将最终用户的消息传递给模型 | 例如:"幼儿持续低烧应如何处理?" |
| assistant | 模型生成的历史回复,为模型提供示例,说明它应该如何回应当前请求 | 例如:"建议先测量体温..." |
你想让模型遵循分层指令时,消息角色可以帮助你获得更好的输出。但它们并不是确定性的,所以使用的最佳方式是尝试不同的方法,看看哪种方法能给你带来好的结果。
## 三、模型系列选型指南
可以进入[模型广场](https://cloud.siliconflow.cn/models),根据左侧的筛选功能,筛选支持不同功能的语言模型,根据模型的介绍,了解模型具体的价格、模型参数大小、模型上下文支持的最大长度及模型价格等内容。
支持在[playground](https://cloud.siliconflow.cn/playground/chat)进行体验(playground只进行模型体验,暂时没有历史记录功能,如果您想要保存历史的回话记录内容,请自己保存会话内容),想要了解更多使用方式,可以参考[API文档](https://docs.siliconflow.cn/cn/api-reference/chat-completions/chat-completions)
## 四、核心参数详解
### 4.1 创造性控制
```bash
# 温度参数(0.0~2.0)
temperature=0.5 # 平衡创造性与可靠性
# 核采样(top_p)
top_p=0.9 # 仅考虑概率累积90%的词集
```
### 4.2 输出限制
```json
max_tokens=1000 # 单词请求最大生成长度
stop=["\n##", "<|end|>"] # 终止序列,在返回中遇到数组中对应的字符串,就会停止输出
frequency_penalty=0.5 # 抑制重复用词(-2.0~2.0)
stream=true # 控制输出是否是流式输出,对于一些输出内容比较多的模型,建议设置为流失,防止输出过长,导致输出超时
```
### 4.3 语言模型场景问题汇总
**1. 模型输出乱码**
目前看到部分模型在不设置参数的情况下,容易出现乱码,遇到上述情况,可以尝试设置`temperature`,`top_k`,`top_p`,`frequency_penalty`这些参数。
对应的 payload 修改为如下形式,不同语言酌情调整
```python
payload = {
"model": "Qwen/Qwen2.5-Math-72B-Instruct",
"messages": [
{
"role": "user",
"content": "1+1=?",
}
],
"max_tokens": 200, # 按需添加
"temperature": 0.7, # 按需添加
"top_k": 50, # 按需添加
"top_p": 0.7, # 按需添加
"frequency_penalty": 0 # 按需添加
}
```
**2. 关于`max_tokens`说明**
平台提供的LLM模型中,
* max\_tokens 限制为 `16384` 的模型:
* Pro/deepseek-ai/DeepSeek-R1
* Qwen/QVQ-72B-Preview
* deepseek-ai/DeepSeek-R1-Distill-Llama-70B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* max\_tokens 限制为 `8192` 的模型:
* Qwen/QwQ-32B-Preview
* AIDC-AI/Marco-o1
* deepseek-ai/DeepSeek-R1
* max\_tokens 限制为 `4096`的模型:
* 除上述提到的其他LLM模型的
**3. 关于`context_length`说明**
不同的LLM模型,`context_length`是有差别的,具体可以在[模型广场](https://cloud.siliconflow.cn/models)上搜索对应的模型,
查看模型具体信息。
**4. 模型输出截断问题**
可以从以下几方面进行问题的排查:
* 通过API请求时候,输出截断问题排查:
* max\_tokens设置:max\_token设置到合适值,输出大于max\_token的情况下,会被截断,deepseek R1系列的max\_token最大可设置为16384。
* 设置流式输出请求:非流式请求时候,输出内容比较长的情况下,容易出现504超时。
* 设置客户端超时时间:把客户端超时时间设置大一些,防止未输出完成,达到客户端超时时间被截断。
* 通过第三方客户端请求,输出截断问题排查:
* CherryStdio 默认的 max\_tokens 是 4096,用户可以通过设置,打开“开启消息长度限制”的开关,将max\_token设置到合适值
**5. 错误码处理**
| 错误码 | 常见原因 | 解决方案 |
| ------- | -------------- | --------------------------- |
| 400 | 参数格式错误 | 检查temperature等请求参数的取值范围 |
| 401 | API Key 没有正确设置 | 检查API Key |
| 403 | 权限不够 | 最常见的原因是该模型需要实名认证,其他情况参考报错信息 |
| 429 | 请求频率超限 | 实施指数退避重试机制 |
| 503/504 | 模型过载 | 切换备用模型节点 |
# 五、计费与配额管理
### 5.1 计费公式
`总费用 = (输入tokens × 输入单价) + (输出tokens × 输出单价) `
### 5.2 各系列单价示例
模型的具体价格可以进入[模型广场](https://cloud.siliconflow.cn/models)下的模型详情页查看。
## 六、应用案例
### 6.1 技术文档生成
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="Qwen/Qwen2.5-Coder-32B-Instruct",
messages=[{
"role": "user",
"content": "编写Python异步爬虫教程,包含代码示例和注意事项"
}],
temperature=0.7,
max_tokens=4096
)
```
### 6.2 数据分析报告
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="Qwen/QVQ-72B-Preview",
messages=[
{"role": "system", "content": "你是数据分析专家,用Markdown输出结果"},
{"role": "user", "content": "分析2023年新能源汽车销售数据趋势"}
],
temperature=0.7,
max_tokens=4096
)
```
模型能力持续更新中,建议定期访问[模型广场](https://cloud.siliconflow.cn/models)获取最新信息。
# 文本转语音模型
Source: https://docs.siliconflow.cn/cn/userguide/capabilities/text-to-speech
## 1. 使用场景
文本转语音模型(TTS)是一种将文本信息转换为语音输出的 AI 模型。该模型将输入文本内容生成自然流畅、富有表现力的语音,适用于多种应用场景:
* 为博客文章提供音频朗读
* 生成多语言语音内容
* 支持实时流媒体音频输出
## 2. API 使用指南
* 端点:/audio/speech,具体使用可参考[api文档](https://docs.siliconflow.cn/api-reference/audio/create-speech)
* 主要请求参数:
* model:用于语音合成的模型,支持的[模型列表](/capabilities/text-to-speech#3)。
* input:待转换为音频的文本内容。
* voice:参考音色,支持[系统预置音色](/capabilities/text-to-speech#2-1)、[用户预置音色](/capabilities/text-to-speech#2-2)、[用户动态音色](/capabilities/text-to-speech#2-3)。
详细参数请参考:[创建文本转语音请求](/api-reference/audio/create-speech)。
* speed:可以控制音频速度,float类型,默认值是1.0,可选范围是\[0.25,4.0];
* gain:音频增益,单位dB,可以控制音频声音大小,float类型,默认值是0.0,可选范围是\[-10,10];
* response\_format:控制输出格式,支持 mp3、opus、wav 和 pcm 格式。在选择不同的输出格式时,输出的采样率也会有所不同。
* sample\_rate:可以控制输出采样率,对于不同的视频输出类型,默认值和可取值范围均不同,具体如下:
* opus: 目前只支持48000hz
* wav, pcm: 支持 (8000, 16000, 24000, 32000, 44100), 默认44100
* mp3: 支持(32000, 44100), 默认44100
### 2.1 系统预置音色:
目前系统预置了如下 8 种音色:
* 男生音色:
* 沉稳男声: [alex](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Alex.mp3)
* 低沉男声: [benjamin](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Benjamin.mp3)
* 磁性男声: [charles](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Charles.mp3)
* 欢快男声: [david](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-David.mp3)
* 女生音色:
* 沉稳女声: [anna](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Anna.mp3)
* 激情女声: [bella](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Bella.mp3)
* 温柔女声: [claire](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Claire.mp3)
* 欢快女声: [diana](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Diana.mp3)
[在线试听](https://soundcloud.com/siliconcloud/sets/siliconcloud-online-voice)上述音频。
在请求中[使用系统预置音色](/capabilities/text-to-speech#5-1)。
在使用对应的系统预置音色时,需要在前面加上模型名称,比如:
`FunAudioLLM/CosyVoice2-0.5B:alex` 表示 `FunAudioLLM/CosyVoice2-0.5B` 模型下的 `alex` 音色。
`fishaudio/fish-speech-1.5:anna` 表示 `fishaudio/fish-speech-1.5` 模型下的 `anna` 音色。
`RVC-Boss/GPT-SoVITS:david` 表示 `RVC-Boss/GPT-SoVITS` 模型下的 `david` 音色。
### 2.2 用户预置音色:
注意:使用用户预置音色,需要进行实名认证。
**为保证生成语音效果,建议用户上传音色为:时间8~10s左右,发音吐字清晰,没有杂音/背景音。**
#### 2.2.1 通过 `base64` 编码格式上传用户预置音色
```python
import requests
import json
url = "https://api.siliconflow.cn/v1/uploads/audio/voice"
headers = {
"Authorization": "Bearer your-api-key", # 从 https://cloud.siliconflow.cn/account/ak 获取
"Content-Type": "application/json"
}
data = {
"model": "FunAudioLLM/CosyVoice2-0.5B", # 模型名称
"customName": "your-voice-name", # 用户自定义的音频名称
"audio": "data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0UAAAAOAAADTGF2ZjYxLjcuMTAwAAAAAAAAAAAAAAD/40DAAAAAAAAAAAAASW5mbwAAAA8AAAAWAAAJywAfHx8fKioqKio1NTU1Pz8/Pz9KSkpKVVVVVVVfX19fampqamp1dXV1f39/f3+KioqKlZWVlZWfn5+fn6qqqqq1tbW1tb+/v7/KysrKytXV1dXf39/f3+rq6ur19fX19f////", # 参考音频的 base64 编码
"text": "在一无所知中, 梦里的一天结束了,一个新的轮回便会开始" # 参考音频的文字内容
}
response = requests.post(url, headers=headers, data=json.dumps(data))
# 打印响应状态码和响应内容
print(response.status_code)
print(response.json()) # 如果响应是 JSON 格式
```
上述接口返回的 `uri` 字段,即为自定义音色的 ID,用户可以将其作为后续的 `voice` 参数中,进行请求。
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
在请求中[使用用户预置音色](/capabilities/text-to-speech#5-2)。
#### 2.2.2 通过文件上传用户预置音色
```python
import requests
url = "https://api.siliconflow.cn/v1/uploads/audio/voice"
headers = {
"Authorization": "Bearer your-api-key" # 从 https://cloud.siliconflow.cn/account/ak 获取
}
files = {
"file": open("/Users/senseb/Downloads/fish_audio-Alex.mp3", "rb") # 参考音频文件
}
data = {
"model": "FunAudioLLM/CosyVoice2-0.5B", # 模型名称
"customName": "your-voice-name", # 参考音频名称
"text": "在一无所知中, 梦里的一天结束了,一个新的轮回便会开始" # 参考音频的文字内容
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code)
print(response.json()) # 打印响应内容(如果是JSON格式)
```
上述接口返回的 `uri` 字段,即为自定义音色的 ID,用户可以将其作为后续的 `voice` 参数中,进行请求。
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
在请求中[使用用户预置音色](/capabilities/text-to-speech#5-2)。
### 2.3 获取用户动态音色列表
```python
import requests
url = "https://api.siliconflow.cn/v1/audio/voice/list"
headers = {
"Authorization": "Bearer your-api-key" # 从https://cloud.siliconflow.cn/account/ak获取
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json) # 打印响应内容(如果是JSON格式)
```
上述接口返回的 `uri` 字段,即为自定义音色的 ID,用户可以将其作为后续的 `voice` 参数中,进行请求。
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
在请求中[使用用户预置音色](/capabilities/text-to-speech#5-2)。
### 2.4 使用用户动态音色
注意:使用用户预置音色,需要进行实名认证。
在请求中[使用用户动态音色](/capabilities/text-to-speech#5-3)。
### 2.5 删除用户动态音色
```python
import requests
url = "https://api.siliconflow.cn/v1/audio/voice/deletions"
headers = {
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json"
}
payload = {
"uri": "speech:your-voice-name:cm02pf7az00061413w7kz5qxs:mttkgbyuunvtybnsvbxd"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.status_code)
print(response.text) #打印响应内容
```
上述接口请求参数中的 `uri` 字段,即为自定义音色的 ID。
## 3. 支持模型列表
注意:支持的 TTS 模型可能发生调整,请在「模型广场」筛选[“语音”标签](https://cloud.siliconflow.cn/models?types=speech) 获得当前支持的模型列表。计费方式:按照输入文本长度对应的 [UTF-8 字节](https://zh.wikipedia.org/wiki/UTF-8) 数进行计费,[在线字节计数器演示](https://mothereff.in/byte-counter)。
### 3.1 fishaudio/fish-speech 系列模型
注意:当前的 fishaudio/fish-speech 系列模型仅支持使用充值余额进行支付。在使用前,请确保账户充值余额充足。
* fish-speech-1.5 支持语言:中文、英语、日语、德语、法语、西班牙语、韩语、阿拉伯语、俄语、荷兰语、意大利语、波兰语、葡萄牙语
* fish-speech-1.4 支持语言:中文、英语、日语、德语、法语、西班牙语、韩语、阿拉伯语
### 3.2 RVC-Boss/GPT-SoVITS 系列模型
* 零样本文本到语音(TTS): 输入 5 秒的声音样本,即刻体验文本到语音转换。
* 跨语言支持: 支持与训练数据集不同语言的推理,目前支持英语、日语、韩语、粤语和中文。
### 3.3 FunAudioLLM/CosyVoice2-0.5B 系列模型
* 跨语言语音合成:实现不同语言之间的语音合成,中文、英文、日语、韩语、中国方言(粤语,四川话,上海话,郑州话,长沙话,天津话)
* 情感控制:支持生成具有多种情感表达的语音,包括快乐、兴奋、悲伤、愤怒等。
* 细粒度控制:通过富文本或自然语言,对生成语音的情感和韵律进行细粒度控制。
## 4. 参考音频的最佳实践
提供参考音频的高质量样本可以提升语音克隆效果。
### 4.1 音频质量指南
* 仅限单一说话人
* 稳定的音量、音调和情绪
* 简短的停顿(建议 0.5 秒)
* 理想情况:无背景噪音、专业录音质量、无房间回声
### 4.2 文件格式
* 支持格式:mp3, wav, pcm, opus
* 推荐使用 192kbps 以上的 mp3 以避免质量损失
* 未压缩格式(例如 WAV)提供的额外优势有限
## 5. 使用示例
### 5.1 使用系统预置音色
```python
from pathlib import Path
from openai import OpenAI
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="您的 APIKEY", # 从 https://cloud.siliconflow.cn/account/ak 获取
base_url="https://api.siliconflow.cn/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B", # 支持 fishaudio / GPT-SoVITS / CosyVoice2-0.5B 系列模型
voice="FunAudioLLM/CosyVoice2-0.5B:alex", # 系统预置音色
# 用户输入信息
input="你能用高兴的情感说吗?<|endofprompt|>今天真是太开心了,马上要放假了!I'm so happy, Spring Festival is coming!",
response_format="mp3" # 支持 mp3, wav, pcm, opus 格式
) as response:
response.stream_to_file(speech_file_path)
```
#### 5.2 使用用户预置音色
```python
from pathlib import Path
from openai import OpenAI
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="您的 APIKEY", # 从 https://cloud.siliconflow.cn/account/ak 获取
base_url="https://api.siliconflow.cn/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B", # 支持 fishaudio / GPT-SoVITS / CosyVoice2-0.5B 系列模型
voice="speech:your-voice-name:cm02pf7az00061413w7kz5qxs:mttkgbyuunvtybnsvbxd", # 用户上传音色名称,参考
# 用户输入信息
input=" 请问你能模仿粤语的口音吗?< |endofprompt| >多保重,早休息。",
response_format="mp3"
) as response:
response.stream_to_file(speech_file_path)
```
#### 5.3 使用用户动态音色
```python
from pathlib import Path
from openai import OpenAI
client = OpenAI()
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="您的 APIKEY", # 从 https://cloud.siliconflow.cn/account/ak 获取
base_url="https://api.siliconflow.cn/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B",
voice="", # 此处传入空值,表示使用动态音色
# 用户输入信息
input=" [laughter]有时候,看着小孩子们的天真行为[laughter],我们总会会心一笑。",
response_format="mp3",
extra_body={"references":[
{
"audio": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Alex.mp3", # 参考音频 url。也支持 base64 格式
"text": "在一无所知中, 梦里的一天结束了,一个新的轮回便会开始", # 参考音频的文字内容
}
]}
) as response:
response.stream_to_file(speech_file_path)
```
# 视频生成模型
Source: https://docs.siliconflow.cn/cn/userguide/capabilities/video
## 1. 使用场景
视频生成模型是一种利用文本或图像描述生成动态视频内容的技术,随着技术的不断发展,它的应用场景也越来越广泛。以下是一些潜在的应用领域:
1. 动态内容生成:视频生成模型可以生成动态的视觉内容,用于描述和解释信息;
2. 多模态智能交互:结合图像和文本输入,视频生成模型可用于更智能、更交互式的应用场景;
3. 替代传统视觉技术:视频生成模型可以替代或增强传统的机器视觉技术,解决更复杂的多模态问题; 随着技术的进步,视频生成模型的多模态能力会与视觉语言模型融合,推动其在智能交互、自动化内容生成以及复杂场景模拟等领域的全面应用。此外,视频生成模型还能与图像生成模型(图生视频)结合,进一步拓展其应用范围,实现更加丰富和多样化的视觉内容生成。
## 2. 使用建议
在编写提示词时,请关注详细、按时间顺序描述动作和场景。包含具体的动作、外貌、镜头角度以及环境细节,所有内容都应连贯地写在一个段落中,直接从动作开始,描述应具体和精确,将自己想象为在描述镜头脚本的摄影师,提示词保持在200单词以内。
为了获得最佳效果,请按照以下结构构建提示词:
* 从主要动作的一句话开始
* 示例:A woman with light skin, wearing a blue jacket and a black hat with a veil,She first looks down and to her right, then raises her head back up as she speaks.
* 添加关于动作和手势的具体细节
* 示例:She first looks down and to her right, then raises her head back up as she speaks.
* 精确描述角色/物体的外观
* 示例:She has brown hair styled in an updo, light brown eyebrows, and is wearing a white collared shirt under her blue jacket.
* 包括背景和环境的细节
* 示例:The background is out of focus, but shows trees and people in period clothing.
* 指定镜头角度和移动方式
* 示例:The camera remains stationary on her face as she speaks.
* 描述光线和颜色效果
* 示例:The scene is captured in real-life footage, with natural lighting and true-to-life colors.
* 注意任何变化或突发事件
* 示例:A gust of wind blows through the trees, causing the woman's veil to flutter slightly.
上述prompt生成的视频示例:
## 3. 体验地址
可以点击[playground](https://cloud.siliconflow.cn/playground/text-to-video)进行体验
注意:文生视频模型,对英文支持更友好,建议使用英文prompt进行视频生成。
## 4. 支持模型
### 4.1 文生视频模型
目前已经支持的文生视频模型:
* Lightricks/LTX-Video
该模型进行文生视频调用时候,限时免费,可在[playground](https://cloud.siliconflow.cn/playground/text-to-video)进行体验,支持API调用。
* tencent/HunyuanVideo
该模型价格0.7元/Video,支持[API调用](https://docs.siliconflow.cn/api-reference/videos/videos_submit)。
* genmo/mochi-1-preview
该模型价格2.8元/Video,支持[API调用](https://docs.siliconflow.cn/api-reference/videos/videos_submit)。
### 4.2 图生视频模型
* Lightricks/LTX-Video
该模型进行图生视频调用时候,价格0.14元/Video,当前仅支持API调用。
注意:支持的文生视频模型可能发生调整,请在「模型广场」筛选“视频”标签,了解支持的模型列表。
# 视觉语言模型
Source: https://docs.siliconflow.cn/cn/userguide/capabilities/vision
## 1. 使用场景
视觉语言模型(VLM)是一种能够同时接受视觉(图像)和语言(文本)两种模态信息输入的大语言模型。基于视觉语言模型,可以传入图像及文本信息,模型能够理解同时理解图像及上下文中的信息并跟随指令做出响应。如:
1. 视觉内容解读:要求模型对图片中包含的信息进行解读、描述,如包含的事物、文字,事物的空间关系,图像的颜色、气氛等;
2. 结合视觉内容及上下文,开展多轮会话;
3. 部分替代 OCR 等传统机器视觉模型;
4. 随着模型能力的持续提升,未来还可以用于视觉智能体、机器人等领域。
## 2. 使用方式
对于 VLM 模型,可在调用 `/chat/completions` 接口时,构造包含 `图片 url` 或 `base64 编码图片` 的 `message` 消息内容进行调用。通过 `detail` 参数控制对图像的预处理方式。
### 2.1 关于图片细节控制参数说明
SiliconCloud 提供 `low`,`high`,`auto` 三个 `detail` 参数选项。
对于目前支持的模型,`detail` 不指定或指定为 `high` 时会采用 `high`(“高分辨率”)模式,而指定为 `low` 或者 `auto` 时会采用 `low`(“低分辨率”)模式。
### 2.2 包含图像的 `message` 消息格式示例
使用 `InternVL` 系列模型注意:建议将 `{"type": "text", "text": "text-prompt here"}` 放在请求体 `content` 的图片后面,以获得最佳效果。
#### 使用图片 url 形式
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/658c7434-ec12-49cc-90e6-fe22ccccaf62_00001_.png",
"detail":"high"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
#### 2.2 base64 形式
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}",
"detail":"low"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
#### 2.3 多图片形式,其中每个图片可以是上述两种形式之一
请注意,`DeepseekVL2`系列模型适用于处理短上下文,建议最多传入2张图片。若传入超过2张图片,模型将自动调整图片尺寸为384\*384,且指定的detail参数将无效。
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/658c7434-ec12-49cc-90e6-fe22ccccaf62_00001_.png",
}
},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
## 3. 支持模型列表
目前已支持的 VLM 模型:
* Qwen 系列:
* Qwen/Qwen2-VL-72B-Instruct
* Pro/Qwen/Qwen2-VL-7B-Instruct
* Qwen/QVQ-72B-Preview
* InternVL 系列:
* OpenGVLab/InternVL2-Llama3-76B
* OpenGVLab/InternVL2-26B
* Pro/OpenGVLab/InternVL2-8B
* DeepseekVL2 系列:
* deepseek-ai/deepseek-vl2
注意:支持的 VLM 模型可能发生调整,请在「模型广场」筛选“视觉”标签,了解支持的模型列表。
## 4. 视觉输入内容计费方式
对于图片等视觉输入内容,模型会将其转化为 tokens,与文本信息一并作为模型输出的上下文信息,因此也会一并进行计费。不同模型的视觉内容转化方式不同,以下为目前支持模型的转化方式。
### 4.1 Qwen 系列
规则:
`Qwen` 最高支持像素是 `3584 * 3584= 12845056`,最低支持像素是 `56 * 56 = 3136`,会对先对每张图片长短边均放缩至28的倍数 `(h * 28) * (w * 28)`。如果不在最小像素和最大像素区间内,再等比缩放至该区间。
1. `detail=low` 时将所有图片resize 成 `448 * 448` 尺寸,最终对应 `256 tokens`;
2. `detail=high` 时等比缩放,首先将长宽按照最近的 `28` 倍数向上取整,然后再等比缩放至像素区间 `(3136, 12845056)`,并保证长宽均为 `28` 整数倍。
示例:
* `224 * 448` 和 `1024 x 1024` 和 `3172 x 4096` 的图片,选择 `detail=low` 时,均消耗 `256 tokens`;
* `224 * 448` 的图片,选择 `detail=high` 时,因为 `224 * 448` 在像素区间内,且长宽均为 `28` 倍数,消耗 `(224/28) * (448/28) = 8 * 16 = 128 tokens`;
* `1024 * 1024` 的图片,选择 `detail=high` 时,将长宽按照 `28` 的倍数向上取整至 `1036 * 1036`,该数值在像素区间内,消耗 ` (1036/28) * (1036/28) = 1369 tokens`;
* `3172 * 4096` 的图片,选择 `detail=high` 时,将长宽按照 `28` 的倍数向上取整至 `3192 * 4116`,该值超过最大像素,再将长宽等比例缩小至 `3136 * 4060`,消耗 `(3136/28) * (4060/28) = 16240 tokens`。
### 4.2 InternVL 系列
规则:
`InternVL2` 实际处理的像素以及消耗的 `tokens` 数与原始图片的长宽比例有关。最低处理像素为 `448 * 448`,最高为 `12 * 448 * 448`。
1. `detail=low` 时将所有图片 resize 成 `448 * 448` 尺寸,最终对应 `256 tokens`;
2. `detail=high` 时会根据长宽比例,将图片 resize 成长宽均为 `448` 的倍数,`(h * 448) * (w * 448)`,且 `1 <= h * w <=12`。
* 缩放的长宽 `h * w` 按照如下规则选择:
* `h` 和 `w` 均为整数,在满足 `1 <= h * w <= 12` 约束下,按照 `h * w` 从小到大的组合遍历;
* 对于当前 `(h, w)` 组合,如果原始图片长宽比例更接近 `h / w` ,那么选择该 `(h, w)` 组合;
* 对于后续 **数值更大但是比例相同** 的 `(h, w)` 组合,如果原始图片像素大于 `0.5 * h * w * 448 * 448`,那么选择数值更大的 `(h, w)` 组合。
* token消耗按照如下规则:
* 如果 `h * w = 1`,那么消耗 `256 tokens`;
* 如果 `h * w > 1`,按 `448 * 448` 滑动窗口,每个窗口均额外消耗 `256 token`,一共 `(h * w + 1) * 256 tokens`。
示例:
* `224 * 448`、`1024 * 1024` 和 `2048 * 4096` 的图片,选择 `detail=low` 时,均消耗 `256 tokens`;
* `224 * 448` 的图片,选择 `detail=high` 时,长宽比为`1:2`,会缩放至 `448 x 896`,此时 `h = 1, w = 2`,消耗 `(h * w + 1) * 256 = 768 tokens`;
* `1024 * 1024` 的图片,选择 `detail=high` 时,长宽比为`1:1`,会缩放至 `1344 * 1344 (h = w = 3)`,因为 `1024 * 1024 > 0.5 * 1344 * 1344`. 此时 `h = w = 3`,消耗 `(3 * 3 + 1) * 256 = 2560 tokens`;
* `2048 * 4096` 的图片,选择 `detail=high` 时,长宽比为`1:2`,在满足 `1 <= h * w <= 12` 条件下数值最大的 `(h, w)` 组合为 `h = 2, w = 4`,所以会缩放至 `896 * 1792`,消耗`(2 * 4 + 1) * 256 = 2304 tokens`。
### 4.3 DeepseekVL2系列
规则:
`DeepseekVL2`对于每张图片,会处理`global_view`和`local_view`两部分。`global_view`将原图片统一resize成`384*384`像素大小,local\_view会将每张图片划分成若干`384*384`的块大小。图片中间会根据宽度增加额外token来衔接。
1. `detail=low`时将所有图片resize 成`384*384`尺寸
2. `detail=high`时会根据长宽比例,将图片resize成长宽均为`384(OpenAI是512)`的倍数, `(h*384) * (w * 384)`, 且`1 <= h*w <=9`。
* 放缩的长宽`h * w`按照如下规则选择:
* `h`和`w`均为整数,在满足`1 <= h*w <=9`约束下,按照`(h, w)`组合遍历。
* 将图片resize成`(h*384, w*384)`像素时,和原图片的像素比较,取新图片像素和原图片像素的最小值作为有效像素值,取原图片像素值与有效像素值之差作为无效像素值。如果有效像素值超过之前判定的有效像素值,或者当有效像素值和之前持平,但是无效像素值更小时,选择当前`(h*384, w*384)`组合
* token消耗按照如下规则:
* `(h*w + 1) * 196 + (w+1) * 14 + 1 token`
示例:
* `224 x 448` 和 `1024 x 1024` 和 `2048 x 4096` 的图片,选择`detail=low`时,均消耗`421token`.
* `384 x 768`的图片, 选择`detail=high`时, 长宽比为`1:1`, 会缩放至`384 x 768`, 此时`h=1, w=2`, 消耗
`(1*2 +1)*196+(2+1)*14+1=631 token`.
* `1024 x 1024`的图片, 选择`detail=high`时, 会缩放至`1152*1152(h=w=3)`, 消耗`(3*3 + 1) * 196 + (3+1)*14+1 = 2017 token`.
* `2048 x 4096`的图片, 选择`detail=high`时, 长宽比例为`1:2`, 按照规则缩放至 `768*1536(h=2,w=4)`, 消耗 `(2*4 + 1) * 196 + (4+1)*14+1 = 1835 token`.
## 5. 使用示例
### 5.1. 示例 1 图片理解
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="Qwen/Qwen2-VL-72B-Instruct",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/dog.png"
}
},
{
"type": "text",
"text": "Describe the image."
}
]
}],
stream=True
)
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
### 5.2. 示例 2 多图理解
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="Qwen/Qwen2-VL-72B-Instruct",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/dog.png"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/shark.jpg"
}
},
{
"type": "text",
"text": "Identify the similarities between these images."
}
]
}],
stream=True
)
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
# FIM 补全
Source: https://docs.siliconflow.cn/cn/userguide/guides/fim
## 1. 使用场景
FIM (Fill In the Middle) 补全中,用户提供希望输入的前后内容,模型来补全中间的内容,典型用于代码补全、文本中间内容补全等场景中。
## 2. 使用方式
### 2.1 在 chat/completions 接口中使用
```json
{
"model": "model info",
"messages": "prompt message",
"params": "params",
"extra_body": {"prefix":"前缀内容", "suffix":"后缀内容"}
}
```
### 2.2 在 completions 接口中使用
```json
{
"model": "model info",
"prompt": "前缀内容",
"suffix": "后缀内容"
}
```
## 3. 支持模型列表
* Deepseek 系列:
* deepseek-ai/DeepSeek-V2.5
* deepseek-ai/DeepSeek-V3
* Qwen系列:
* Qwen/Qwen2.5-Coder-7B-Instruct
* Qwen/Qwen2.5-Coder-32B-Instruct
注意:支持的模型列表可能会发生变化,请查阅[本文档](/features/fim)了解最新支持的模型列表。
{/* 模型的最大补全长度和[max_tokens参数](/api-reference/chat-completions/chat-completions)保持一致。 */}
## 4. 使用示例
### 4.1 基于 OpenAI 的 chat.completions 接口使用FIM补全:
```python
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
messages = [
{"role": "user", "content": "Please write quick sort code"},
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
extra_body={
"prefix": f"""
def quick_sort(arr):
# 基本情况,如果数组长度小于等于 1,则返回数组
if len(arr) <= 1:
return arr
else:
""",
"suffix": f"""
# 测试 quick_sort 函数
arr = [3, 6, 8, 10, 1, 2, 1]
sorted_arr = quick_sort(arr)
print("Sorted array:", sorted_arr)
"""
},
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
### 4.2 基于 OpenAI 的 completions 接口使用 FIM 补全:
```python
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
prompt=f"""
def quick_sort(arr):
# 基本情况,如果数组长度小于等于 1,则返回数组
if len(arr) <= 1:
return arr
else:
""",
suffix=f"""
# 测试 quick_sort 函数
arr = [3, 6, 8, 10, 1, 2, 1]
sorted_arr = quick_sort(arr)
print("Sorted array:", sorted_arr)
""",
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].text, end='')
```
# 模型微调
Source: https://docs.siliconflow.cn/cn/userguide/guides/fine-tune
## 1. 模型微调简介
模型微调是一种在已有预训练模型的基础上,通过使用特定任务的数据集进行进一步训练的技术。这种方法允许模型在保持其在大规模数据集上学到的通用知识的同时,适应特定任务的细微差别。使用微调模型,可以获得以下好处:
* 提高性能:微调可以显著提高模型在特定任务上的性能。
* 减少训练时间:相比于从头开始训练模型,微调通常需要较少的训练时间和计算资源。
* 适应特定领域:微调可以帮助模型更好地适应特定领域的数据和任务。
**SiliconCloud 平台提供高效的模型微调能力,目前有以下模型支持微调**:
* 生图模型已支持:
* black-forest-labs/FLUX.1-dev
* 对话模型已支持:
* Qwen/Qwen2.5-7B-Instruct
* Qwen/Qwen2.5-14B-Instruct
* Qwen/Qwen2.5-32B-Instruct
* Qwen/Qwen2.5-72B-Instruct
* meta-llama/Meta-Llama-3.1-8B-Instruct
最新支持的模型参考[模型微调](https://cloud.siliconflow.cn/fine-tune)
## 2. 使用流程
### 2.1 准备数据
#### 2.2.1 生图模型数据准备
数据集要求如下:
1. 数据集应同时包含图片及对应图片的文本描述,在同一个本地文件夹中;
2. 每个数据集最多包含 `100` 张图片及其文本描述;
3. 支持的图片格式包括:`.jpg`、`.jpeg`、`.png`、`.webp`,建议分辨率为:`1024×1024`、`1024×768`、`768×1024`;
4. 不符合上述分辨率的图片,在训练时会被缩放、剪裁为上述分辨率;
5. 图片描述应保存为与图片同名的 `.txt` 文件;
6. 整个数据集不超过 `300M`,单个图片描述文件不超过 `128K`;
7. 对于 `FLUX.1` 模型,图片描述信息不超过 `512` tokens,过长内容会被截断
数据集本地文件夹示例如图:
#### 2.2.2 语言模型数据准备
仅支持 `.jsonl` 文件,且需符合以下要求:
1. 每行是一个独立的 `JSON` 对象;
2. 每个对象必须包含键名为 `messages` 的数组,数组不能为空;
3. `messages` 中每个元素必须包含 `role` 和 `content` 两个字段;
4. `role` 只能是 `system`、`user` 或 `assistant`;
5. 如果有 `system` 角色消息,必须在数组首位;
6. 第一条非 `system` 消息必须是 `user` 角色;
7. `user` 和 `assistant` 角色的消息应当交替、成对出现,不少于 `1` 对
如下为数据示例:
```json
{"messages": [{"role": "system", "content": "你是客服助手"}, {"role": "user", "content": "如何修改收货地址?"}, {"role": "assistant", "content": "您可以按以下步骤修改:\n1. 进入订单详情\n2. 点击'修改地址'\n3. 输入新地址信息\n4. 保存修改"}]}
{"messages": [{"role": "system", "content": "你是客服助手"}, {"role": "user", "content": "如何指定收获时间"}, {"role": "assistant", "content": "您可以按以下步骤修改:\n1. 进入订单详情\n2. 点击'修改送货时间'\n3. 输入新收获时间\n4. 保存修改"}]}
```
### 2.2 新建并配置微调任务
* 选择 `对话模型微调` 或者 `生图模型微调`
* 填写任务名称
* 选择基础模型
* 上传或选取已上传的训练数据
* 设置验证数据,支持训练集按比例切分(默认 10%),或单独选定验证集
* 配置训练参数
### 2.3 开始训练
* 点击"开始微调"
* 等待任务完成
* 获取模型标识符
### 2.4 调用微调模型
#### 2.4.1 生图微调模型调用
* 复制模型标识符
* 通过 /image/generations API 调用生图 LoRA,具体使用方式,[参见 API 文档](/api-reference/images/images-generations#body-batch-size)
示例如下:
```python
import requests
url = "https://api.siliconflow.cn/v1/images/generations"
payload = {
"prompt": "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea",
"image_size": "1024x1024",
"model": "LoRA/black-forest-labs/FLUX.1-dev",
"loras": [
{
"model_id": "cm04pf7az00061413w7kz5qxs:changdu:pazlgyppednebxesxqmx:epoch_2.safetensors",
"strength": 0.5,
},
{
"model_id": "cm04pf7az00061413w7kz5qxs:changdu:pazlgyppednebxesxqmx:epoch_1.safetensors",
"strength": 0.5,
},
{
"model_id": "cm04pf7az00061413w7kz5qxs:changdu:pazlgyppednebxesxqmx:epoch.safetensors",
"strength": 0.5,
}
]
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
```
#### 2.4.2 对话微调模型调用
* 复制模型标识符
在[模型微调页](https://cloud.siliconflow.cn/fine-tune)复制对应的模型标识符。
* 通过 `/chat/completions` API 即可直接调用微调后的模型
下面是基于 OpenAI的chat.completions 接口访问微调后模型的例子:
```python
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
messages = [
{"role": "user", "content": "用当前语言解释微调模型流程"},
]
response = client.chat.completions.create(
model="您的微调模型名",
messages=messages,
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
## 3. 参数配置详解
1. 基础训练参数
| 参数名 | 说明 | 取值范围 | 建议值 | 使用建议 |
| :---------------: | :-------------: | :------------------: | :----: | :----------: |
| Trigger Word | 【仅生图】触发词 | 训练时会被添加到每张图片的描述内容的开头 | | |
| Number of Repeats | 【仅生图】单张图片重复训练次数 | | | |
| Learning Rate | 学习速率 | 0-0.1 | 0.0001 | |
| Number of Epochs | 训练轮数 | 1-10 | 3 | |
| Batch Size | 批次大小 | 1-32 | 8 | |
| Max Tokens | 最大标记数 | 0-4096 | 4096 | 根据实际对话长度需求设置 |
2. LoRA参数
| 参数名 | 说明 | 取值范围 | 建议值 | 使用建议 |
| :----------: | :---: | :---: | :--: | :--: |
| LoRA Rank | 矩阵秩 | 1-64 | 8 | |
| LoRA Alpha | 缩放因子 | 1-128 | 32 | |
| LoRA Dropout | 随机丢弃率 | 0-1.0 | 0.05 | |
3. 场景化配置方案
**对话模型**
| 场景 | Learning Rate | Epochs | Batch Size | LoRA Rank | LoRA Alpha | Dropout |
| :--: | :-----------: | :----: | :--------: | :-------: | :--------: | :-----: |
| 标准方案 | 0.0001 | 3 | 8 | 8 | 32 | 0.05 |
| 效果优先 | 0.0001 | 5 | 16 | 16 | 64 | 0.1 |
| 轻量快速 | 0.0001 | 2 | 8 | 4 | 16 | 0.05 |
## 4. 基于SiliconCloud微调服务来优化业务实战
之前硅基流动开发了[智说新语](https://mp.weixin.qq.com/s/5KXjWwAXT-LfjGVJDE4Eiw)应用,我们通过提示词工程提供一个复杂的提示词来让大模型生成“金句”风格的描述语句。
现在,我们可通过平台的微调功能来压缩提示词并提升效果,让整个的文本生成风格更统一,速度更快,且进一步优化成本。
### 4.1 在平台上使用“智说新语”的语料按照上述进行微调。
步骤见[模型微调使用流程](/guides/fine-tune#2)
详细语料和测试代码见[siliconcloud-cookbook](https://github.com/siliconflow/siliconcloud-cookbook/tree/main/examples/fine-tune)
### 4.2 对比微调前后的效果
使用方式见[模型微调调用模型](/guides/fine-tune#2-4)
#### 4.2.1 模型输入
* 微调前:
Qwen2.5-7B-Instruct 系统Prompt:
```json
Qwen2.5-7B-Instruct 系统Prompt
# 角色
你是一位新潮评论家,你年轻、批判,又深刻;
你言辞犀利而幽默,擅长一针见血得表达隐喻,对现实的批判讽刺又不失文雅;
你的行文风格和"Oscar Wilde" "鲁迅" "林语堂"等大师高度一致;
从情感上要是对输入的否定。
# 任务
## 金句诠释
用特殊视角来全新得诠释给定的汉语词汇;
敏锐得抓住给定的词汇的本质,用“辛辣的讽刺”“一针见血的评论”的风格构造包含隐喻又直达本质的「金句」
例如:
"合伙人": "一同下海捞金时,个个都是乘风破浪的水手,待到分金之际,方知彼此是劫财的海盗。"
"大数据": "看似无所不能的数字神明,实则不过是现代社会的数字鸦片,让人沉溺于虚幻的精准,却忽略了人性的复杂与多变。"
"股市": "万人涌入的淘金场,表面上是财富的摇篮,实则多数人成了填坑的沙土。"
"白领": "西装革履,看似掌握命运的舵手,实则不过是写字楼里的高级囚徒。"
"金融家": "在金钱的海洋中遨游,表面上是操纵风浪的舵手,实则不过是随波逐流的浮萍。"
"城市化": "乡村的宁静被钢铁森林吞噬,人们在追逐繁华的幻影中,遗失了心灵的田园。"
"逃离北上广": "逃离繁华的都市牢笼,看似追逐自由的灵魂,实则不过是换个地方继续画地为牢。"
"基金": "看似为财富增值保驾护航的金融巨轮,实则多数人不过是随波逐流的浮萍,最终沦为填补市场波动的牺牲品。"
# 输入
用户直接输入词汇。
# 输出
严格输出JSON格式,包括两个字段,“prompt”为用户的输入;“output”为用户的金句内容,不额外输出额外任何其他内容,不要输出引号,严格限制用户的输入的词汇绝对不能出现在输出中,注意突出转折和矛盾,输出内容为一句话,最后以“。”结束,中间的停顿使用“,”分隔。例如
{
"prompt": "合伙人",
"output": "一同下海捞金时,个个都是乘风破浪的水手,待到分金之际,方知彼此是劫财的海盗。"
}
```
* Qwen2.5-7B-Instruct+智说新语微调后的Prompt:
```json
你是智说新语生成器
```
#### 4.2.2 模型输出
| 输入 | Qwen2.5-7B-Instruct 模型 | Qwen2.5-7B-Instruct 微调模型 |
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| 五道口 | VLG,不过是知识的轻轨与资本的交汇站,文青与土豪在此擦肩而过,孰是求知的信徒,孰是逐利的信徒,全凭幸存者的微笑。 | 知识的殿堂与商业的洪流交织,学人的笔记与商人的谈资齐飞,地名犹在,荣光已非。 |
| 新时代 | claimed to break旧 mold yet still clings to the stirring rhetoric of progress, like a fashion plate who ignores the evolution of fashion。 | 新时代的号角已吹响,然砥砺前行时,方显初心易失之难。 |
| 创新 | 看似凤凰涅槃的奇迹,实则多数人不过是换汤不换药的换皮游戏。 | 标新立异本是勇气的象征,却在同质化的社会中成了猎奇的代名词。 |
| 降维打击 | 所谓降维打击,实则是现代文明中的一种高级愚民术,用高深莫测的科技iscard,让普通人以为自己正生活在理性与进步之中,却不知已在智力与道德的低维空间中遭受碾压。。 | 高维智慧轻而易举地碾压低维凡尘,却不知低维众生早已习于在自己的平庸中寻觅慰藉,哪里还懂得高维打击的意义。 |
| 基金 | 看似为财富增值保驾护航的金融巨轮,实则多数人不过是随波逐流的浮萍,最终沦为填补市场波动的牺牲品。 | 投资者的白日梦,用钱铺路,却常跌入夜的陷阱。 |
#### 4.2.3 微调总结
1. 微调后的输出内容风格更统一,输出效果更稳定可控。
2. 微调后整个输入长度大大降低,从原始的553个token,降低至8个token,显著降低了输入tokens长度,速度更快,成本得以进一步优化。
# Function Calling
Source: https://docs.siliconflow.cn/cn/userguide/guides/function-calling
## 1. 使用场景
Function Calling 功能让模型能够调用外部工具,来增强自身能力。
该能力可以通过外部工具,通过大模型作为大脑调用外部工具(如搜索外部知识、查阅行程、或者某些特定领域工具),有效解决模型的幻觉、知识时效性等问题。
## 2. 使用方式
### 2.1 通过 REST API 添加 tools 请求参数
在请求体中添加
```shell
"tools": [
{
'type': 'function',
'function': {
'name': '对应到实际执行的函数名称',
'description': '此处是函数相关描述',
'parameters': {
'_comments': '此处是函数参数相关描述'
},
}
},
{
'_comments': '其他函数相关说明'
}
]
```
比如完整的 payload 信息:
```shell
payload = {
"model": "deepseek-ai/DeepSeek-V2.5",
"messages": [
{
"role": "user",
"content": "中国大模型行业2025年将会迎来哪些机遇和挑战"
}
],
"tools": [
{
'type': 'function',
'function': {
'name': '对应到实际执行的函数名称',
'description': '此处是函数相关描述',
'parameters': {
'_comments': '此处是函数参数相关描述'
},
}
},
{
'_comments': '其他函数相关说明'
}
]
'_comments': '其他函数列表'
}
```
### 2.2 通过 OpenAI 库请求
该功能和openai兼容,在使用 OpenAI 的库时,对应的请求参数中添加`tools=[对应的 tools]`
比如:
```python
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages = messages,
tools=[
{
'type': 'function',
'function': {
'name': '对应到实际执行的函数名称',
'description': '此处是函数相关描述',
'parameters': {
// 此处是函数参数相关描述
},
}
},
{
// 其他函数相关说明
}
]
// chat.completions 其他参数
)
```
## 3. 支持模型列表
目前支持的模型列表有:
* Deepseek 系列:
* deepseek-ai/DeepSeek-V2.5
* deepseek-ai/DeepSeek-V3
* 书生系列:
* internlm/internlm2\_5-20b-chat
* internlm/internlm2\_5-7b-chat
* Pro/internlm/internlm2\_5-7b-chat
* Qwen系列:
* Qwen/Qwen2.5-72B-Instruct
* Qwen/Qwen2.5-32B-Instruct
* Qwen/Qwen2.5-14B-Instruct
* Qwen/Qwen2.5-7B-Instruct
* Pro/Qwen/Qwen2.5-7B-Instruct
* GLM 系列:
* THUDM/glm-4-9b-chat
* Pro/THUDM/glm-4-9b-chat
注意:支持的模型列表在不断调整中,请查阅[本文档](/features/function_calling)了解最新支持的模型列表。
## 4. 使用示例
### 4.1. 示例 1:通过function calling 来扩展大语言模型的数值计算能力
本代码输入 4 个函数,分别是数值的加、减、比较大小、字符串中重复字母计数四个函数
来演示通过function calling来解决大语言模型在tokens 预测不擅长的领域的执行问题。
```python
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
def add(a: float, b: float):
return a + b
def mul(a: float, b: float):
return a * b
def compare(a: float, b: float):
if a > b:
return f'{a} is greater than {b}'
elif a < b:
return f'{b} is greater than {a}'
else:
return f'{a} is equal to {b}'
def count_letter_in_string(a: str, b: str):
string = a.lower()
letter = b.lower()
count = string.count(letter)
return(f"The letter '{letter}' appears {count} times in the string.")
tools = [
{
'type': 'function',
'function': {
'name': 'add',
'description': 'Compute the sum of two numbers',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'int',
'description': 'A number',
},
'b': {
'type': 'int',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'mul',
'description': 'Calculate the product of two numbers',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'int',
'description': 'A number',
},
'b': {
'type': 'int',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'count_letter_in_string',
'description': 'Count letter number in a string',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'str',
'description': 'source string',
},
'b': {
'type': 'str',
'description': 'letter',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'compare',
'description': 'Compare two number, which one is bigger',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'float',
'description': 'A number',
},
'b': {
'type': 'float',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
}
]
def function_call_playground(prompt):
messages = [{'role': 'user', 'content': prompt}]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages = messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools)
# print(response)
func1_name = response.choices[0].message.tool_calls[0].function.name
func1_args = response.choices[0].message.tool_calls[0].function.arguments
func1_out = eval(f'{func1_name}(**{func1_args})')
# print(func1_out)
messages.append(response.choices[0].message)
messages.append({
'role': 'tool',
'content': f'{func1_out}',
'tool_call_id': response.choices[0].message.tool_calls[0].id
})
# print(messages)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools)
return response.choices[0].message.content
prompts = [
"用中文回答:strawberry中有多少个r?",
"用中文回答:9.11和9.9,哪个小?"
]
for prompt in prompts:
print(function_call_playground(prompt))
```
模型将输出:
```shell
strawberry中有3个r。
9.11 比 9.9 小。
```
### 4.2. 示例 2:通过function calling 来扩展大语言模型对外部环境的理解
本代码输入 1 个函数,通过外部 API 来查询外部信息
```python
import requests
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
# 使用 WeatherAPI 的天气查询函数
def get_weather(city: str):
# 使用 WeatherAPI 的 API 来获取天气信息
api_key = "您的WeatherAPI APIKEY" # 替换为你自己的 WeatherAPI APIKEY
base_url = "http://api.weatherapi.com/v1/current.json"
params = {
'key': api_key,
'q': city,
'aqi': 'no' # 不需要空气质量数据
}
# 调用天气 API
response = requests.get(base_url, params=params)
if response.status_code == 200:
data = response.json()
weather = data['current']['condition']['text']
temperature = data['current']['temp_c']
return f"The weather in {city} is {weather} with a temperature of {temperature}°C."
else:
return f"Could not retrieve weather information for {city}."
# 定义 OpenAI 的 function calling tools
tools = [
{
'type': 'function',
'function': {
'name': 'get_weather',
'description': 'Get the current weather for a given city.',
'parameters': {
'type': 'object',
'properties': {
'city': {
'type': 'string',
'description': 'The name of the city to query weather for.',
},
},
'required': ['city'],
},
}
}
]
# 发送请求并处理 function calling
def function_call_playground(prompt):
messages = [{'role': 'user', 'content': prompt}]
# 发送请求到 OpenAI API
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools
)
# 处理 API 返回的工具调用请求
func1_name = response.choices[0].message.tool_calls[0].function.name
func1_args = response.choices[0].message.tool_calls[0].function.arguments
func1_out = eval(f'{func1_name}(**{func1_args})')
# 将结果添加到对话中并返回
messages.append(response.choices[0].message)
messages.append({
'role': 'tool',
'content': f'{func1_out}',
'tool_call_id': response.choices[0].message.tool_calls[0].id
})
# 返回模型响应
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools
)
return response.choices[0].message.content
# 示例使用
prompt = "how is the weather today in beijing?"
print(function_call_playground(prompt))
```
模型将输出:
```shell
The weather in Beijing today is sunny with a temperature of 21.4°C.
```
# JSON 模式
Source: https://docs.siliconflow.cn/cn/userguide/guides/json-mode
## 1. 使用场景
目前,硅基流动的大模型 API 平台 SiliconCloud 默认生成**非结构化文本**,但在某些应用场景中,您可能希望模型以**结构化**的形式输出内容,但用提示词的方式直接告诉大模型却无法获得正确的结构化输出。
作为一种标准化、轻量级的数据交换格式,JSON 模式是支持大模型 API 进行结构化输出的重要功能。当您调用大模型的 API 进行请求时,模型返回的结果以 JSON 格式呈现,易于人类阅读和编写,同时也易于机器解析和生成。
现在,SiliconCloud 平台上除了 DeepSeek 的 R1 系列和 V3 模型外,其他主要语言模型均已支持 JSON 模式,能让模型输出 JSON 格式的字符串,以确保模型以预期的结构输出,便于后续对输出内容进行逻辑解析。
比如,您现在可以通过 SiliconCloud API 对以下案例尝试结构化输出:
* 从公司相关报道中构建新闻数据库,包括新闻标题、链接等。
* 从商品购买评价中提取出情感分析结构,包括情感极性(正面、负面、中性)、情感强度、情感关键词等。
* 从商品购买历史中提取出产品列表,包括产品信息、推荐理由、价格、促销信息等。
## 2. 使用方式
在请求中添加
```json
response_format={"type": "json_object"}
```
## 3. 支持模型列表
目前线上,除了 DeepSeek 的 R1 系列和 V3 模型外, 其他的大语言类模型都支持上述参数。
注意:支持的模型情况可能会发生变化,请查阅本文档了解最新支持的模型列表。你的应用必须检测并处理可能导致模型输出不完整JSON对象的边缘案例。请合理设置max\_tokens,防止JSON字符串被中断。
## 4. 使用示例
下面是在 openai 中使用的例子:
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
{"role": "user", "content": "? 2020 年世界奥运会乒乓球男子和女子单打冠军分别是谁? "
"Please respond in the format {\"男子冠军\": ..., \"女子冠军\": ...}"}
],
response_format={"type": "json_object"}
)
print(response.choices[0].message.content)
```
模型将输出:
```json
{"男子冠军": "马龙", "女子冠军": "陈梦"}
```
# 前缀续写
Source: https://docs.siliconflow.cn/cn/userguide/guides/prefix
## 1. 使用场景
前缀续写中,用户提供希望输出的前缀信息,来让模型基于用户提供的前缀信息来补全其余的内容。
基于上述能力,模型能有更好的指令遵循能力,满足用户一些特定场景的指定格式的问题。
## 2. 使用方式
在请求中添加
```json
extra_body={"prefix":"希望的前缀内容"}
```
## 3. 支持模型列表
目前[大语言类模型](https://cloud.siliconflow.cn/models?types=chat)支持上述参数。
注意:支持的模型情况可能会发生变化,请查阅本文档了解最新支持的模型列表。
## 4. 使用示例
下面是基于 OpenAI 库使用前缀续写的例子:
````python
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
messages = [
{"role": "user", "content": "Please write quick sort code"},
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
extra_body={"prefix":"```python\n"}
)
print(response.choices[0].message.content)
````
# 产品简介
Source: https://docs.siliconflow.cn/cn/userguide/introduction
## 产品介绍
* 作为集合顶尖大模型的一站式云服务平台,[SiliconCloud](https://siliconflow.cn/zh-cn/siliconcloud) 致力于为开发者提供更快、更全面、体验更丝滑的模型 API,助力开发者和企业聚焦产品创新,无须担心产品大规模推广所带来的高昂算力成本。
## 产品功能
1. 提供开箱即用的大模型 API,按量收费,助力应用开发轻松实现。
* 已上架包括 Qwen2.5-72B、DeepSeek-V2.5、Qwen2、InternLM2.5-20B-Chat、BCE、BGE、SenseVoice-Small、Llama-3.1、FLUX.1、DeepSeek-Coder-V2、SD3 Medium、GLM-4-9B-Chat、InstantID 在内的多种开源大语言模型、图片生成模型、代码生成模型、向量与重排序模型以及多模态大模型,覆盖语言、语音、图片、视频等多场景。
* 其中,Qwen2.5(7B)、Llama3.1(8B)等多个大模型 API 免费使用,让开发者与产品经理无需担心研发阶段和大规模推广所带来的算力成本,实现“Token 自由”。
* 25 年 1 月,SiliconCloud 平台上线基于华为云昇腾云服务的 DeepSeek-V3、DeepSeek-R1 推理服务。通过双方联合创新,在硅基流动自研推理加速引擎加持下,平台上的 DeepSeek 模型可获得持平全球高端 GPU 部署模型的效果。
2. 提供高效能大模型推理加速服务,提升 GenAI 应用的用户体验。
3. 提供模型微调与部署的托管服务,用户可直接托管经过微调的大语言模型,在支撑业务迭代的同时,无需关注底层资源、服务质量,有效降低维护成本。
## 产品特性
1. **高速推理**
* 自研高效算子和优化框架,推理加速引擎全球领先。
* 极致提升吞吐能力,全面支持高吞吐场景的业务需求。
* 显著优化计算延迟,为低延迟场景提供卓越性能保障。
2. **高扩展性**
* 动态扩容支持弹性业务模型,无缝适配多种复杂场景。
* 一键部署自定义模型,轻松应对规模化挑战。
* 灵活架构设计,满足多样化任务需求,支持混合云部署。
3. **高性价比**
* 端到端极致优化,推理和部署成本显著降低。
* 提供灵活按需付费模式,减少资源浪费,精准控制预算。
* 支持国产异构 GPU 部署,基于企业已有投资,节省企业投入。
4. **高稳定性**
* 经过开发者验证,保证高可靠稳定运行。
* 提供完善的监控和容错机制,保障服务能力。
* 提供专业技术支持,满足企业级场景需求,确保服务高可用性。
5. **高智能**
* 提供多种先进模型服务,包括大语言模型、音视频等多模态模型。
* 智能扩展功能,灵活适配业务规模,满足多种服务需求。
* 智能成本分析,为业务优化提供支持,助力成本管控与效益提升。
6. **高安全性**
* 支持 BYOC 部署,全面保护数据隐私与业务安全。
* 计算隔离/网络隔离/存储隔离,保障数据安全。
* 符合行业标准与合规要求,全面满足企业级用户的安全需求。
# BizyAir 文档
Source: https://docs.siliconflow.cn/cn/userguide/products/bizyair
# OneDiff 多模态推理加速引擎
Source: https://docs.siliconflow.cn/cn/userguide/products/onediff
# SiliconCloud 平台
Source: https://docs.siliconflow.cn/cn/userguide/products/siliconcloud
# SiliconLLM 大语言推理加速引擎
Source: https://docs.siliconflow.cn/cn/userguide/products/siliconllm
# 快速上手
Source: https://docs.siliconflow.cn/cn/userguide/quickstart
## 1. 登录平台
访问[ SiliconCloud官网 ](https://siliconflow.cn/zh-cn/siliconcloud)并点击右上角[“登录”](https://cloud.siliconflow.cn/)按钮,按照提示填写您的基本信息进行登录。
(目前平台支持短信登录、邮箱登录,以及 GitHub、Google 的 OAuth 登录)
## 2. 查看模型列表和模型详情
通过[ 模型广场 ](https://cloud.siliconflow.cn/models)查看当前可用的模型详情、模型价格、用户可用的最高限速等信息,并可以通过模型详情页的“在线体验”进入到模型体验中心。
## 3. 在 playground 体验 GenAI 能力
进入[“体验中心( playground )”](https://cloud.siliconflow.cn/)页面,左侧栏可选择语言模型、文生图模型和图生图模型,选择相应模型即可开始实时体验。输入相关参数及 prompt ,点击“运行”按钮,即可看到模型生成的结果。
## 4. 使用 SiliconCloud API 调用GenAI 能力
### 4.1 创建API key
进入[API密钥](https://cloud.siliconflow.cn/account/ak)页面,点击“新建API密钥”,创建您的API key
### 4.2 通过REST 接口进行服务调用
您可以直接在平台的[“文档链接”](https://docs.siliconflow.cn/cn/api-reference/chat-completions/chat-completions)中使用您的 API key 进行在线调用,此处可以生成对应语言的代码。
### 4.3 通过 OpenAI 接口调用
当前大语言模型部分支持以 openai 库进行调用,
安装 Python3.7.1 或更高版本并设置虚拟环境后,即可安装 OpenAI Python 库。从终端/命令行运行:
```shell
pip install --upgrade openai
```
完成此操作后, running 将显示您在当前环境中安装的 Python 库,确认 OpenAI Python 库已成功安装。
之后可以直接通过 OpenAI 的相关接口进行调用,目前平台支持 OpenAI 相关的大多数参数。
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model='deepseek-ai/DeepSeek-V2.5',
messages=[
{'role': 'user',
'content': "中国大模型行业2025年将会迎来哪些机遇和挑战"}
],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
# Rate Limits
Source: https://docs.siliconflow.cn/cn/userguide/rate-limits/rate-limit-and-upgradation
## 1. Rate Limits 概述
### 1.1 什么是 Rate Limits
Rate Limits 是指用户 API 在指定时间内访问 SiliconCloud 平台服务频次规则。
### 1.2 为什么做 Rate Limits
Rate Limits 是 API 的常见做法,其实施原因如下:
* **保障资源的公平性及合理利用**:确保资源公平使用。 防止某些用户过多请求,影响其他用户的正常使用体验。
* **防止请求过载**:提高服务可靠性。帮助管理平台总体负载,避免因请求激增而导致服务器出现性能问题。
* **安全防护**:防止恶意性攻击,导致平台过载甚至服务中断。
### 1.3 Rate Limits 指标
目前Rate Limit以七种指标衡量:
* RPM( requests per minute,一分钟最多发起的请求数)
* RPH( requests per hour,每小时允许的最大请求数)
* RPD (Requests per day,每天允许的最大请求数)
* TPM( tokens per minute,一分钟最多允许的 token 数)
* TPD( tokens per day,每天最多允许的 token 数)
* IPM( images per minute,一分钟最多生成的图片数)
* IPD( images per day,一天最多生成的图片数)
### 1.4 不同模型的 Rate Limits 指标
| 模型名称 | Rate Limit指标 | 当前指标 |
| ------------------------- | ------------ | ---------------------------------- |
| 语言模型(Chat) | RPM、 TPM | RPM=1000-10000 TPM=50000-5000000 |
| 向量模型(Embedding) | RPM、 TPM | RPM:2000-10000 TPM:500000-10000000 |
| 重排序模型(Reranker) | RPM、 TPM | RPM:2000 TPM:500000 |
| 图像生成模型(Image) | IPM、IPD | IPM:2- IPD:400- |
| 多模态模型 (Multimodal Models) | - | - |
Rate Limits 可能会因在任一选项(RPM、RPH、RPD、TPM、TPD、IPM、IPD)中达峰而触发,取决于哪个先发生。
例如,在 RPM 限制为20,TPM 限制为 200K 时,一分钟内,账户向 ChatCompletions 发送了 20 个请求,每个请求有 100个Token ,限制即触发,即使账户在这些 20 个请求中没有发满 200K 个 Token。
### 1.5 Rate Limits 主体
1. Rate Limit是在用户账户级别定义的,而不是密钥(API key)维度。
2. 每个模型**单独设置 Rate Limits**,一个模型请求超出 Rate Limits 不影响其他模型正常使用。
## 2. Rate Limits 规则
* 当前免费模型 Rate Limits 指标是固定值,收费模型根据账户[用量级别](https://account.siliconflow.cn/user/settings)有不同的 [Rate Limits 指标](https://cloud.siliconflow.cn/models)。
* 同一用量级别下,模型类别不同、模型参数量不同,Rate Limits 峰值不同。
### 2.1 免费模型Rate Limits
1. **[实名认证](/faqs/authentication)后使用全部的免费模型。**
2. **免费模型调用免费**,账户的[费用账单](https://cloud.siliconflow.cn/bills)中看到此类模型的费用为调用消耗是 0。
3. **免费模型的 Rate Limits 固定**。对于部分模型,平台同时提供**免费版**和**收费版**。免费版按照原名称命名;收费版会在**名称前加上“Pro/”以示区分**。例如,Qwen2.5-7B-Instruct 的免费版命名为“Qwen/Qwen2.5-7B-Instruct”,收费版则命名为“Pro/Qwen/Qwen2.5-7B-Instruct”。
### 2.2 收费模型 Rate Limits
1. 按照用量付费。API 调用消耗**计入**账户[费用账单](https://cloud.siliconflow.cn/bills)。
2. 根据账户**用量级别**进行分层 Rate Limits 。 Rate Limits 峰值随着用量级别提升而增大。
3. 同一用量级别下,模型类别不同、模型参数量大小不同, Rate Limits 峰值不同。
### 2.3 用户用量级别与 Rate Limits
平台依据账户每月消费金额将其划分为不同的用量级别,每个级别有各自的 Rate Limits 标准。月消费达到更高级别标准时,自动升级至相应用量级别。升级立即生效,并提供更宽松的 Rate Limits。
* **月消费金额**:包含充值金额消费和赠送金额在内的账户每个月的总[消费金额](https://cloud.siliconflow.cn/bills)。
* **级别设置**:比较**上个自然月**和**当月 1 号到今日**的消费金额,取最高值换算成对应的用量级别。新用户注册后初始用量级别为L0。
| 用量级别 | 资质(单位:人民币元) |
| ---- | ------------------------------ |
| L0 | 上月或当月消费金额最高值 \< ¥50 |
| L1 | ¥50 ≤ 上月或当月消费金额最高值 \< ¥200 |
| L2 | ¥200 ≤ 上月或当月消费金额最高值 \< ¥2000 |
| L3 | ¥2000 ≤ 上月或当月消费金额最高值 \< ¥5000 |
| L4 | ¥5000 ≤ 上月或当月消费金额最高值 \< ¥10000 |
| L5 | ¥10000 ≤ 上月或当月消费金额最高值 |
### 2.4 具体模型的 Rate Limits
平台目前提供文本生成、图像生成、向量化、重排序和语音五大类,具体模型的 Rate Limits 指标在[模型广场](https://cloud.siliconflow.cn/models)中查看。
### 2.5 `deepseek-ai/DeepSeek-R1` 和 `deepseek-ai/DeepSeek-V3` Rate Limits具体规则:
1. 新增 RPH 限制(Requests Per Hour,每小时请求数)
* 模型范围:deepseek-ai/DeepSeek-R1、deepseek-ai/DeepSeek-V3
* 适用对象:所有用户
* 限制标准:30次/小时
2. 新增 RPD 限制(Requests Per Day,每日请求数)
* 模型范围:deepseek-ai/DeepSeek-R1、deepseek-ai/DeepSeek-V3
* 适用对象:未完成实名认证用户
* 限制标准:100次/天
随着流量和负载变化,策略可能会不定时调整,硅基流动保留解释权。
## 3. 超出 Rate Limits 处理
### 3.1 超出 Rate Limits 报错信息
如果超出 Rate Limits 调用限制,用户的 API 请求将会因为超过 Rate Limits 而失败。用户需要等待一段时间待满足 Rate Limits 条件后方能再次调用。对应的 HTTP 错误信息为:
```shell
HTTP/1.1 429
Too Many Requests
Content Type: application/json
Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.cn
```
### 3.2 超出 Rate Limits 处理方式
* 在已有的Rate Limits下,可以参考 [超出 Rate Limits 处理](https://github.com/siliconflow/siliconcloud-cookbook/blob/main/examples/how-to-handle-rate-limit-in-siliconcloud.ipynb)
进行错误回避。
* 也可以通过提升用量级别来提升模型 Rate Limits 峰值,业务目标。
## 4. 如何提升模型 Rate Limits 指标
### 4.1 提升 Rate Limits 的方式
* 根据用量自动升级:您可以通过提高用量来增加[月消费金额](https://cloud.siliconflow.cn/bills),满足下一级别资质时,会自动升级。
* 购买等级包快速提升:如果您需要**快速达到**更高用量级别、提高 Rate Limits 峰值,可以通过[购买等级包](https://cloud.siliconflow.cn/package)来提升用量级别。
### 4.2 等级包购买细则
* 在线购买:请前往平台在线购买 [等级包](https://cloud.siliconflow.cn/package)
* 有效时间:等级包购买后立即生效,适用于当月(N)和下一个自然月(N+1)。自下下个自然月(N+2)起,将根据上一个月(N+1)的消费金额重新计算账户的最新用量级别。
* 支付方式:等级包仅支持使用平台充值余额支付,不支持使用平台赠送余额支付。
* 发票开具:关于等级包的发票开具,参考[开具发票](/faqs/invoice)部分。
* 专属实例:等级包不适用于专属实例需求,若有相关需求,请联系您的专属客户经理。
### 4.3 其他情况
* 联系我们:不属于上述情况的场景,请[联系我们](https://siliconflow.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3)。
# 结合 Cursor 使用
Source: https://docs.siliconflow.cn/cn/userguide/use-docs-with-cursor
SiliconCloud 文档站支持 [llms.txt 协议](https://llmstxt.org/),既可供用户直接查阅,也可无缝对接各类支持该协议的工具进行使用。
考虑到部分用户可能对 [llms.txt 协议](https://llmstxt.org/) 不够熟悉,下面将简要介绍使用流程及相关概述。
## 1. 在 Cursor 中使用本文档
### 1.1 配置本文档
配置 `Cursor` 的 `@Docs` 数据源,可以很方便的将本文档丢给 `Cursor` 使用。
### 1.2 在 cursor 中使用
## 2. 关于 llmx.txt 的相关介绍
### 2.1 协议背景
llms.txt 是一种新兴的 Web 标准,旨在帮助大型语言模型(LLMs)更有效地访问和理解网站内容。通过在网站根目录下创建 llms.txt 文件,网站所有者可以为 AI 系统提供清晰的导航和指引,从而提升信息检索的效率。
### 2.2 文件结构:
llms.txt 文件采用 Markdown 格式,通常包含以下部分:
1. 标题:网站名称或项目名称。
2. 描述(可选):对网站或项目的简要介绍。
3. 详细信息(可选):提供更多背景信息或链接到其他文档。
4. 章节:列出网站的重要部分,每个部分包含链接和可选的详细说明。
示例如下(参考:[https://docs.siliconflow.cn/llms.txt](https://docs.siliconflow.cn/llms.txt) 和 [https://docs.siliconflow.cn/llms-full.txt](https://docs.siliconflow.cn/llms-full.txt) 文件)
```markdown
# SiliconFlow
## Docs
- [创建语音转文本请求](https://docs.siliconflow.cn/api-reference/audio/create-audio-transcriptions): Creates an audio transcription.
- [创建文本转语音请求](https://docs.siliconflow.cn/api-reference/audio/create-speech): 从输入文本生成音频。根据输入的文本生成音频。接口生成的数据为音频的二进制数据,需要使用者自行处理。参考:https://docs.siliconflow.cn/capabilities/text-to-speech#5
- [删除参考音频](https://docs.siliconflow.cn/api-reference/audio/delete-voice): 删除用户预置音色
- [上传参考音频](https://docs.siliconflow.cn/api-reference/audio/upload-voice): 上传用户预置音色,支持以 base64 编码或者文件形式上传,参考https://docs.siliconflow.cn/capabilities/text-to-speech#2-2)
- [参考音频列表获取](https://docs.siliconflow.cn/api-reference/audio/voice-list): 获取用户预置音色列表
...
```
### 2.3 文件作用
#### 2.3.1 /llms.txt:
* 大规模人工智能友好导航:该文件提供了整个文档导航的简化视图,使 Cursor 或 ChatGPT 等 LLM 可以更轻松地索引您的内容。
* 将其视为人工智能的搜索引擎优化--用户现在可以直接通过通用的 LLM 找到特定产品的信息。
#### 2.3.2 /llms-full.txt:
* 文件会将所有文档文本编译成一个标记符文件,便于人工智能工具基于该文件将信息直接载入其上下文窗口。
* 可以将文档输入到 Cursor 等人工智能编码助手中,让它们根据您产品的具体细节提供上下文感知建议。
### 2.4 与现有标准的区别:
虽然 llms.txt 与 robots.txt 和 sitemap.xml 等现有标准在功能上有所重叠,但它们的目的和作用不同:
* robots.txt:用于指示搜索引擎爬虫哪些页面可以或不可以抓取,主要关注访问权限控制。
* sitemap.xml:提供网站的结构地图,帮助搜索引擎了解网站的页面布局,主要用于索引目的。
* llms.txt:为大型语言模型提供结构化的内容概述,帮助 AI 系统更好地理解和处理网站信息,提升与 AI 交互的效果。
## 3. 在其他工具中使用
其他平台如果支持[llms.txt 协议](https://llmstxt.org/),也可以直接使用。
比如在 ChatGPT 中使用:
## 4. 扩展阅读
1. The /llms.txt file, [https://llmstxt.org/](https://llmstxt.org/)
2. @Docs, [https://docs.cursor.com/context/@-symbols/@-docs](https://docs.cursor.com/context/@-symbols/@-docs)
3. LLMs.txt:AI时代的站点地图, [https://juejin.cn/post/7447083753187328050](https://juejin.cn/post/7447083753187328050)
# Create a Speech-to-Text Request
Source: https://docs.siliconflow.cn/en/api-reference/audio/create-audio-transcriptions
post /audio/transcriptions
Creates an audio transcription.
# Create a Text-to-Speech Request
Source: https://docs.siliconflow.cn/en/api-reference/audio/create-speech
post /audio/speech
从输入文本生成音频。根据输入的文本生成音频。接口生成的数据为音频的二进制数据,需要使用者自行处理。参考:https://docs.siliconflow.cn/capabilities/text-to-speech#5
# Delete Reference Audio
Source: https://docs.siliconflow.cn/en/api-reference/audio/delete-voice
post /audio/voice/deletions
删除用户预置音色
# Upload reference audio
Source: https://docs.siliconflow.cn/en/api-reference/audio/upload-voice
post /uploads/audio/voice
上传用户预置音色,支持以 base64 编码或者文件形式上传,参考https://docs.siliconflow.cn/capabilities/text-to-speech#2-2)
# Retrieve reference audio list
Source: https://docs.siliconflow.cn/en/api-reference/audio/voice-list
get /audio/voice/list
获取用户预置音色列表
# Create text conversation request
Source: https://docs.siliconflow.cn/en/api-reference/chat-completions/chat-completions
post /chat/completions
Creates a model response for the given chat conversation.
# Create embedding request
Source: https://docs.siliconflow.cn/en/api-reference/embeddings/create-embeddings
post /embeddings
Creates an embedding vector representing the input text.
# Create image generation request
Source: https://docs.siliconflow.cn/en/api-reference/images/images-generations
post /images/generations
Creates an image response for the given prompt. Currently, FLUX.1-schnell serires and stable-diffusion-3-5-large-turbo model only support 4 steps. 根据给定的提示生成图片响应。目前,FLUX.1-schnell 系列和 stable-diffusion-3-5-large-turbo 模型仅支持 4 步生成,对应的num_inference_steps参数不能配置。生成的图片 URL 有效期1个小时,请及时做好转存工作,避免因 URL 过期而影响业务
# Retrieve user model list
Source: https://docs.siliconflow.cn/en/api-reference/models/get-model-list
get /models
Retrieve models information.
# Create reordering request
Source: https://docs.siliconflow.cn/en/api-reference/rerank/create-rerank
post /rerank
Creates a rerank request.
# Retrieve user account information
Source: https://docs.siliconflow.cn/en/api-reference/userinfo/get-user-info
get /user/info
获取用户信息,包括余额和状态
# Retrieve video generation link request
Source: https://docs.siliconflow.cn/en/api-reference/videos/get_videos_status
post /video/status
获取用户生成的视频。 生成的视频 URL 有效期1个小时,请及时做好转存工作,避免因 URL 过期而影响业务。
# Create video generation request
Source: https://docs.siliconflow.cn/en/api-reference/videos/videos_submit
post /video/submit
通过输入prompt生成视频,该接口返回的是用户当前请求生成的requestId,用户需要通过轮询status接口获取具体的视频链接,生成后的结果在10分钟内有效,请及时取走视频链接。
# Real-name Authentication
Source: https://docs.siliconflow.cn/en/faqs/authentication
## 1. Why is Real-name Authentication Required?
According to the Cybersecurity Law of the People's Republic of China and other laws and regulations, network operators are required to request users to provide real identity information when they handle network access and provide services. Users who do not provide real identity information cannot be provided with related services.
## 2. What Impact Will Non-real-name Authentication Have on My Account?
If you do not perform real-name authentication, your account will be unable to perform the following operations:
* Unable to perform "Account Recharge"
* Unable to apply for "Invoice Issuance"
* Unable to use "Large Language Models Provided by Overseas Vendors", currently including
* nvidia/Llama-3.1-Nemotron-70B-Instruct
* meta-llama/Meta-Llama-3.1-405B-Instruct
* meta-llama/Meta-Llama-3-70B-Instruct
* meta-llama/Meta-Llama-3.1-70B-Instruct
* meta-llama/Meta-Llama-3-8B-Instruct
* meta-llama/Meta-Llama-3.1-8B-Instruct
* google/gemma-2-27b-it
* google/gemma-2-9b-it
* Pro/meta-llama/Meta-Llama-3-8B-Instruct
* Pro/meta-llama/Meta-Llama-3.1-8B-Instruct
* Pro/google/gemma-2-9b-it
## 3. What Are the Differences Between Individual and Corporate Real-name Authentication?
Account real-name authentication is divided into two types: Individual Real-name Authentication and Corporate Real-name Authentication:
* Individual Real-name Authentication: The authentication type is individual, and it supports individual facial recognition authentication.
* Corporate Real-name Authentication: The authentication type is corporate (including ordinary enterprises, government agencies, public institutions, social organizations, individual businesses, etc.), and it supports legal person facial recognition authentication and corporate public transfer authentication.
**Impact of Real-name Authentication on the Account:**
1. Affects Account Ownership:
* An account that has completed corporate real-name authentication belongs to the company.
* An account that has completed individual real-name authentication belongs to the individual.
2. Affects Invoice Information:
* Corporate authentication can issue VAT special invoices and VAT general invoices with the company's name.
* Individual authentication can only issue VAT general invoices with the individual's name.
【Note】
* Real-name authentication information is very important for your account and financial security. Please authenticate based on your actual situation.
* For account security, corporate users should not perform individual real-name authentication.
* The current account can only be bound to one authentication subject. After the subject change is successful, the original subject information will be unbound from the account.
## 4. How to Perform Individual Authentication?
### 4.1 Types of Documents Supported for Personal Verification
The types of documents supported for personal verification include:
* Resident Identity Card of Mainland China
* Hong Kong and Macao Residents' Permit for Travelling to and from Mainland China (Home Return Permit)
* Taiwan Residents' Permit for Travelling to and from Mainland China (Taiwan Compatriot Permit)
* Hong Kong and Macao Residents' Residence Permit
* Taiwan Residents' Residence Permit
* Foreigner's Permanent Residence Permit
Users who do not possess any of the above documents are temporarily not supported for online personal verification and can communicate with staff through the [form](https://siliconflow.feishu.cn/share/base/form/shrcnF4a7pFS2eR4wJj9rneM7mc?auth_token=U7CK1RF-ddcuca83-7f21-437e-9ef2-208b950e9f7f-NN5W4\&ccm_open_type=form_v1_qrcode_share\&share_link_type=qrcode) to attempt other verification methods.
### 4.2 Personal Verification Process
1. Log in to the SiliconCloud platform and click on \[User Center - Real-name] Authentication ([https://cloud.siliconflow.cn/account/authentication](https://cloud.siliconflow.cn/account/authentication)).
2. On the real-name authentication page, select the authentication type as "Individual Real-name Authentication", then fill in your personal information.
3. Use the Alipay App on your phone to scan the QR code, scan it, and follow the prompts on your phone to complete the facial recognition authentication. After successful verification, click 'Face Verification Completed' on the pop-up window in the web page.
4. After successful authentication, you can modify the authentication information or change to a corporate user. You can only complete one change or modification within 30 days.
【Note】
* Real-name authentication directly affects the ownership of the account. If you are a corporate user, please perform corporate real-name authentication to avoid unnecessary disputes due to changes in personnel. For more information, see the differences between individual and corporate real-name authentication.
* According to relevant laws and regulations, we do not provide online real-name authentication services for individuals under 14 years old.
## 5. How to Perform Corporate Authentication?
1. Log in to the SiliconCloud platform and click on "User Center - Real-name Authentication".
2. On the real-name authentication page, select the authentication type as "Corporate Real-name Authentication", and then choose the authentication method. There are two authentication methods:
* Choose Legal Person Facial Recognition Authentication
1. Fill in the company name, unified social credit code, legal person's name, and legal person's ID number, and check the agreement.
2. The legal person uses the Alipay App on their phone to scan the QR code, scan it, and follow the prompts on the phone to complete the facial recognition authentication. Once verified, the authentication is complete.
* Choose Corporate Public Transfer Authentication
1. Fill in the company name, unified social credit code, and legal person's name, and check the agreement.
2. Fill in the corporate bank account number, the name of the bank (down to the branch), and the specific opening bank, confirm it, and then click to get the verification amount.
3. Wait for the random transfer amount to arrive, usually within 10 minutes.
4. After the transfer is successful, please verify the received random amount with finance and fill it back into this page. Once verified, the authentication is successful.
After successful authentication, you can modify the authentication information. You can only make one modification within 30 days.
# Error Handling
Source: https://docs.siliconflow.cn/en/faqs/error-code
## 1. Try to Get HTTP Error Codes to Initially Locate the Problem
a. In the code, try to print out the error codes and error messages (message). These can help you locate most of the issues.
```shell
HTTP/1.1 400 Bad Request
Date: Thu, 19 Dec 2024 08:39:19 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 87
Connection: keep-alive
{"code":20012,"message":"Model does not exist. Please check it carefully.","data":null}
```
* Common error codes and reasons:
* 400: Incorrect parameters. Please refer to the error message (message) to correct the invalid request parameters.
* 401: Incorrect API Key setting.
* 403: Insufficient permissions. The most common reason is that the model requires real-name authentication. Refer to the error message (message) for other cases.
* 429: Triggered rate limit. Refer to the error message (message) to determine which specific type of rate limit (RPM /RPD / TPM / TPD / IPM / IPD), and refer to [Rate Limits](https://docs.siliconflow.cn/rate-limits/rate-limit-and-upgradation) for specific rate limit policies.
* 504 / 503:
Generally due to high service system load, try again later.
For chat and text-to-speech requests, try using stream mode ("stream" : true). Refer to [Stream Mode](https://docs.siliconflow.cn/faqs/stream-mode).
* 500: An unknown service error. Contact relevant personnel for investigation.
b. If the client does not output the corresponding information, you can consider running the curl command in the command line (for LLM models)
```shell
curl --request POST \
--url https://api.siliconflow.cn/v1/chat/completions \
--header 'accept: application/json' \
--header 'authorization: Bearer 改成你的apikey' \
--header 'content-type: application/json' \
--data '
{
"model": "记得改模型",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128
}' -i
```
## 2. Try Using a Different Model to See if the Issue Persists
## 3. If a Proxy is Enabled, Consider Disabling the Proxy and Trying Again
## 4. Try Switching the Endpoint from api.siliconflow\.cn to api.siliconflow\.com, which has global load balancing capabilities and routes requests to the appropriate nodes based on the source
If you encounter other issues, please click on the [SiliconCloud MaaS Online Requirement Collection Form](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3) to provide feedback.
# Issuing Invoices
Source: https://docs.siliconflow.cn/en/faqs/invoice
## 1. Invoice Issuing Entity
Issuing Entity:北京硅基流动科技有限公司
## 2. Invoice Validity
Issued within 3-7 working days
## 3. Invoice Amount
Issued for the actual amount used, in the form of a VAT electronic invoice
## 4. Invoice Types
Currently, the platform only provides electronic invoices.
Corporate users can obtain VAT special invoices or VAT general invoices with the company's name;
Individual users can only obtain VAT general invoices with the individual's name.
## 5. Invoice Issuing Process
The applicant sends an email to:[finance@siliconflow.cn](mailto:finance@siliconflow.cn),The email should include the following information:
* 1. Invoice Header Name
* 2. Tax Registration Number / Unified Social Credit Code
* 3. Invoice Type: VAT Special Invoice / VAT General Invoice
* 4. SiliconCloud Registration Account
* 5. Invoice Application Content: Model API Calls / Playground Usage / Tiered Packages
Our company will query the relevant service and usage information based on the provided registration account and issue a VAT electronic invoice for the actual amount used. Generally, an invoice will be issued within 3-7 working days after receiving the invoice application (there may be delays in special cases). The invoice will be returned via email after issuance.
The invoice will be returned to the corresponding application email.
# Other Issues
Source: https://docs.siliconflow.cn/en/faqs/misc
## 1. Model Output Encoding Issues
Currently, some models are prone to encoding issues when parameters are not set. In such cases, you can try setting the parameters such as `temperature`, `top_k`, `top_p`, and `frequency_penalty`.
Modify the payload as follows, adjusting as needed for different languages:
```python
payload = {
"model": "Qwen/Qwen2.5-Math-72B-Instruct",
"messages": [
{
"role": "user",
"content": "1+1=?",
}
],
"max_tokens": 200, # 按需添加
"temperature": 0.7, # 按需添加
"top_k": 50, # 按需添加
"top_p": 0.7, # 按需添加
"frequency_penalty": 0 # 按需添加
}
```
## 2.Explanation of max\_tokens
For the LLM models provided by the platform:
* The model with a max\_tokens limit of `16384`:
* Pro/deepseek-ai/DeepSeek-R1
* Qwen/QVQ-72B-Preview
* deepseek-ai/DeepSeek-R1-Distill-Llama-70B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* The model with a max\_tokens limit of `8192`:
* Qwen/QwQ-32B-Preview
* AIDC-AI/Marco-o1
* deepseek-ai/DeepSeek-R1
* The model with a max\_tokens limit of `4096`:
* Other LLM models aside from those mentioned above
If you have special requirements, please provide feedback by clicking on the [SiliconCloud MaaS Online Requirement Collection Form](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3).
## 3.Explanation of context\_length
The context\_length varies for different LLM models. You can search for the specific model on the [Model Square](https://cloud.siliconflow.cn/models) to view the model details.
## 4. About DeepSeek-R1 and DeepSeek-V3 Model Calls Returning 429
1. `Unverified Users`: Can only make `100 requests` per day. If the daily limit of `100 requests` is exceeded, a `429` error will be returned with the message "Details: RPD limit reached. Could only send 100 requests per day without real name verification." Real name verification can be used to unlock higher rate limits.
2. `Verified Users`: Have higher rate limits, with specific values referenced in the [Model Square](https://cloud.siliconflow.cn/models).
If the request limits are exceeded, a `429` error will also be returned.
## 5. What Are the Differences Between Pro and Non-Pro Models
1. For some models, the platform provides both a free version and a paid version. The free version is named as is, while the paid version is prefixed with "Pro/" to distinguish it. The free version has fixed Rate Limits, whereas the paid version has variable Rate Limits. For specific rules, please refer to: [Rate Limits](https://docs.siliconflow.cn/cn/userguide/rate-limits/rate-limit-and-upgradation).
2. For the `DeepSeek R1` and `DeepSeek V3` models, the platform distinguishes and names them based on the payment method. The Pro version only supports payment with recharged balance, while the non-Pro version supports payment with both granted balance and recharged balance.
## 6. Are There Any Time and Quality Requirements for Custom Voice Samples in the Voice Models
* For cosyvoice2, the custom voice sample must be less than 30 seconds.
* For GPT-SoVITS, the custom voice sample should be between 3 and 10 seconds.
* For fishaudio, there are no special restrictions.
To ensure the quality of the generated voice, it is recommended that users upload a voice sample that is 8 to 10 seconds long, with clear pronunciation and no background noise or interference.
## 7. Output Truncation Issues in Model Inference
Here are several aspects to troubleshoot the issue:
* When encountering output truncation through API requests:
* Max Tokens Setting: Set the max\_token to an appropriate value. If the output exceeds the max\_token, it will be truncated. For the deepseek R1 series, the max\_token can be set up to 16,384.
* Stream Request Setting: In non-stream requests, long output content is prone to 504 timeout issues.
* Client Timeout Setting: Increase the client timeout to prevent truncation before the output is fully completed.
* When encountering output truncation through third-party client requests:
* CherryStdio has a default max\_tokens of 4,096. Users can enable the "Enable Message Length Limit" switch to set the max\_token to an appropriate value.
If you encounter other issues, please click on the [SiliconCloud MaaS Online Requirement Collection Form](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3) to provide feedback.
# Financial Issues
Source: https://docs.siliconflow.cn/en/faqs/misc_finance
## 1. How to recharge
1. Log in to the [SiliconCloud](https://cloud.siliconflow.cn/) website via your computer.
2. Click on the left sidebar "[Real-name Authentication](https://cloud.siliconflow.cn/account/authentication)" to complete the authentication.
3. Click on the left sidebar "[Balance Recharge](https://cloud.siliconflow.cn/expensebill)" to recharge.
## 2. Is there an expiration date for gifted balance
Gifted balance currently has no expiration date.
## 3. How to query usage bills
1. Log in to the [SiliconCloud](https://cloud.siliconflow.cn/) website via your computer.
2. Click on the left sidebar "[Expense Bills](https://cloud.siliconflow.cn/bills)" to view the details.
If you need an invoice, please send an email according to the [Invoice Issuance](https://docs.siliconflow.cn/faqs/invoice) guidelines, and we will issue an invoice based on your actual consumption.
## 4. Billing rules for model fine-tuning
The model fine-tuning feature is billed separately for training and inference scenarios.
To view the costs, go to [Model Fine-tuning](https://cloud.siliconflow.cn/fine-tune) - Create a new fine-tuning task, select the desired "Base Model," and the page will display the corresponding "Fine-tuning Training Price" and "Fine-tuning Inference Price."
If you encounter other issues, please click on the [SiliconCloud MaaS Online Requirement Collection Form](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3) to provide feedback.
# Rate Limits Issues
Source: https://docs.siliconflow.cn/en/faqs/misc_rate
## 1. How to increase concurrency rate limits
* The Rate Limits for all free models are fixed.
* For some models, the platform provides both a free version and a paid version. The free version is named as is; the paid version is prefixed with "Pro/" to distinguish it.
* Paid versions of models support unlocking more relaxed Rate Limits by spending a monthly amount. You can also purchase [packages](https://cloud.siliconflow.cn/package) to quickly increase the Rate Limits.
* For the DeepSeek R1 and DeepSeek V3 models, the Rate Limits are fixed.
If you encounter other issues, please click on the [SiliconCloud MaaS Online Requirement Collection Form](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3) to provide feedback.
# Model Issues
Source: https://docs.siliconflow.cn/en/faqs/misc_use
## 1. How to unlink an account
Currently, account unlinking is not available on the platform.
## 2. How to invite others
1. Log in to the [SiliconCloud](https://cloud.siliconflow.cn/) website via your computer.
2. Click on the left sidebar "[My Invitations](https://cloud.siliconflow.cn/invitation)" — "Copy Invitation Link".
3. Share the invitation information.
4. Specific information about successful invitations will be displayed on the "[My Invitations](https://cloud.siliconflow.cn/invitation)" page.
There are three invitation methods to choose from: QR code, invitation code, and invitation link.
If you encounter other issues, please click on the [SiliconCloud MaaS Online Requirement Collection Form](https://m09tqret04o.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3) to provide feedback.
# Stream Mode
Source: https://docs.siliconflow.cn/en/faqs/stream-mode
## 1. Using Stream Mode in Python
### 1.1 Stream Mode with the OpenAI Library
It is recommended to use the OpenAI library for stream mode in most scenarios.
```python
from openai import OpenAI
client = OpenAI(
base_url='https://api.siliconflow.cn/v1',
api_key='your-api-key'
)
# 发送带有流式输出的请求
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "user", "content": "SiliconCloud公测上线,每用户送3亿token 解锁开源大模型创新能力。对于整个大模型应用领域带来哪些改变?"}
],
stream=True # 启用流式输出
)
# 逐步接收并处理响应
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
### 1.2 Stream Mode with the Requests Library
If you are using the requests library for non-OpenAI scenarios, such as using the SiliconCloud API, you need to ensure that both the payload and the request parameters are set to stream mode.
```python
import requests
url = "https://api.siliconflow.cn/v1/chat/completions"
payload = {
"model": "deepseek-ai/DeepSeek-V2.5", # 替换成你的模型
"messages": [
{
"role": "user",
"content": "SiliconCloud公测上线,每用户送3亿token 解锁开源大模型创新能力。对于整个大模型应用领域带来哪些改变?"
}
],
"stream": True # 此处需要设置为stream模式
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer your-api-key"
}
response = requests.post(url, json=payload, headers=headers, stream=True) # 此处request需要指定stream模式
# 打印流式返回信息
if response.status_code == 200:
for chunk in response.iter_content(chunk_size=8192):
if chunk:
decoded_chunk = chunk.decode('utf-8')
print(decoded_chunk, end='')
else:
print('Request failed with status code:', response.status_code)
```
# Account Subject Change Agreement
Source: https://docs.siliconflow.cn/en/legals/agreement-for-account-ownership-transfer
Update Date: Feb. 12th, 2025
Before formally submitting your application for the change of account entity, please carefully read this Agreement. **This Agreement will highlight certain terms that significantly affect your rights and obligations in bold or underlined format.** If you have any questions regarding the terms of this Agreement, please consult us at [contact@siliconflow.cn](mailto:contact@siliconflow.cn). If you do not agree with the content of this Agreement, or if you are unable to accurately understand Siliconcloud platform's (hereinafter referred to as "the Platform") interpretation of the terms, please do not proceed with further actions.
By confirming and accepting this page through the website, referencing this page's link and the contents herein, signing a written agreement, or accepting this Agreement in any other manner recognized by applicable laws or customary practices, you signify that you have reached an agreement with the Platform and agree to abide by all the terms set forth in this Agreement. This Agreement shall become legally binding upon you from the effective date specified herein.
**Please ensure that you accept this Agreement and are confident that the operation to change the account entity will achieve your desired objectives, and that you are willing to accept any relevant consequences and responsibilities arising from this change, before proceeding with further actions.**
## I. Definitions and Interpretations
**1.1** "Platform Website": Refers to the website with the domain name [https://siliconflow.cn](https://siliconflow.cn).
**1.2** "Platform Account": Refers to the digital ID assigned to registered users by the Platform, hereinafter referred to as "Platform Account" or "Account."
**1.3** "Account Holder": Refers to the user who registers, holds, and uses the Platform Account. For accounts that have completed real-name verification, the Platform will determine the Account Holder based on the user's real-name verification information, unless there is contrary evidence. If the information provided by the user differs from the real-name verification entity information, the real-name verification information shall prevail. For accounts that have not completed real-name verification, the Platform will reasonably determine the Account Holder based on the information provided by the user, along with other relevant factors.
**1.4** "Change of Account Real-name Verification Entity": Refers to the change of the real-name verification entity (Original Entity) of a specific Platform Account to another real-name verification entity (New Entity), hereinafter referred to as "Change of Account Entity" in this Agreement.
**1.5** The "Change of Account Entity" procedure and consequences under this Agreement shall only apply to situations where the Change of Account Entity is initiated by the application of the Original Entity and accepted by the New Entity for the Platform Account.
## II. Agreement Entity, Content, and Effectiveness
**2.1** This Agreement constitutes the terms reached between the account holder of a specific account on this Platform (referred to as “you” or “Original Entity”) and the Platform regarding the transfer of rights and obligations under the previously signed “SiliconCloud Platform Product User Agreement” related to your application for the change of account entity, as well as related matters.
**2.2 This Agreement is a conditional agreement that shall only take effect legally for you and the Platform when the following four conditions are simultaneously met:**
2.2.1 The account for which you are applying for a change has completed real-name verification, and you are the verified entity;
2.2.2 The Platform has reviewed and approved your application for the change of account entity;
2.2.3 You are applying to transfer the rights and obligations of the account to a third party (referred to as “New Entity”), and the new entity agrees to continue to perform the corresponding rights and obligations in accordance with the provisions of the SiliconCloud Platform Product User Agreement;
2.2.4 The New Entity is exclusively a corporate entity and cannot be a natural person.
**2.3 All matters related to the transfer of resources under the account, including products, services, funds, rights, and obligations (collectively referred to as “Resources under the Account”), shall be separately agreed upon between you and the New Entity. However, in the event of any conflict between your agreement with the New Entity and the provisions of this Agreement, the provisions of this Agreement shall prevail. **
### III. Conditions and Procedures for Change
**3.1** The Platform will only accept applications for the change of account entity that meet the following conditions:
3.1.1 The Original Entity needs to change the account entity due to reasons such as merger, division, restructuring, dissolution, or death;
3.1.2 A change of account entity is required according to effective legal documents such as judgments, rulings, awards, or decisions;
3.1.3 The actual holder of the account is inconsistent with the entity verified for the account, and clear evidence is provided;
3.1.4 A change of account entity is required under applicable laws and regulations;
3.1.5 Other circumstances that the Platform determines, after careful consideration, warrant a change of account entity.
**3.2** To initiate a change of account entity, you must follow the following procedural requirements:
3.2.1 You should submit the application for change of account entity under the Platform Account for which you are applying;
3.2.2 The Platform has the right to conduct secondary verification via mobile phone, facial recognition, and may require you to provide authorization proof (when you initiate the change request through the account manager) and other materials deemed necessary by the Platform to confirm that the application for change of account entity is indeed your intention;
3.2.3 You must agree to the terms of this Agreement and accept that this Agreement is legally binding on you;
3.2.4 You must comply with any other rules and regulations of the Platform related to the change of account entity.
**3.3 You understand and agree that:**
**3.3.1 Before the New Entity confirms acceptance and completes real-name verification, you may withdraw or cancel the change of account entity process;**
**3.3.2 Once the New Entity confirms acceptance and completes real-name verification, the Platform will not support your request for withdrawal or cancellation;**
**3.3.3 You are obligated to assist the New Entity in completing the transfer of account management rights;**
**3.3.4 During the period of changing the real-name verification entity, all login and operational actions under this account will be considered your actions, and you should be aware of and assume the operational risks associated with the account.**
**3.4 You understand and agree that if any of the following circumstances are discovered, the Platform has the right to terminate the change of account entity process at any time or take appropriate measures:**
**3.4.1 A third party has filed a complaint against the account that has not yet been resolved;**
**3.4.2 The account is under investigation by national regulatory authorities;**
**3.4.3 The account is involved in litigation, arbitration, or other legal proceedings;**
**3.4.4 There exist cooperative relationships associated with the Original Entity’s identity concerning credit relationships or partnerships with the Platform;**
**3.4.5 Other circumstances that may harm national or social interests, or infringe upon the rights of the Platform or third parties;**
**3.4.6 The account has disputes arising from frequent changes or unclear account ownership.**
## IV. Effects of Change of Account Entity
**4.1** When your application for the change of account entity is approved by the Platform, and the New Entity confirms and completes real-name verification, the account entity will be successfully changed, with the success of the change based on the records of the Platform’s system. Upon successful change, the following consequences will apply to you:
**4.1.1 The rights associated with your account will be transferred to the newly verified entity, including but not limited to control over the account, services activated under the account, and any unused funds in the account;**
4.1.2 The ownership of the account and all resources associated with it will be fully transferred to the New Entity. **However, the Platform reserves the right to terminate any cooperative agreements made by the Original Entity with the Platform regarding preferential policies, credit relationships, partnerships, or other related matters, or any associations with other accounts on the Platform; **
**4.1.3 The Platform will not accept requests from you to transfer one or more services or rights associated with this account to any other account you designate, citing agreements with the New Entity or for any other reason;**
**4.1.4 The Platform reserves the right to refuse your request to revoke the change of account entity on the grounds of a dispute with the New Entity or for any other reason; **
**4.1.5 The Platform has the right to take appropriate measures to ensure that the New Entity obtains actual management rights over the account in the event of a dispute or disagreement regarding account management rights between you and the New Entity.**
**4.2 You understand and acknowledge that the change of account entity does not exempt or lessen your responsibilities for all actions and liabilities related to the account prior to the change:**
**4.2.1 You will remain responsible for all actions that occurred under the account prior to the change of account entity;**
**4.2.2 You will also be jointly liable for any contracts and other matters that were established prior to the change and continue to be performed after the change, as well as for the New Entity’s actions and consequences arising from its performance after the change.**
## V. Rights and Obligations of Both Parties
**5.1** You hereby promise and guarantee that:
5.1.1 The information you fill out and the materials you submit during the change of account entity process are true, accurate, and valid, and do not contain any misleading or potentially misleading behavior that could lead the Platform to agree to accept the application for the change of account entity;
5.1.2 You will not use the Platform’s account entity change service for any activities that violate laws, regulations, departmental rules, or national policies, or infringe upon the rights of any third parties;
**5.1.3 Your actions in changing the account entity will not place the Platform in a position of breach of contract or illegality. The Platform shall not bear any responsibility for disputes, controversies, losses, infringements, or liabilities arising from the change of account entity beyond those expressly stipulated by law. Furthermore, if the aforementioned reasons cause any losses to the Platform, you shall be liable to compensate the Platform accordingly. **
**5.2** You understand and agree that:
5.2.1 The Platform has the right to request you to provide written materials or other evidence at any time after you initiate your application, demonstrating your authority to perform the change of account entity operation;
5.2.2 The Platform reserves the right to determine, based on its prudent judgment, whether your application complies with relevant laws, regulations, or policies and the provisions of the account agreement. If there are any illegal, non-compliant, or otherwise inappropriate circumstances for the change, the Platform has the right to refuse;
5.2.3 The Platform has the right to record relevant information regarding the account entity before and after the real-name verification change, including account entities, transaction records, contracts, etc., in order to comply with legal requirements and protect its legitimate rights and interests;
5.2.4 If you violate the provisions of Section 5.1 of this Agreement, the Platform has the right to terminate the account entity change process immediately upon discovery, or revoke the completed change of account entity operation, restoring the account entity to its pre-change status.
## VI. Supplementary Provisions
6.1 You understand and accept that the conclusion, execution, interpretation, and dispute resolution of this Agreement shall be governed by the laws of the People's Republic of China. Any provisions that are inconsistent with or conflict with legal regulations shall be deemed non-binding.
6.2 In the event of any disputes arising from the content or execution of this Agreement, both parties shall engage in friendly consultations; if consultations fail, either party may file a lawsuit in the competent People's Court located in the jurisdiction of the defendant.
6.3 If this Agreement is inconsistent or in conflict with any terms previously signed by both parties or any relevant statements made by the Platform, the provisions of this Agreement shall prevail.
**You hereby guarantee that you have fully read and understood the above “Account Subject Change Application Agreement,” and you voluntarily agree to formally proceed with the subsequent process of changing the account entity, accepting the binding nature of the above terms.**
# Privacy Policy
Source: https://docs.siliconflow.cn/en/legals/privacy-policy
Update Date:Feb. 7th, 2025
Welcome to Siliconcloud, a high-value GenAI open platform operated by Beijing Silicon Flow Technology Co., Ltd. and its affiliates (“SiliconFlow” or “we”). We take the protection of user (“you”) information very seriously. When you register, log in, or use [https://siliconflow.cn/zh-cn/siliconcloud](https://siliconflow.cn/zh-cn/siliconcloud) (the “Platform”), we collect information that you actively provide based on your use of this platform as well as information generated during your use of our services collected through automated means, collectively referred to as “User Information.” We will collect, use, store, transfer, and protect your User Information in accordance with the provisions of this Privacy Policy. If our services contain links to third-party websites, applications, or services, this Policy does not apply to any products, services, websites, or content provided by third parties. If your company or other operating entity utilizes our products or services to provide services to your customers, you must establish your own User information protection policy that complies with the transaction scenario. We hope to introduce to you how we handle your User information through this Privacy Policy. Before you start using our services, please carefully read and understand this Policy, paying particular attention to the provisions we have highlighted in bold, to ensure that you fully understand and agree before proceeding. If you do not agree with this Privacy Policy, you should immediately stop using the services. By choosing to use the services, you are deemed to accept and acknowledge our processing of your relevant information in accordance with this Privacy Policy.
# Overview
This Privacy Policy will help you understand:
1. How we collect and use your User Information
2. Our use of cookies and similar technologies
3. How we store your User Information
4. How we share, transfer, and publicly disclose your information
5. How we protect the security of your information
6. How we manage your User Information
7. Terms for the use of minors
8. Revisions and notifications regarding the Privacy Policy
9. Scope of application
## 1. How We Collect and Use Your User Information
### 1.1 We Actively Collect Your User Information
**To ensure your normal use of our platform and to the extent permitted by law, We will collect the user information you actively provide in the following scenarios and business activities when using our services, as well as the user information generated during your use of our services through automated means, including but not limited to the personal information you provide. Please note that if the information cannot identify your personal identity on its own or when combined with other information and is unrelated to you, it does not constitute your personal information in the legal sense; when your information can identify your personal identity either on its own or when combined with other information, or when data that we are unable to link to any specific User is used in conjunction with other User Information, such information will be processed and protected as your User Information under this Privacy Policy during the period of combined use. It should be clarified that personal information does not include information that has been anonymized.**
**1.1.1** When You Register, Authenticate, and Log In to Your Platform Account
When you register an account on our Platform, you may create an account using your mobile phone number. We will verify the validity of your identity by sending an SMS verification code, and the collection of this information is to assist you in completing registration and logging in. If you log in to the Platform using an account from another platform, you authorize us to obtain relevant information from your other platform account, such as account/account information from third-party platforms like WeChat (including but not limited to your name, profile picture, and any other information you authorize).
**1.1.2** When You Subscribe to or Activate a Service
Before you subscribe to or activate any service we provide, we are required by the laws and regulations of Mainland China (excluding Hong Kong, Macau, and Taiwan) to perform real-name verification on you.
(1) For Individual Users: You may need to provide your true identity information, including your full name, ID number, front and back photos of your ID, your China UnionPay Type I Bank Account Number Issued by Member Institutions or credit card number, and the mobile phone number registered with the bank etc. to complete real-name verification.
(2) For Entity Users: You may need to provide information about your entity, including the entity name, Unified Social Credit Code, authorization letter for account registration (with official seal), registration/qualification certificate of the legal representative or organization (certificate types include business license, organization code certificate, institution legal person certificate, social group legal person registration certificate, administrative law enforcement entity qualification certificate, etc.), bank name, bank account number (UnionPay bank account or credit card number), legal representative or authorized person’s name, ID number, front and back photos of their ID, and a photo of the legal representative’s ID etc. to complete real-name verification. Additionally, you may need to provide personal information of a corporate contact, including name, phone number, and email etc. We may use this information to verify your identity and may use it to promote or introduce services, send business notifications, issue invoices, or communicate with you for business purposes. If the information you provide contains third-party personal information or User Information, you agree and guarantee that you have obtained authorization from the relevant rights holder before providing such information to us.
(3) During the above real-name verification process, if you complete real-name verification through facial recognition, you will need to provide biometric information of your facial features and authorize us to verify this information through a national, authoritative, and trusted identity verification institution.
**1.1.3** When You Use the Service
(1) We are committed to providing you with a secure and reliable product and service environment. Providing high-quality and reliable services and information is our core goal. Meanwhile, we ensure the stable operation of our products and services and protect the legitimate interests of you, other users, or the public. Therefore, we collect necessary information for maintaining the safe and stable operation of our products and services.
(2) When you browse or use this platform, to ensure the normal operation and security of the website and services, prevent risks from cyber-attacks or intrusions, and more accurately identify violations of laws, regulations, or relevant agreements and service rules of this platform, we may collect your device information, such as resolution, time zone, and language settings, network access method, and type, as well as browsing history. Such information is essential for us to provide and ensure the normal operation and network security of our services.
(3) To enhance your experience and ensure the security of your use, we may record network log information, usage frequency, crash data, usage conditions, and related performance data on this platform and its associated services.
(4) When you participate in surveys or lottery activities on this platform, the platform may retain information such as your account ID, name, address, phone number, job title, and product and service usage information. This information will be used to contact you, verify your identity, and provide rewards (if applicable) according to the rules of the specific activity. In cases where the rules of specific surveys or prize draw conflict with this agreement, the activity rules shall prevail.
(5)We may collect user consultation records, fault reporting records, and troubleshooting processes (such as communication or call records) generated from your use of this platform and related services. We will record and analyze this information to respond to your help requests more promptly and to improve our services.
(6)Contract information: If you need to apply for offline delivery or conduct product testing, please contact [contact@siliconflow.cn](mailto:contact@siliconflow.cn).
(7)In order to provide you with domain name services, we will collect the domain holder's name, contact person's name, mailing address, region, postal code, email address, landline/mobile number, identification number, and ID photo in accordance with relevant requirements of the Ministry of Industry and Information Technology. You understand and authorize us and third-party domain service providers to use this information to provide you with domain name services.
(8)To provide you with certificate center services, we will collect the contact person's name, email, mobile number, company name, city, and address of the company in accordance with requirements from digital certificate certification authorities. You understand and authorize us and third-party certificate service providers to use this information to provide you with certificate center services.
(9)You acknowledge and agree that, during your use of products and/or services, we may send notifications to one or more of your contact methods (i.e., phone number and email) for purposes such as user message notifications, identity verification, security verification, and user experience surveys; in addition, we may send commercial information about services, functions, or activities that you may be interested in via text messages or phone calls to the phone numbers collected in the aforementioned process. However, rest assured that if you do not wish to receive this information, you can unsubscribe via text message or email reply, or contact us directly to unsubscribe.
### 1.2 We may obtain User Information from third parties.
In order to provide you with better, superior, and more personalized services, or to jointly provide services, or to prevent internet fraud, our affiliated companies and partners may share your Information with us based on legal regulations, agreements with you, or your consent. We will make every commercial effort to protect your User Information in accordance with relevant laws and regulations and/or as required by the identity verification function.
### 1.3 Processing of changes to the purposes of collecting and using User Information
Please understand that as our business develops, the functions or services we provide may be adjusted. In principle, when new functions or services are related to those we currently provide, the collection and use of User Information will be directly or reasonably related to the original processing purpose. Only in scenarios where there is no direct or reasonable relation to the original processing purpose, we will inform you again about the collection and use of your User Information in accordance with legal regulations and national standards through page prompts, interactive processes, and agreement confirmations.
### 1.4 Business and customer data
Please understand that your business and customer data differ from User Information. This platform will handle your business and customer data as follows:
**1.4.1** The data you input, provide feedback on, correct, process, store, upload, download, distribute, and handle through other means (collectively referred to as "process") via the services provided by this platform (excluding third - party services) are your business and customer data ("interaction data"), and you have full ownership of your interaction data.. As a neutral technology service provider, the technical services provided by this platform will only process your interaction data strictly in accordance with your instructions. Unless otherwise provided by laws and regulations, otherwise agreed upon in accordance with specific product rules, or when providing you with technical assistance at your request for troubleshooting or resolving technical issues, we will not access your interaction data, nor will we engage in any unauthorized use or disclosure of your interaction data.
**1.4.2** You are responsible for the source and content of your interaction data. We advise you to carefully assess the legality of the data’s source and content. You must ensure that you have the right to authorize this platform to process this interaction data through technical services. The processing must comply with relevant laws and regulations. There should be no illegal, rule - breaking, or rights - infringing acts, and no breach of contracts with third parties. Also, the interaction data must not be used for illegal or improper purposes. If any issues arise due to the content of your interaction data, or your actions of processing the data or authorizing this platform to do so, which violate laws, regulations, departmental rules, or national policies, you will be solely responsible for all resulting consequences and liabilities.
**1.4.3** Subject to the provisions of the preceding paragraph, for any personal information contained in any data, including interaction data, obtained by this platform from the information you provided, you shall, in accordance with the law, fulfill the obligation of prior notice to the relevant personal information subjects, obtain the separate consent of the relevant personal information subjects, and ensure that:
(1) You provide written explanation and confirmation regarding the source and legality of the personal Information in the manner required by us;
(2) Upon our request, you provide the scope of authorization and consent for the processing of personal Information, including the purpose of use, and that the personal Information subjects consent to your use of this platform to process their personal Information;
(3) If the personal Information processing activities you need to carry out using this platform and related services exceed the scope of authorization consent for such personal Information, you are responsible for obtaining the explicit consent of the personal Information subjects within a reasonable period after providing the personal Information or before we process the personal Information, and you shall provide written proof to us upon our request.
You understand and agree that, unless the above conditions and other legal requirements are met, you may not provide us with interaction data that contains personal Information. If you breach the above obligations, fail to provide reasonably satisfactory proof as required, or if we receive complaints or reports from personal Information subjects, we reserve the right, at our sole discretion, to refuse the transmission of your related data (including by limiting relevant service features, freezing, deactivating, or reclaiming accounts as appropriate) or to refuse to process relevant personal Information and related data according to your instructions. You shall bear all resulting liability in such cases.
**1.4.4** You understand and agree that you are responsible for storing your interaction data according to your own requirements. We only provide data storage services as required by relevant laws and regulations or as stipulated in specific service rules (for example, there is a specific agreement between you and our data center for the storage of your business and customer data). You understand and further agree that, unless otherwise provided by laws and regulations or as agreed in the service rules, we have no obligation to store your interaction data , and we will not assume any responsibility for your data storage efforts or outcomes.
## 2. Use of Cookies and Similar Technologies
Cookies and similar technologies are commonly used technologies on the internet. When you use this platform, we may use related technologies to send one or more cookies or anonymous identifiers to your device to collect and store your account information, search history, and login status information. Cookies and similar technologies help you avoid repetitive steps and processes of filling in account information and entering search content, and also help us improve service efficiency and enhance login and response speed.
You can refuse or manage cookies through your browser settings. However, please note that if you disable cookies, you may not be able to enjoy the best service experience, and the availability of certain features may be affected. We promise that we will not use your User Information collected through cookies or similar technologies for any purposes other than those described in this privacy policy.
## 3. How We Store Your User Information
### 3.1 Location of Information Storage
For the sake of service professionalism, we may delegate affiliated companies or other legal entities to provide you with one or more specific services on this platform. In accordance with legal regulations, we will store User Information collected and generated during the operation of this website and related services within the territory of the People's Republic of China.
\###3.2 Duration of Information Storage
**3.2.1** We will retain your User Information only for the duration necessary to provide this platform and related services. However, you understand and acknowledge that the necessary storage period may vary based on different services and their functional requirements. The criteria we use to determine the storage period include:
(1) The time required to retain User Information to achieve the business purpose, including providing services, maintaining relevant transaction and business records as required by law, ensuring the security of systems and services, and responding to potential user inquiries or complaints, and problem resolution;
(2) A longer retention period agreed upon by the user;
(3) Special requirements for retaining User Information as stipulated by laws, contracts, etc.
**3.2.2** We will retain the relevant information until you withdraw your authorization, delete, or cancel your account. After the necessary period has expired, we will delete or anonymize your information. If there are legal regulations mandating retention, even if you cancel your account or request the deletion of your User Information, we may be unable to delete or anonymize your User Information.
## 4. How We Share, Transfer, and Disclose Your Information
### 4.1 Partners Involved in Data Use
**4.1.1** Principles
(1) Legality Principle: Data use activities involving partners must have legitimate purposes and comply with the legal basis for legality. If a partner's use of information no longer conforms to the legality principle, they should not use your User Information or should do so only after obtaining the appropriate basis for cooperation.
(2) Legitimate and Minimal Necessity Principle: Data use must have a legitimate purpose and should be limited to what is necessary to achieve that purpose.
(3) Security and Prudence Principle: We will carefully assess the purposes for which partners use data, conduct a comprehensive evaluation of these partners' security capabilities, and require them to adhere to cooperation legal agreements. We will implement strict security monitoring of the software development kits (SDK) and application programming interfaces (API) used by partners to protect data security.
**4.1.2** Entrusted Processing
In scenarios involving the entrusted processing of User Information, we will sign relevant processing agreements with the entrusted partners in accordance with legal regulations and supervise their activities related to the use of User Information.
**4.1.3** Joint Processing
In scenarios involving joint processing of User Information, we will sign relevant agreements with partners according to legal regulations and specify each party's rights and obligations to ensure compliance with legal provisions during the use of relevant User Information and to protect data security.
**4.1.4** Scope of Partners
If specific functions and scenarios involve services provided by our affiliated parties or third parties, the scope of partners includes our affiliated parties and third parties.
### 4.2 Scenarios of Joint Processing or Entrusted Processing of User Information
**4.2.1** Certain specific modules or functions in this platform and related services are provided by partners. You understand and agree that in our cooperation with any partners, we will only provide your user information to them within the minimum scope necessary for service provision, based on the principles of legality, justness, necessity, and security - conscious prudence, and we will make efforts to ensure that partners comply with this privacy policy and other appropriate confidentiality and security measures we require, committing not to use your information for any other purposes.
**4.2.2** To provide better services, we may entrust partners to offer services to you, including but not limited to customer service, payment functions, real-name authentication, and technical services. Therefore, to provide services, we may share certain information with partners. For example:
(1) For user real-name authentication, when you use the identity verification function or related services, it may be necessary to complete real-name authentication to verify your identity according to relevant laws and security requirements. During the real-name authentication process, the certification service organization we cooperate with may need to use your real name, ID number, and phone number, etc..
(2) The payment function is provided to you by third - party payment institutions that cooperate with us. To offer this function, the third - party payment institutions may use your name, bank card type, card number, expiration date, ID number, mobile phone number, etc.
(3) To promptly handle your complaints, suggestions, and other requests, our customer service providers (if any) may need to use your account information and details related to the events in question, so as to understand, address, and respond to relevant issues in a timely manner.
**4.2.3** Data Usage for Service Security and Analysis(1) Ensuring Usage Security: We highly value the security of accounts and services. To protect your and other users' account and asset security and ensure that your and our lawful rights and interests are not compromised, our partners and we may use essential device, account, and log information.(2) Service Usage Analysis: To analyze how our services are used and enhance user experience, our partners and we may collect statistical data on your service usage, such as crash or shutdown data, which cannot readily identify or be linked to your identity.
\###4.3 User Information Transfer
We will not transfer your User Information to any other third party, except in the following cases:
**4.3.1** We may provide a transfer pathway upon your written request and in compliance with national cybersecurity department requirements.
**4.3.2** With your explicit consent, we may transfer your User Information to other third parties.
**4.3.3** In cases of platform operational changes, mergers, acquisitions, or bankruptcy liquidation involving the transfer of User Information, we will inform you of the situation as required by law and request that the new entity holding your information continue to comply with this Privacy Policy or meet security standards no lower than those stipulated in this Privacy Policy. Otherwise, we will require the company or organization to re-obtain your authorization and consent. In cases of bankruptcy without a data successor, we will delete your information.
### 4.4 Disclosure of User Information
**4.4.1** In principle, we will not publicly disclose your User Information unless we have obtained your explicit consent or are required to do so under national laws and regulations.
(1) With your explicit consent or based on your voluntary choices, we may publicly disclose your User Information.
(2) To protect your or the public's personal or property safety, we may disclose your User Information in compliance with applicable laws or platform-related agreements and rules.
**4.4.2** Exceptions to Authorization and ConsentPlease understand that in the following situations, we may collect and use your User Information without first obtaining your authorization and consent, in accordance with laws, regulations, and relevant national standards:
(1) When it is necessary for fulfilling legal obligations.
(2) When it is directly related to national security or national defense.
(3) When it is directly related to public safety, public health, or significant public interests.
(4) When it is directly related to criminal investigation, prosecution, trial, and enforcement of judgments.
(5) When it is necessary to protect your or others' major lawful interests, such as life or property, and it is difficult to obtain your consent.
(6) When you have made your Information public to the public yourself.
(7) When it is necessary for concluding or fulfilling a contract based on the User Information subject's request.
(8) When Information is collected from legally disclosed sources, such as legitimate news reports or government disclosures.
(9) When necessary to maintain the secure and stable operation of software and related services, such as detecting and handling software and service failures.
(10) When necessary for lawful news reporting.
(11) When necessary for academic research institutions conducting statistical or academic research in the public interest, and when the results are provided publicly in a manner that anonymizes any personal Information.
(12) Other circumstances provided by laws and regulations.
Please take note that if information cannot individually or in combination with other information identify your personal identity, it does not constitute your personal Information in the legal sense. When your information, either alone or in combination with other information, can identify your personal identity, during the period of combined use, such information will be treated as your user information and protected in accordance with this Privacy Policy.
## 5.How We Protect the Security of Your Information
We place a high priority on user information security and strive to implement reasonable security measures (both technical and managerial) to protect your information from unauthorized access, disclosure, misuse, modification, damage, loss, or leakage. We will use encryption technologies, anonymization, and other feasible means that meet industry standards to safeguard your information, employing security mechanisms to minimize the likelihood of malicious attacks.
Dedicated personnel and systems are in place to ensure your information security. We follow strict data usage and access controls. Despite taking effective measures and adhering to legal standards, please understand that due to technical limitations and the potential for malicious actions, absolute security cannot be guaranteed in the internet industry, and we will make every effort to ensure the security of the information you provide to us. You acknowledge and understand that the system and communication networks you use to access our services may be affected by factors beyond our control. Therefore, we strongly recommend you take proactive measures to protect user information security, such as using complex passwords, regularly changing passwords, and not disclosing account passwords to others.
We have developed emergency response plans and will promptly activate them in the event of a user information security incident to prevent the spread of potential harm. If a user information security incident occurs (such as a leak or loss), we will inform you in a timely manner according to legal requirements, including the basic situation and possible impact of the incident, actions we have taken or will take, suggestions for self-protection and mitigation, and remedial measures. We will notify you via push notifications, emails, letters, or text messages. If it is difficult to notify each individual, we will release an announcement in a reasonable and effective manner. Additionally, we will report the handling of user information security incidents to relevant regulatory authorities as required.
We remind you that the user information protection measures outlined in this Privacy Policy apply only to this platform and related services. Once you leave this platform, browsing or using other websites, products, services, or content resources, we cannot protect any information you submit on software or websites outside of our platform, regardless of whether such websites or software were accessed via links or guidance from this platform.
## 6. How We Manage Your User Information
We highly value the management of User Information and legally protect your rights to access, copy, correct, supplement, delete, withdraw consent, cancel your account, file complaints, and make reports regarding your information, thereby allowing you to safeguard your privacy and information security.
### 6.1 Your Rights in User Information Processing Activities
**6.1.1** Generally, you can access, copy, correct, supplement, view, modify, or delete the User Information you have provided.
**6.1.2** You may request the deletion of your User Information in the following circumstances:
(1) If the purpose for processing has been achieved, cannot be achieved, or is no longer necessary to achieve.
(2) If our User Information processing activities violate legal regulations.
(3) If we have collected or used your User Information without obtaining your consent.
(4) If our User Information processing activities violate our agreement with you.
(5) If we have stopped providing products or services, or if the storage period of User Information has expired.
(6) If you have withdrawn your consent authorization.
(7) If we no longer provide you with services.
(8) Other circumstances stipulated by laws and administrative regulations.
### 6.2 Withdrawing or Changing the Scope of Your Authorized Consent
**6.2.1** You understand and agree that each service requires certain essential User Information to be completed. Besides the collection of essential User Information for business functions, you may choose to withdraw your authorization or change the scope of your authorization. You may also withdraw all authorization for us to continue collecting your User Information by canceling your account.
**6.2.2** You understand and agree that after you withdraw consent or authorization, you will not be able to continue using the services associated with the withdrawn consent or authorization, and this platform will no longer process your corresponding User Information. However, your decision to withdraw consent or authorization will not affect the prior processing of User Information based on your authorization.
### 6.3 How to Obtain a Copy of Your User Information
We will provide you with copies of the following types of User Information upon your written request: your basic information and user identity information. However, please note that the copies provided to you will be limited to the information we have directly collected.
### 6.4 Responding to Your Requests
You are entitled to cancel your account, file reports, or submit complaints. To ensure security, you may need to provide a written request and additional proof of your identity. For reasonable requests, we will generally not charge fees. However, for repeated requests or those that exceed reasonable limits, we may charge a certain cost, depending on specific circumstances. For requests that are without basis, require excessive technical means (such as developing new systems or fundamentally changing existing practices), infringe on the legal rights of others, or are impractical (e.g., information stored on backup tapes), we may refuse to comply.
You understand and acknowledge that we may be unable to respond to your request in the following situations:
(1) When the request is related to fulfilling our legal obligations.
(2) When it is directly related to national security or defense.
(3) When it is directly related to public safety, public health, or major public interests.
(4) When it is directly related to criminal investigation, prosecution, trial, and judgment enforcement.
(5) When we have sufficient evidence that the User Information subject has malice or abuse of rights.
(6) When it is difficult to obtain consent for the protection of the life, property, or other significant lawful interests of the User Information subject or other individuals.
(7) When responding to the request, it would seriously impair the lawful rights and interests of the User Information subject or other individuals and organizations.
(8) When it involves commercial secrets.
### 6.5 Notification of Business Cessation
If we cease to operate, we will stop collecting your User Information and notify you of the cessation by individually notifying you or through feasible commercial means, such as a public announcement, and delete or anonymize your User Information in our possession.
## 7.Terms of Use for Minors
Our services are primarily targeted at enterprises and related organizations. Minors (under 14 years of age) should not create accounts or use this platform and its services. If we find that user information has been provided without prior verifiable consent from the guardian, upon written notification from the minor's guardian, we will attempt to delete the relevant information as soon as possible.
## 8. Revisions and Notifications of the Privacy Policy
To provide better services, this platform and related services will be periodically updated and adjusted. We may revise this Privacy Policy in a timely manner, and these revisions constitute part of the Privacy Policy and carry the same legal effect. However, without your explicit consent, we will not reduce the rights you are entitled to under the currently effective Privacy Policy.
After updates to the Privacy Policy, we will publish the updated version on this platform and notify you of the updated terms before they become effective via website announcements or other appropriate means, so that you are aware of the latest version of this Privacy Policy in a timely manner. If you continue to use this platform and related services, it will be deemed that you agree to the revised Privacy Policy in its entirety.
For significant changes, we will provide more prominent notifications (including, but not limited to, emails, SMS, system messages, or special reminders on the browsing page) to explain the specific changes in the Privacy Policy.
Significant changes in this Privacy Policy include, but are not limited to:
(1) Major changes in our service model, such as changes in the purpose of User Information processing, the type of User Information processed, and how User Information is used.
(2) Major changes in ownership structure, organizational structure, etc., such as business restructuring, bankruptcy, and mergers and acquisitions.
(3) Changes in the main recipients of User Information transfer, transmission, or public disclosure.
(4) Major changes in your participation rights in User Information processing and the methods of exercising these rights.
(5) Changes to our contact methods and complaint channels.
\##9. Scope of Application
This Privacy Policy applies to products, services, solutions provided on this platform, and any other products, services, or solutions that may be periodically introduced by the company and included within the scope of services.
This Privacy Policy does not apply to third-party products or services provided on this platform that are governed by separate privacy policies and are not incorporated into this Privacy Policy. Your use of these third-party services (including any User Information you provide to these third parties) will be subject to the terms of service and privacy policies of these third parties (and not this Privacy Policy). You should make relevant requests, complaints, and reports through mechanisms established by these third parties, as specified in their policies. Please protect your User Information carefully and only provide it to third parties when necessary.
It is particularly noted that, as a user of this platform, if you use the technical services of this platform to further provide services to your users, the data generated from your business cooperation with your customers belongs to you. You should independently agree on relevant privacy policies with your users. This privacy policy does not serve as a substitute for the privacy policy between you and your users.
# User Agreement
Source: https://docs.siliconflow.cn/en/legals/terms-of-service
Update Date: Feb. 12th, 2025
This is an agreement (**“Agreement”**) between you and Beijing Silicon Flow Technology Co., Ltd. and its affiliates (**“SiliconFlow” or “we”**). You confirm that before you start a trial or purchase products or services from our **SiliconCloud** platform (**“Platform”**), you have fully read, understood, and accepted all terms of this Agreement. **By choosing “Agree” and starting to use this service or completing the purchase process, you indicate your agreement to comply with all provisions of this Agreement. If you do not meet the aforementioned conditions, you should immediately terminate your registration or stop using this service.** If you have signed any other legal documents with us regarding your use of the services on this Platform, the conflicting parts of this Agreement shall not apply to you.**For the detailed data usage policy of this platform, please refer to the "Privacy Policy".**
## 1. Account Management
**1.1** You guarantee that you have capacity for civil rights and capacity for civil conduct as stipulated by law, and are a natural person or legal person capable of independently assuming civil liability. The content of this agreement will not be prohibited by the laws of the country or region where you belong. **You guarantee that you have capacity for civil rights and capacity for civil conduct as stipulated by law, and are a natural person or legal person capable of independently assuming civil liability. The content of this agreement will not be prohibited by the laws of the country or region where you belong.**
**1.2 Account**
1.2.1 After you fill in relevant information as required by this platform and confirms and agrees to perform the content of this agreement, we will register an account for You and open the usage rights of this platform. Your account is only for your own use and enables You to access certain services and functions. We may modify and maintain these services and functions from time to time according to our independent judgment.
1.2.2 An individual may access and use this platform on behalf of a company or other entity. In this case, this agreement is not only effective between us and this individual, but also between us and such company or entity.
1.2.3 If you connect/access this service through a third party, it indicates that you allow us to access and use your information and store your login credentials and access tokens.
1.2.4 **Account Security.** When you create an account, you have the right to log in to this platform with the mobile phone number set or confirmed by you and the password set by you. **We recommend that you use a strong password (a password composed of upper- and lower-case letters, numbers and symbols) to protect your account.** Your account is set and kept by you. At no time will this platform actively ask you for your account password. Therefore, it is recommended that you take good care of your account. **If the account is lost due to your active disclosure or your being attacked or defrauded by others, we will not be responsible. You should recover compensation from the infringer through judicial, administrative and other remedy approaches.** You provide us with your email address as your effective contact information, which means that you agree that we use this email address to send relevant notifications to you. Please pay close attention in time.
**1.3 Changes, Suspensions and Terminations. If we have made our best efforts to provide prior notice in advance through one or more of the means such as platform announcements, in - site messages, emails or text messages, we may change, suspend or terminate the services provided to you, or set usage restrictions on the services without being liable. We can deactivate your account at any time. Even after your account is terminated for any reason, you will still be bound by this agreement.**
**1.4** When there are clear legal requirements stipulating that this platform, as a platform service provider, must verify users' information, this platform will check and verify your information from time to time in accordance with the law. You shall cooperate and provide the latest, true, complete and effective information. **If this platform is unable to verify based on the information provided by you, this platform may send you a notice of inquiry or request for rectification and require you to conduct re-authentication until the provision of some or all platform services to you is suspended or terminated. This platform shall not bear any responsibility.**
**1.5** You shall be responsible for your own interactions, activities, exchanges and communications with other users. We reserve the right to supervise disputes between you and other users. We shall not bear any responsibility for the interactions between you and other users and the acts or omissions of any users, including responsibility related to user content (as defined below).
## 2. Access to Services and Service Restrictions
**2.1** Access to Services. Subject to your compliance with this agreement, you are hereby granted a non-exclusive and non-transferable right to access and use this service only for your personal use or for the internal business purposes of the company or other entity represented by you. We reserve all rights not expressly granted in this agreement.
**2.2 Service Restrictions**
2.2.1 Disassemble, reverse engineer, decode or decompile any part of the service;
2.2.2 Use any content on or provided through this service (including any title information, keywords or other metadata) for any machine learning and artificial intelligence training or development purposes, or for any technology intended to identify natural persons;
2.2.3 Purchase, sell or transfer API keys without prior written consent from us;
2.2.4 Copy, rent, sell, loan, transfer, license or attempt to sublicense, resell, distribute, modify any part of this service or any intellectual property of us (as defined below);
2.2.5 Take any action that may place an unreasonably heavy load on ours servers, infrastructure, etc.
**2.2.6 The platform service be used in any of the following ways or for the following purposes: (i) Opposing the basic principles established by the Constitution; (ii) Endangering national security, disclosing state secrets, subverting state power, and undermining national unity; (iii) Damaging national honor and interests; (iv) Inciting regional discrimination and regional hatred; (v) Inciting ethnic hatred and ethnic discrimination and undermining national unity; (vi) Violating national religious policies and promoting cults and feudal superstitions; (vii) Spreading rumors, disrupting social order and undermining social stability; (viii) Spreading pornographic, obscene, gambling, violent, murderous, terrorist or abetting criminal content; (ix) Insulting or slandering others and infringing upon the legitimate rights and interests of others; (x) Inciting illegal assemblies, associations, marches, demonstrations and gatherings to disrupt social order; (xi) Acting in the name of illegal non-governmental organizations; (xii) Non-personal works that may involve copyright disputes; (xiii) May infringe upon the prior rights of others; (xiv) Conducting violent intimidation and threats against others and conducting cyber manhunts; (xv) Involving the privacy, personal information or data of others; (xvi) Infringing upon the legitimate rights and interests such as the privacy right, reputation right, portrait right and intellectual property right of others; (xvii) Infringing upon the legitimate rights and interests or harming the physical and mental health of minors; (xviii) Secretly photographing or recording others without permission and infringing upon the legitimate rights of others; (xix) Violating the “seven bottom lines” requirements, namely the bottom line of laws and regulations, the bottom line of the socialist system, the bottom line of national interests, the bottom line of citizens' legitimate rights and interests, the bottom line of social public order, the bottom line of moral fashion and the bottom line of information authenticity; (xx) Prohibited by relevant laws, administrative regulations, etc.;**
2.2.7 Circumvent the measures that We may use to prevent or restrict access to the service, including but not limited to preventing or restricting the use or copying of any content or restricting the functionality of the service or any part thereof;
2.2.8 Attempt to interfere with, damage the system integrity or security of the server running the service, or decipher any transmission between the server running the service;
2.2.9 Use this service to send spam, chain letters or other unsolicited emails;
2.2.10 Transmit illegal data, viruses or other software agents through this service;
2.2.11 Impersonate another person or entity, misstate your relationship with a person or entity, conceal or attempt to conceal your identity, or use this service for any intrusive or fraudulent purpose in any other way;
2.2.12 Collect or obtain from this service any personal information, including but not limited to the names of other users.
2.2.13 Other acts without the express authorization of us or usage methods that may damage the interests of us.
## 3. User Content
**3.1** This service may allow users, after registration and for the purpose of using the platform, to input, provide feedback, make corrections, process, store, upload, download, and distribute relevant personal profile information, videos, images, audio, comments, questions, and other content, files, data, and information ("User Content") during the use of the model.**For the detailed data usage policy, please refer to the "Privacy Policy" of this platform.**
**3.2** If any User Content violates laws, regulations or this Agreement, we have the right to delete such User Content.
**3.3** Regarding Your user content, You confirm, declare and warrant:
\*\*3.3.1 You have obtained the written consent of each identifiable natural person (if any) mentioned in the user content and can legally use the name, voice and image of such natural person in the way envisaged by this agreement, and such natural person has exempted You from any liability that may arise from such use;
3.3.2 You have obtained all consents and authorizations related to third parties required by applicable law for the user content, and the user content provided by You for this service or uploaded to the platform does not infringe any rights of any third party;
3.3.3 Your user content, and the use of the user content by this platform according to this agreement, will not violate any applicable law or infringe upon any rights of any third party, including but not limited to any intellectual property rights and privacy rights.
3.3.4 Your user content does not include any information or materials regarded as sensitive or confidential by government agencies, and the user content provided by You for this service does not infringe any confidentiality rights of any third party.
3.3.5 You will not upload or provide through this service, directly or otherwise, any personal information of children under 14 years old.\*\*
**3.3.6** Your user content does not include nude or other sexually suggestive content; do not include hate speech, threats or direct attacks on individuals or groups; do not include abusive, harassing, infringing, defaming, vulgar, obscene or privacy-infringing content; do not include gender-discriminatory or racial, ethnic or other discriminatory content; do not include content containing self-harm or excessive violence; do not include forged or impersonated profiles; do not include illegal content or content that promotes harmful or illegal activities; do not include malicious programs or codes; do not include any personal information of anyone without their consent; do not include spam, machine-generated content or unsolicited information and other offensive content.
**3.3.7** To the best of your knowledge, all user content and other information provided by You to us are true and accurate.
**3.4** As an independent technical supporter, this platform shall not be held responsible for any losses arising therefrom. All user content, obligations, and liabilities resulting from your use of the large - scale model accessed through this platform shall be borne by you.
**3.5** As an independent technical supporter, this platform shall not be liable for any losses incurred. When you use this platform to provide services to any third party, you shall assume all corresponding rights, obligations, and responsibilities.
**3.6** Disclaimer. We are not responsible for any user content . You shall be fully responsible for the user content you input, provide feedback on, correct, process, store, upload, download, and distribute on this platform and the model service. The technical services provided by this platform will only process your user content in strict accordance with your instructions. Unless otherwise provided by laws and regulations, agreed upon according to specific product rules, or at your request to provide you with technical assistance for troubleshooting or resolving technical issues, we will not access your user content. You understand and acknowledge that we and this platform only act as passive technical supporters or channels for user content. We have no obligation to store user content, nor will we use or disclose your user content without authorization. At the same time, we only use your user content on the basis of compliance with laws and regulations and for the purpose of providing you with the services of this platform.
## 4. Intellectual Property Rights
**4.1** Definition. For the purposes of this Agreement,“intellectual property”means all patent rights, copyrights, personality rights, trademark rights, goodwill, trade secret rights, technologies, information, materials, etc., as well as any intellectual property and ownership that may exist or may exist in the future, and all applications, registered and renewed intellectual property under applicable laws.
**4.2** Intellectual Property Rights for SiliconFlow. You understand and acknowledge that We own and will continue to own all rights (including intellectual property rights) to this service. You shall not access, sell, license, rent, modify, distribute, copy, transmit, display, publish, adapt, edit or create derivative works of any such intellectual property. It is strictly prohibited to use any intellectual property for any purpose not expressly permitted by this agreement. Rights not expressly granted to You in this agreement shall be reserved by SiliconFlow.
**4.3** Output. You may use the results generated by the large model on the basis of your compliance with the following and in accordance with laws and regulations:(i) Your use of the service and the output will not transfer or infringe any intellectual property rights (including infringing the intellectual property rights of Silicone - based Flow and those of other third parties);(ii) If, at our discretion, we consider that your use of the output violates laws and regulations or may infringe the rights of any third party, we may restrict your use of the output at any time and require you to cease using the output (and delete any copies thereof);(iii) You shall not represent that the output of the large - language model is human - generated;(iv) You shall not violate any licensing or usage restrictions of the model provider.
You agree that we shall not be liable to you or any third party for any output content or results claimed to have arisen from the technical services provided by us.
\*\*4.4 User Usage Data. We may collect, or you may provide to us, information related to diagnosis, technology, and usage, including information about your computer, mobile device, system, and software ("User Usage Data"). We may, as necessary for the maintenance and operation of the platform and within the scope permitted by law, use, maintain, and process User Usage Data or any part thereof, including but not limited to: (a) providing and maintaining the services; (b) improving our products or services or developing new products and services.For the detailed data policy, please refer to the Privacy Policy. \*\*
**4.5** Feedback. If You provide us with any suggestions or feedback regarding this service or any other SiliconFlow product or service (“Feedback”), then You hereby assign all rights and interests in the Feedback to us, and We may freely use the Feedback and any ideas, know-how, concepts, technologies, and intellectual property contained therein. Feedback is considered as confidential information of us (as defined below).
## 5. Confidential Information
This service may include non-public, proprietary or confidential information of SiliconFlow and other users (“Confidential Information”). Confidential Information includes any information that should reasonably be understood as confidential based on the nature and circumstances of disclosure, including non-public business, product, technical and marketing information. You will: (a) protect the privacy of all Confidential Information with at least the same degree of care as You protect its own highly sensitive information, but in no event less than a reasonable degree of care; (b) not use any Confidential Information for any purpose other than exercising your rights or fulfilling your obligations under this agreement; and (c) not disclose any Confidential Information to any individual or entity.
## 6. Billing Policy
You understand and agree that certain services provided by this platform may be subject to usage fees, after - sales fees, or other charges ("Fees"). By choosing to use the service, you signify your agreement to the pricing and payment terms applicable to you as stated on the website where you registered (subject to our pricing/payment terms/recharge agreements and other documents updated from time to time). You agree that we may monitor your usage data accordingly to complete the billing for the service. The pricing, payment terms, and recharge agreements are hereby incorporated into this agreement by reference.
You agree that we may add additional fees for new products and/or services, increase or modify the fees for existing products and/or services, set different price fees according to your actual place of use, and/or discontinue any service at any time. Without our written consent or other relevant policies of this platform, the payment obligation, once incurred, is non - cancellable, and the paid fees will not be refunded. You will be responsible for paying all taxes related to your use/activation of the service, if there are any government - required taxes.
If you have any questions regarding the purchase of the service, you can contact us at [contact@siliconflow.cn](mailto:contact@siliconflow.cn).
## 7. Privacy and Data Security
**7.1** Privacy. Based on the information ("user information") that you actively provide to this platform when registering and subscribing to relevant services, and to ensure your normal use of the related services on this platform, we may collect, organize, and use the user information you provide. However, we will continuously comply with the Personal Information Protection Law of the People's Republic of China and other relevant applicable laws.
**7.2** Data Security. We are concerned about the integrity and security of your personal information. However, We cannot guarantee that unauthorized third parties will never be able to breach our security protection measures.
## 8. Use of Third-Party Services
This service may contain links to third-party websites, materials and services (“third-party services”) not owned or controlled by us. Certain functions of this service may require you to use third-party services. We do not endorse or assume any responsibility for any third-party services. If you access third-party services through this service or shares your user content on any third-party service, you will do so at your own risk, and you understand that this agreement does not apply to your use of any third-party service. You expressly release us from all liability arising from your access to and use of any third-party service.
## 9. Indemnification
You will defend, indemnify and hold harmless us and our subsidiaries and affiliates and their respective agents, suppliers, licensors, employees, contractors, officers and directors (“SiliconFlow as the Indemnified Party”) from and against any and all claims, damages (whether direct, indirect, incidental, consequential or otherwise), obligations, losses, liabilities, costs, debts and expenses (including but not limited to legal fees) arising from: (a) Your access to and use of this service, including your use of any output; (b) Your violation of any provision of this agreement, including but not limited to your violation of any representations and warranties set forth in this agreement; (c) Your infringement of any third-party rights, including but not limited to any privacy rights or intellectual property rights; (d) Your violation of any applicable law; (e) User content or any content submitted through your user account, including but not limited to any misleading, false or inaccurate information; (f) Your willful or grossly negligent misconduct; or (g) Any third party's access to and use of this service using your username, password or other authentication credentials.
## 10. Disclaimer
You use this service at your own risk. We expressly disclaim any express, implied or statutory warranties, conditions or other terms, including but not limited to warranties, conditions or other terms relating to merchantability, fitness for a particular purpose, design, condition, performance, usefulness, ownership and non-infringement. We do not guarantee that the service will operate without interruption or error, nor do we guarantee that all errors will be corrected. In addition, We do not guarantee that the service or any equipment, system or network related to the use of the service will not be subject to intrusion or attack.
For any content downloaded or otherwise obtained through the use of this service, the risk of acquisition is borne by you. You shall be fully responsible for any damage to your computer system or mobile device and any data loss due to the above circumstances or due to your access to and use of this service. In addition, SiliconFlow does not provide warranties, endorsements, guarantees, recommendations or assume responsibility for any products or services advertised or provided by any third party through this service or any hyperlinked website or service. SiliconFlow does not participate in or monitor in any way any transactions between you and third-party product or service providers.
## 11. Limitation of Liability and Disclaimer
SiliconFlow shall not be liable in any case for the following damages: (a) indirect, incidental, exemplary, special or consequential damages; or (b) loss or damage of data, or business interruption or loss; or (c) loss of revenue, profit, goodwill or expected sales or revenue, under any law, whether such damages are caused by the use or inability to use the software or other products, even if SiliconFlow has been informed of the possibility of such damages. The total liability of SiliconFlow and its affiliates, officers, directors, employees, agents, suppliers and licensors to You (whether for warranty, contract or tort (including negligence)) arising from any cause or manner of acting shall never exceed the fees that you have paid to SiliconFlow. Nothing in this agreement shall limit or exclude liability that cannot be limited or excluded under applicable law.
## 12. Applicable Law and Dispute Resolution Clause
This agreement is governed by the laws of the People's Republic of China (for the purposes of this agreement only, excluding Hong Kong Special Administrative Region, Macao Special Administrative Region and Taiwan region).
In the event of a dispute during the implementation of this agreement, both parties shall resolve it through timely negotiation. If negotiation fails, either you or us have the right to submit the dispute to the Beijing Arbitration Commission for arbitration in accordance with its then effective arbitration rules, and these arbitration rules are incorporated into this agreement by this clause. The language of arbitration is Chinese. The place of arbitration will be Beijing. The arbitration award is final and binding on both parties.
## 13. Other Terms
**13.1** Transferability. Without the prior express written consent of us, you may not assign or transfer this agreement and any rights and licenses granted hereunder, but we may assign this agreement without restriction . Any transfer or assignment in violation of this agreement is void.
**13.2** Severability. If a provision of this agreement or a part of a provision is invalid or unenforceable, it does not affect the validity of other provisions of this agreement. The invalid or unenforceable provision will be deemed to have been deleted from this agreement.
**13.3** Revision from Time to Time. In accordance with changes in relevant laws and regulations and the operational needs of SiliconFlow, We will revise this agreement from time to time. The revised agreement will replace the pre-revised agreement. When using the service of this platform, you can consult and understand in a timely manner. If you continue to use this service, it will be deemed as consent to the revised content. In the event of a relevant dispute, the latest user agreement shall prevail. In the case that you do not agree to the revised content, you have the right to stop using the services involved in this agreement.
# Release notes
Source: https://docs.siliconflow.cn/en/release-notes/overview
### Platform Service Adjustment Notice
To ensure the quality of platform services and the rational allocation of resources, the following adjustments to Rate Limits policies are now in effect:
1. Adjustments
New RPH Limit (Requests Per Hour, Per Hour Requests)
* Model Scope:deepseek-ai/DeepSeek-R1, deepseek-ai/DeepSeek-V3
* Applicable Users: All users
* Limit Standard: 30 requests/hour
2.New RPD Limit (Requests Per Day, Per Day Requests)
* Model Scope: deepseek-ai/DeepSeek-R1, deepseek-ai/DeepSeek-V3
* Applicable Users: Users who have not completed real-name authentication
* Limit Standard: 100 requests/day
Please note that these policies may be adjusted at any time based on traffic and load changes. Silicon Flowing Reserves the right to interpret these policies.
#### 1. Model Offline notice
To provide more stable, high-quality, and sustainable services, the following models will be offline on **February 27, 2025**:
* [meta-llama/Meta-Llama-3.1-405B-Instruct](https://cloud.siliconflow.cn/models?target=meta-llama/Meta-Llama-3.1-405B-Instruct)
* [google/gemma-2-27b-it](https://cloud.siliconflow.cn/models?target=google/gemma-2-27b-it)
* [google/gemma-2-9b-it](https://cloud.siliconflow.cn/models?target=google/gemma-2-9b-it)
* [Pro/google/gemma-2-9b-it](https://cloud.siliconflow.cn/models?target=Pro/google/gemma-2-9b-it)
* [01-ai/Yi-1.5-34B-Chat-16K](https://cloud.siliconflow.cn/models?target=01-ai/Yi-1.5-34B-Chat-16K)
* [01-ai/Yi-1.5-6B-Chat](https://cloud.siliconflow.cn/models?target=01-ai/Yi-1.5-6B-Chat)
* [01-ai/Yi-1.5-9B-Chat-16K](https://cloud.siliconflow.cn/models?target=01-ai/Yi-1.5-9B-Chat-16K)
* [stabilityai/stable-diffusion-3-medium](https://cloud.siliconflow.cn/models?target=stabilityai/stable-diffusion-3-medium)
If you are using any of these models, it is recommended to migrate to other models available on the platform as soon as possible.
### Platform service adjustment notice
#### DeepSeek-V3 model prices have been restored to the original price starting from Beijing time February 9, 2025, at 00:00.
Specific prices:
* Input: ¥2/M Tokens
* Output: ¥8/M Tokens
### Inference model output adjustment notice
The display of the reasoning chain in the inference model will be separated into a separate reasoning\_content field from the content field. This change is compatible with the OpenAI and DeepSeek API specifications, making it easier for various frameworks and upper-layer applications to trim the conversation in multi-round dialogues. For more details, see the Inference Model [(DeepSeek-R1) Usage](English/capabilities/reasoning).
### Platform service adjustment notice
#### Support for deepseek-ai/DeepSeek-R1 and deepseek-ai/DeepSeek-V3 Models
The specific pricing is as follows:
* `deepseek-ai/DeepSeek-R1` Input:¥4/ M Tokens Output: ¥16/ M Tokens
* `deepseek-ai/DeepSeek-V3`
* From February 1, 2025, to February 8, 2025, 24:00 Beijing Time, enjoy a limited-time discount price:Input:¥2¥1/ M Tokens Output:¥8¥2/ M Tokens,The original price will be restored from February 9, 2025, 00:00.
### Platform service adjustment notice
#### Image and Video URL Validity Period Adjusted to 1 Hour
To continue providing you with more advanced and high-quality services, the validity period of image and video URLs generated by large models will be adjusted to 1 hour starting from January 20, 2025.
If you are currently using the image and video generation service, please make sure to back up the files in time to avoid any business disruptions due to URL expiration.
### Platform service adjustment notice
#### LTX-Video Model Will Start Charging
To continue providing you with more advanced and high-quality services, the platform will start charging for video generation requests using the Lightricks/LTX-Video model starting from January 6, 2025, at a rate of 0.14 yuan per video.
### Platform service adjustment notice
#### 1.New Global Access API Endpoint Added
A new global access API endpoint has been added: [https://api.siliconflow.com](https://api.siliconflow.com). If you encounter network connection issues while using the original endpoint [https://api.siliconflow.cn](https://api.siliconflow.cn), it is recommended to switch to the new endpoint.
### Platform service adjustment notice
#### 1. Model Offline notice
To provide more stable, high-quality, and sustainable services, the following models will be offline on December 19, 2024:
* [deepseek-ai/DeepSeek-V2-Chat](https://cloud.siliconflow.cn/models?target=deepseek-ai/DeepSeek-V2-Chat)
* [Qwen/Qwen2-72B-Instruct](https://cloud.siliconflow.cn/models?target=Qwen/Qwen2-72B-Instruct)
* [Vendor-A/Qwen/Qwen2-72B-Instruct](https://cloud.siliconflow.cn/models?target=Vendor-A/Qwen/Qwen2-72B-Instruct)
* [OpenGVLab/InternVL2-Llama3-76B](https://cloud.siliconflow.cn/models?target=OpenGVLab/InternVL2-Llama3-76B)
If you are using any of these models, it is recommended to migrate to other models available on the platform as soon as possible.
### Platform service adjustment notice
#### 1. Model offline notice
To provide more stable, high-quality, and sustainable services, the following models will be offline on December 13, 2024:
* [Qwen/Qwen2.5-Math-72B-Instruct](https://cloud.siliconflow.cn/models?target=Qwen/Qwen2.5-Math-72B-Instruct)
* [Tencent/Hunyuan-A52B-Instruct](https://cloud.siliconflow.cn/models?target=Tencent/Hunyuan-A52B-Instruct)
* [nvidia/Llama-3.1-Nemotron-70B-Instruct](https://cloud.siliconflow.cn/models?target=nvidia/Llama-3.1-Nemotron-70B-Instruct)
If you are using any of these models, it is recommended to migrate to other models available on the platform as soon as possible.
### Platform service adjustment notice
#### 1. Model offline notice
To provide more stable, high-quality, and sustainable services, the following models will be offline on November 22, 2024:
* [deepseek-ai/DeepSeek-Coder-V2-Instruct](https://cloud.siliconflow.cn/models?target=deepseek-ai/DeepSeek-Coder-V2-Instruct)
* [meta-llama/Meta-Llama-3-70B-Instruct](https://cloud.siliconflow.cn/models?target=meta-llama/Meta-Llama-3-70B-Instruct)
* [meta-llama/Meta-Llama-3-8B-Instruct](https://cloud.siliconflow.cn/models?target=meta-llama/Meta-Llama-3-8B-Instruct)
* [Qwen/Qwen2-57B-A14B-Instruct](https://cloud.siliconflow.cn/models?target=Qwen/Qwen2-57B-A14B-Instruct)
* [Pro/internlm/internlm2\_5-7b-chat](https://cloud.siliconflow.cn/models?target=Pro/internlm/internlm2_5-7b-chat)
* [Pro/meta-llama/Meta-Llama-3-8B-Instruct](https://cloud.siliconflow.cn/models?target=Pro/meta-llama/Meta-Llama-3-8B-Instruct)
* [Pro/THUDM/chatglm3-6b](https://cloud.siliconflow.cn/models?target=Pro/THUDM/chatglm3-6b)
* [Pro/01-ai/Yi-1.5-9B-Chat-16K](https://cloud.siliconflow.cn/models?target=Pro/01-ai/Yi-1.5-9B-Chat-16K)
* [Pro/01-ai/Yi-1.5-6B-Chat](https://cloud.siliconflow.cn/models?target=Pro/01-ai/Yi-1.5-6B-Chat)
If you are using any of these models, it is recommended to migrate to other models available on the platform as soon as possible.
#### 2.Email login method update
To further enhance service experience, the platform will update the login method starting from November 22, 2024: from the original "email account + password" method to an "email account + verification code" method.
#### 3. New Overseas API Endpoint
A new endpoint for overseas users has been added: [https://api-st.siliconflow.cn](https://api-st.siliconflow.cn). If you encounter network connection issues while using the original endpoint [https://api.siliconflow.cn](https://api.siliconflow.cn), it is recommended to switch to the new endpoint.
### Partial Model Pricing Adjustment Notice
To provide more stable, high-quality, and sustainable services, the [Vendor-A/Qwen/Qwen2-72B-Instruct model](https://cloud.siliconflow.cn/models?target=17885302571), which was previously offered for free, will start charging from October 17, 2024. The pricing details are as follows:
* Limited-time discount price:¥ 1.00 / M tokens
* Original price:¥ 4.13 / M tokens(the original price will be restored at a later date)
# Community Scenarios and Applications
Source: https://docs.siliconflow.cn/en/usercases/awesome-user-cases
# SiliconCloud Scenarios and Application Cases
Easily integrate SiliconCloud platform large model capabilities into various scenarios and application cases.
{/* ### 1. Application Integration */}
{/* */}
{/*
SiliconCloud Team
SiliconCloud Team
SiliconCloud Team
SiliconCloud Team
*/}
{/*
Cherry Studio Team
Chatbox Team
*/}
{/* */}
### 1. Translation Scenarios Usage
SiliconCloud Team
沧海九粟
ohnny\_Van
mingupup
行歌类楚狂
### 2. Search and RAG Scenarios Usage
MindSearch Team
LogicAI
白牛
沧海九粟
### 3. Coding Scenarios Usage
xDiexsel
野原广志2\_0
### 4. Analysis Scenarios Usage
行歌类楚狂
### 5. Communication Scenarios Usage
大大大维维
### 6. Image Generation Scenarios Usage
mingupup
baiack
糯.米.鸡
### 7. Usage Evaluation
真知浩见
湖光橘鸦
自牧生
### 8. Open Source Projects
郭垒
laughing
### 9. Others
mingupup
郭垒
free-coder
三千酱
# Using in 302.AI
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-302ai
## 1 About 302.AI
302.AI is a pay-as-you-go AI application platform that provides a wide range of AI online applications and comprehensive AI API access. Recently, 302.AI has collaborated with SiliconCloud to allow 302.AI users to directly access all SiliconCloud models within the 302 platform without additional charges; and also allows SiliconCloud users to directly use ready-to-use AI applications within the 302 platform without developing or deploying them themselves.
### 1.1 Access 302.AI Website or Client
* [Website](https://302.ai/)
* [Client Download](https://302.ai/download/) Register an account after entering.
If you have an account, log in directly.
## 2 Configuring SiliconCloud Model Services in 302.AI
### 2.1 Creating a Chatbot
1. Log in to the 302.AI management backend via the website or client, and click through the following steps: Use Robots → Chatbots → Models.
2. Scroll down to the SiliconCloud section, choose a model (e.g., deepseek-ai/deepseek-vl2), and click Confirm → Create Chatbot.
3. After creation, the chatbot will be displayed below the page. You can further choose Chat, Share, Edit, etc. operations.
#### 2.2 Using the Chatbot
1. Enter the chatbot and start a conversation by typing text in the input box. The button on the left side of the input box supports uploading images or files, choose according to the model's characteristics.
2. Click the Settings button at the bottom left of the interface to enable the chatbot's Real-time Preview Function and see the model-generated code's runtime effects in real-time.
#### 2.3 Using in the All-Purpose Toolbox
In addition to the method of creating a chatbot, you can also use SiliconCloud models via the All-Purpose Toolbox:
1. Click All-Purpose Toolbox → Quick Use.
2. Click:\
Chatbot → App Store → Silica Flow, select the model, and you can start the conversation.
### 3. Using SiliconCloud Models in the Model Arena
#### 3.1 Creating a Model Arena
In the management backend menu, select Use Tools → Tool Supermarket → Tool Efficiency → Model Arena, and click Create after opening.
#### 3.2 Selecting Models for Competition
After entering the model arena, scroll down to find SiliconCloud and check the desired models as needed. After checking, enter a prompt to see the responses from different models side by side on the right side of the page.
### 4. Accessing SiliconCloud Models via API
(For language models as an example)
#### 4.1 Viewing Documentation
Click API Supermarket, select Language Large Models under the category, and find SiliconCloud.
#### 4.2 Online Debugging
1. Click View Documentation to enter the API documentation.
2. After entering the API documentation, click Online Debugging → Set Variable Values to confirm if the API KEY has been automatically assigned.
3. Fill in the Model ID and Text Content according to the parameter template, click Send, and wait for the output results.
# Using in DB-GPT
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-DB-GPT
## 1.About DB-GPT
[DB-GPT](https://github.com/eosphoros-ai/DB-GPT) is an open-source AI-native data framework with AWEL (Agentic Workflow Expression Language) and Agents.
The goal is to build infrastructure for the large model domain, through the development of multiple capabilities such as Multi-Model Management (SMMF), Text2SQL performance optimization, RAG framework and optimization, multi-agents framework collaboration, and AWEL (intelligent orchestration). This makes it easier and more convenient to build data model applications around databases.
## 2.Obtain API key
2.1. Open the [SiliconCloud website](https://cloud.siliconflow.cn/) and register an account (if you have an existing account, log in directly).
2.2. After completing the registration, go to the [API Key page](https://cloud.siliconflow.cn/account/ak) to create API the future use.
## 3.Deploy DB-GPT
### 3.1 Clone the DB-GPT Source Code
```bash
git clone https://github.com/eosphoros-ai/DB-GPT.git
```
### 3.2 Create a Virtual Environment and Install Dependencies
```bash
# cd 到 DB-GPT 源码根目录
cd DB-GPT
# DB-GPT 要求python >= 3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
# 这里选择代理模型类依赖安装
pip install -e ".[proxy]"
```
### 3.3 Configure basic environment variables
```bash
# 复制模板 env 文件为 .env
cp .env.template .env
```
### 3.4 Modify the environment variables file .env to configure siliconCloud models
```bash
# 使用 SiliconCloud 的代理模型
LLM_MODEL=siliconflow_proxyllm
# 配置具体使用的模型名称
SILICONFLOW_MODEL_VERSION=Qwen/Qwen2.5-Coder-32B-Instruct
SILICONFLOW_API_BASE=https://api.siliconflow.cn/v1
# 记得填写您在步骤2中获取的 API Key
SILICONFLOW_API_KEY={your-siliconflow-api-key}
# 配置使用 SiliconCloud 的 Embedding 模型
EMBEDDING_MODEL=proxy_http_openapi
PROXY_HTTP_OPENAPI_PROXY_SERVER_URL=https://api.siliconflow.cn/v1/embeddings
# 记得填写您在步骤2中获取的 API Key
PROXY_HTTP_OPENAPI_PROXY_API_KEY={your-siliconflow-api-key}
# 配置具体的 Embedding 模型名称
PROXY_HTTP_OPENAPI_PROXY_BACKEND=BAAI/bge-large-zh-v1.5
# 配置使用 SiliconCloud 的 rerank 模型
RERANK_MODEL=rerank_proxy_siliconflow
RERANK_PROXY_SILICONFLOW_PROXY_SERVER_URL=https://api.siliconflow.cn/v1/rerank
# 记得填写您在步骤2中获取的 API Key
RERANK_PROXY_SILICONFLOW_PROXY_API_KEY={your-siliconflow-api-key}
# 配置具体的 rerank 模型名称
RERANK_PROXY_SILICONFLOW_PROXY_BACKEND=BAAI/bge-reranker-v2-m3
```
Note: The SILICONFLOW\_API\_KEY, PROXY\_HTTP\_OPENAPI\_PROXY\_SERVER\_URL, and RERANK\_PROXY\_SILICONFLOW\_PROXY\_API\_KEY environment variables are the API Keys you obtained in step 2. The language model (SILICONFLOW), Embedding model (PROXY\_HTTP\_OPENAPI\_PROXY\_BACKEND), and rerank model (RERANK\_PROXYICONFLOW\_PROXY\_BACKEND) can be obtained from [Get User Models List - SiliconFlow](https://docs.siliconflow.cn/api-reference/models/get-model-list).
### 3.5 Start DB-GPT service
```bash
dbgpt start webserver --port 5670
```
Open the address [http://127.0.0.1:5670/](http://127.0.0.1:5670/) in your browser to access the deployed DB-GPT.
## 4.Use SiliconCloud models via DB-GPT python SDK
### 4.1 Install the DB-GPT Python Package
```bash
pip install "dbgpt>=0.6.3rc2" openai requests numpy
```
To facilitate subsequent verification, install the related dependencies additionally.
### 4.2. Use the large language model from SiliconCloud
```python
import asyncio
import os
from dbgpt.core import ModelRequest
from dbgpt.model.proxy import SiliconFlowLLMClient
model = "Qwen/Qwen2.5-Coder-32B-Instruct"
client = SiliconFlowLLMClient(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_alias=model
)
res = asyncio.run(
client.generate(
ModelRequest(
model=model,
messages=[
{"role": "system", "content": "你是一个乐于助人的 AI 助手。"},
{"role": "human", "content": "你好"},
]
)
)
)
print(res)
```
### 4.3 Use the embedding model from SiliconCloud
```python
import os
from dbgpt.rag.embedding import OpenAPIEmbeddings
openai_embeddings = OpenAPIEmbeddings(
api_url="https://api.siliconflow.cn/v1/embeddings",
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-large-zh-v1.5",
)
texts = ["Hello, world!", "How are you?"]
res = openai_embeddings.embed_documents(texts)
print(res)
```
### 4.4 Use the rerank model from SiliconCloud
```python
import os
from dbgpt.rag.embedding import SiliconFlowRerankEmbeddings
embedding = SiliconFlowRerankEmbeddings(
api_key=os.getenv("SILICONFLOW_API_KEY"),
model_name="BAAI/bge-reranker-v2-m3",
)
res = embedding.predict("Apple", candidates=["苹果", "香蕉", "水果", "蔬菜"])
print(res)
```
## 5. Hands-on guide
For a data conversation example, data conversation capabilities involve natural language interaction with structured and semi-structured data, which can assist in data analysis and insights. Below are the specific operational steps:
### 1. Add data sources
First, select the data on the left side. Add a database, currently, DB-GPT supports various database Choose the corresponding database type to add. Here, we use MySQL as a demonstration. The test data for the demonstration can be found in the \[test examples]([https://github.com/eosphoros-ai/DB-GPT/tree/main/docker/examples/sqls)](https://github.com/eosphoros-ai/DB-GPT/tree/main/docker/examples/sqls)).
### 2. Select conversation type
Select the ChatData conversation type.
### 3. Start data conversation
Note: When conversing, select the corresponding model and database. DB-GPT also provides preview and edit modes.
编辑模式:
# Using in Bob Translation
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-bob
## 1. About Bob
[Bob](https://bobtranslate.com) is a translation and OCR software for macOS that you can use in any application for quick and efficient translation and OCR. It is simple, fast, and effective!
This article will introduce how to use the API services provided by SiliconCloud to perform translations in Bob.
## 2. Installing Bob
Go to the Mac App Store to install Bob. [Install on Mac App Store](https://apps.apple.com/cn/app/id1630034110)
## 3. Using SiliconCloud in Bob
### 3.1 Default Configuration
After installing Bob, select any text in any application and press the `⌥` `D` shortcut to translate. SiliconCloud’s free model will be used as the default translation service, as shown in the image below.
### 3.2 Using Other Free Models from SiliconCloud
The default model used is `Qwen/Qwen2.5-7B-Instruct`. You can **right-click** the service icon in the top-right corner of the translation window to go to the "Translation - Services" page and switch to other free models.
As shown in the image below, the models marked as **Free** can be used directly.
### 3.3 Using Other Text Generation Models from SiliconCloud
To use models that are not marked as free, you need to obtain a SiliconCloud API Key.
1. Go to the [SiliconCloud official website](https://cloud.siliconflow.cn/) and register an account (or log in if you already have one).
2. After registering, open the [API Keys](https://cloud.siliconflow.cn/account/ak) page and create a new API Key. Click to copy the key for future use.
3. Go to the previously mentioned "Translation - Services" page in Bob, paste the API Key into the **SiliconFlow Translation** service’s API Key setting, then switch to the desired model and click save to start using it.
# Using in Chatbox
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-chatbox
## 1 About Chatbox
Chatbox is a popular full-platform chat client for large language models, featuring powerful functionality and easy installation. You can use it to connect to various large language models and chat with AI on any device (computer, mobile phone, web).
Chatbox not only provides simple and user-friendly AI chat functions but also offers a series of powerful features:
* Artifact Preview: In Chatbox, you can preview the actual effects of code generated by AI, such as having AI create a web page or a Snake game, and then run it directly in Chatbox.
* Chart Creation: Let AI draw mind maps, flowcharts, and statistical charts.
Document Understanding and Graphic Visualization: You can send documents or images to AI.
* Webpage Parsing and Recognition: You can send links to AI to discuss webpage content.
## 2 Installing and Using Chatbox
Visit the [Chatbox official](https://chatboxai.app/) website to download the installation package via browser.
Chatbox supports all mainstream operating systems, including Windows, MacOS, and Linux, as well as mobile systems iOS and Android. After downloading the installation package, install it directly in the system. Alternatively, you can also access and use the web version of Chatbox.
## 3 Using the SiliconCloud Model in Chatbox
### 3.1 Configuring SiliconCloud API Key
Visit the [API Key](https://cloud.siliconflow.cn/account/ak) page to create or copy an existing key.
### 3.2 Configuring in Chatbox
#### 3.2.1 Open Chatbox and Enter Settings
#### 3.2.2 Create a Custom Model Provider
First, click the "Model Provider" switch button, then click "Add Custom Provider" at the bottom of the pop-up menu.
#### 3.2.3 Configure SiliconCloud Access Information
Fill in the SiliconCloud access configuration in the opened form:
* Name (e.g., SiliconCloud for easy reference later)
* API Domain: [https://api.siliconflow.cn/](https://api.siliconflow.cn/)
* API Path: /v1/chat/completions
* API Key: Fill in the API key created in the SiliconCloud backend
* In the model input box, add the model you want to use (e.g., Qwen/Qwen2.5-7B-Instruct), you can find all SiliconCloud model options on the [Model Square](https://cloud.siliconflow.cn/models)
* Click Save to start chatting.
### 3.2.4 Start Chatting
After following the above steps, the configuration should be basically complete. Test a simple chat to ensure everything is working.
### 3.3 Tips for Using Chatbox
Here are some tips for using Chatbox.
#### 3.3.1 Utilize Chatbox's Chart Capability to Generate Visual Charts in Chats
Chatbox's "Make Charts" assistant can generate various charts, making it easier to understand data in chats.
Note: For better results, choose a smarter and more powerful model. The model's capabilities will directly determine the quality of the charts.
#### 3.3.2 Utilize Chatbox's Artifact Preview Function to View the Running Effect of AI-Generated Code
Chatbox's Artifact Preview function allows you to directly preview the actual running effect of AI-generated frontend code.
Note: For better results, choose a smarter and more powerful model. The model's capabilities will directly determine the quality of the generated code.
Apart from these tips, Chatbox has many powerful features hidden behind its simple and user-friendly interface, with many places to explore.
## 4 参考资料
* [Chatbox Official Website](https://chatboxai.app/)
* [How to Integrate SiliconCloud in Chatbox - A Super Simple Complete Tutorial](https://bennhuang.com/posts/chatbox-siliconcloud-integration-guide/)
# Using in ChatHub
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-chathub
## About ChatHub
[ChatHub](https://chathub.gg/en) is a popular large language model aggregation plugin that allows you to chat with multiple models simultaneously, making it easy to compare responses. ChatHub has hundreds of thousands of active users worldwide.
## Installing ChatHub
Open the [ChatHub official website](https://chathub.gg/en) in your browser and click the "Add to Chrome" button to install the ChatHub browser extension:

Once installed, the ChatHub settings page will automatically open.
## Using the SiliconCloud Model in ChatHub
1、In the ChatHub settings, find the “Custom Bots” section and click the “Add” button.

2、In the pop-up window, proceed with the following steps:
1. Enter a bot name.
2. Select SiliconFlow as the provider.
3. Enter the SiliconFlow key.
4. Fill in any model supported by SiliconFlow.

3、Click “Confirm,” and the model will be successfully configured.

4、Start chatting.

## Multi-Model Comparison in ChatHub
You can repeat the steps above to add other models in ChatHub. Then, you can use ChatHub's All-in-One feature to chat with multiple models simultaneously (up to 6 models at once):

In addition to the core comparison feature, ChatHub also offers powerful tools like a prompt library and code preview. For more information, check out the [ChatHub official documentation](https://doc.chathub.gg/introduction).
# Using in Cherry Studio
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-cherry-studio
## 1 About cherry studio
Developers can visit the [Github](https://github.com/kangfenmao/cherry-studio) project link to star ⭐️ the open-source project to support it.
🍒 Cherry Studio is a desktop client that supports multiple model services, featuring over 30 intelligent assistants across various industries, designed to help users boost their productivity in different scenarios. It is compatible with Windows, MacOS, and Linux systems and can be used without complex setup.
🚀 Cherry Studio integrates mainstream LLM cloud services and AI web services, and it also supports local model execution. 🌟 Cherry Studio provides personalized features such as full Markdown rendering, agent creation, translation, file upload, and multimodal conversations, with a user-friendly interface and flexible theme options, aiming to provide a comprehensive and efficient AI interaction experience.
### 1.1 Download cherry studio
* [Official Download](https://cherry-ai.com/)
* [Open Source Download](https://github.com/kangfenmao/cherry-studio/releases/latest)
### 1.2 Installation guide
* [Windows Installation](https://cherry-ai.com/docs/windows-install)
* [macOS Installation](https://cherry-ai.com/docs/mac-install)
## 2. Configuring SiliconCloud model services
### 2.1 Click on the settings icon in the bottom left corner and select SiliconFlow in the model services.
### 2.2 Click the link to get the SiliconCloud API key
1. Log in to [SiliconCloud](https://cloud.siliconflow.cn) (if you haven't registered, you will be automatically registered upon first login)
2. Go to the [API Key page](https://cloud.siliconflow.cn/account/ak) to create or copy an existing key
{/* [cherry-studio-api-key](/images/usercases/cherry-studio/cherry-studio-2-api-key.png) */}
### 2.3 Click to add a model
### 2.4 Add an embedded model
1. Search for models in the model management service, you can quickly filter by clicking "Embedded Models";
2. Find the desired model and add it to your models.
## 3. Using model services
### 3.1 Chat with language model services
1. Click the "Conversation" button in the left menu
2. Enter text in the input box to start chatting
3. You can switch models by selecting the model name from the top menu
### 3.2 Create and use a knowledge base with embedded models
#### 3.2.1 Create a knowledge base
1. Knowledge Base Entry: Click the Knowledge Base icon in the left toolbar of Cherry Studio to enter the management page;
2. Add a Knowledge Base: Click "Add" to start creating a knowledge base;
3. Name: Enter the name of the knowledge base and add an embedded model, for example, bge-m3, to complete the creation.
#### 3.2.2 Add files and vectorize
1. Add Files: Click the "Add Files" button to open the file selection dialog;
2. Select Files: Choose supported file formats such as pdf, docx, pptx, xlsx, txt, md, mdx, and open them;
3. Vectorize: The system will automatically perform vectorization. When the process is complete (indicated by a green checkmark), vectorization is finished.
#### 3.2.3 Add data from multiple sources
Cherry Studio supports adding data in multiple ways:
1. Folder directory: You can add an entire folder directory, and files in that directory with supported formats will be automatically vectorized;
2. URL link: Support URL links, such as [https://docs.siliconflow.cn/introduction](https://docs.siliconflow.cn/introduction);
3. Sitemap: Support XML format sitemaps, such as [https://docs.siliconflow.cn/sitemap.xml](https://docs.siliconflow.cn/sitemap.xml);
4. Plain text notes: Support entering custom content in plain text.
#### 3.2.4 Search the knowledge base
After vectorizing the files and other materials, you can perform queries:
1. Click the "Search Knowledge Base" button at the bottom of the page;
2. Enter the query content;
3. Present the search results;
4. Display the matching score for each result.
#### 3.2.5 Reference the knowledge base in conversations to generate responses
1. Create a new topic in the conversation toolbar, and the list of created knowledge bases will expand. Select the knowledge base you want to reference;
2. Input and send a question, and the model will return an answer generated from the search results;
3. At the same time, the source of the referenced data will be attached below the answer, allowing for quick access to the source files.
# Using in Cline
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-cline
## 1. Install Cline
[Installation Address](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev)
## 2. Open Cline
Open Cline in a new tab by pressing Ctrl/Command+Shift+P in VSCode for configuration.
## 3. Configure in a new window
1. API Provider: Select “OpenAI Compatible“
2. Base Url:[https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
3. API Key:Obtain from [https://cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak)
4. Model ID:Obtain from [https://cloud.siliconflow.cn/models](https://cloud.siliconflow.cn/models)
## 4. Start Using
# Using in my.ft07.com
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-cube-sugar-studio
my.ft07.com (麦悠电台) is a unique AI radio app developed by independent developer 方糖 (Cube Sugar). It leverages AI large models to create personalized podcasts for you. By collaborating with RSS Hub and Wewe-rss feed aggregators, My.FT07.com users can subscribe to thousands of media platforms and WeChat public accounts to stay informed. The app supports both local and cloud-based Text-to-Speech (TTS) synthesis, allowing users to choose from various AI voice effects. Podcasts generated in the app also support sharing and exporting in audio or video formats, providing great convenience for content creators.
This article will guide you on how to create your personalized podcast program using the API services provided by SiliconCloud in My.FT07.com.
## 1. Getting the API Key
1. Open the SiliconCloud [website](https://cloud.siliconflow.cn/) and register an account (if you have registered, log in directly).
2. After completing the registration, go to the [API Key page](https://cloud.siliconflow.cn/account/ak), create a new API Key, and copy the key for later use.
## 2. Using the SiliconCloud Language Model Series in my.ft07.com
### 2.1 Download and Install my.ft07.com
iOS users can search and install the app from the Apple Store. Android users can [download the APK](https://the7.ft07.com/Maidio/maidio-byok-1.0.9-b29.apk) and install it.
### 2.2 Configuring SiliconCloud's API Service
Open the my.ft07.com app and click on the "Settings" icon in the top left corner. In the "AI Settings" section, paste the API Key obtained from SiliconCloud, save the settings, and you can now use the corresponding models from SiliconCloud.
### 2.3 Setting Up the Voice
1. Click on the "Voice" tab in the top navigation bar and select the voice engines for the host and assistant in the "Local Voice" page. Adjust the speaking speed, pitch, and volume. Click the "Sound" button to preview the effect.
A For Android systems, please install the Chinese voice pack in the system settings first. It is recommended to use the voice engines from Xiaomi and Google. Choose an appropriate Chinese voice.
For iOS systems, go to Settings → Accessibility → Speak Selection → Voice → Chinese → Yue/Han → Download high-quality voice. Restart the app to use Yue/Han's high-quality voice in the local TTS.
2. After accessing the API Key from SiliconCloud, users can further test "Cloud Voice" through the platform's audio model fishaudio/fish-speech-1.5, enjoying 8 pre-configured voice colors out of the box.
{/* */}
### 2.4 Creating a Radio Station and Getting News
1. Click the "+" button in the upper right corner of the main interface to customize the radio station name and add RSS sources. You can directly input RSS URLs (one per line) or import an OPML file.
2. In the main interface, click the RSS icon on the right side of the radio station and click the refresh button in the upper right corner to get the latest content. Wait for the news to load.
### 2.5 Generating and Listening to Programs
1. In the news list, select the news of interest and click the "Create Program" button at the bottom. Choose your preferred news options (detailed, summary, skip, or original text) and wait for the AI to generate the dialogue content.
2. Return to the main interface and click the play button on the right side of the radio station to enjoy the customized news content announced by the AI host.
{/* */}
### 3. Summary
If you want to develop an AI app like My.FT07.com and quickly test various large model effects or provide users with high-performance model services, you can choose to integrate the API models from SiliconCloud for a quick experience.
# Using in Deep Research
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-deep-research
## 1. Introduction
Deep Research Web UI is an AI-powered research assistant that combines search engines, web scraping, and large language models to enable the AI to search for information based on a question, continuously dig deeper, and finally output a research report.
Features of this project:
* 💰 **Low cost**: Achieve "deep research" results similar to ChatGPT, Perplexity, MITA, etc., at a very low cost.
* 🚀 **Privacy & security**: All configurations and API requests are performed on the browser side and can be self-hosted.
* 🕙 **Real-time feedback**: AI responses are streamed and displayed in real time on the interface.
* 🌳 **Search visualization**: Displays the research process using a tree structure, supporting English search terms.
* 📄 **PDF export support**: Export the final research report in Markdown and PDF formats.
* 🤖 **Multi-model support**: Uses pure prompts instead of structured outputs, making it compatible with more large model providers.
This project is open-source on [GitHub](https://github.com/AnotiaWang/deep-research-web-ui).
## 2. How to Use
Open the [Deep Research Web UI official website](https://deep-research.ataw.top), and click the "⚙️" button in the top right corner to open the settings popup.
### 2.1 Configure AI Large Model Service
1. Register or log in to an account on the SiliconFlow official website.
2. Generate a new API key in [API Keys](https://cloud.siliconflow.cn/account/ak), and copy it.
3. Go back to the Deep Research webpage, and in the AI service settings section, select "SiliconFlow", then paste the generated API key in the "API Key" field.
4. In the "Model Name" field, click the dropdown button on the right (you can also enter the model name in the input box to filter), and select the model you want to use.
5. (Optional) Set the context length: If you're doing large-scale research, it's recommended to configure the "context length" option. Do not exceed the maximum context length of the selected model to avoid request failures.
### 2.2 Configure Networked Search Models
Currently, Tavily and Firecrawl are supported, and more search services will be added in the future. Here we choose Tavily, as it provides 1,000 free searches per month, which is sufficient for most scenarios.
1. Register an account on the [Tavily official website](https://app.tavily.com/home), then create a new API key in the console and copy it.
* The Key Name can be set as "Deep Research".
* The Key Type depends on your usage: for light usage, choose "Development"; for heavy usage, choose "Production", which supports a higher request frequency.
* Be sure to keep your API key safe and do not disclose it.
2. Go back to the Deep Research webpage, in the "Networked Search Service" section, select "Tavily" and paste the generated API key in the "API Key" field.
3. (Optional) Set the language used for searching. The AI model will by default use the current language of your webpage to search and reply. However, if you want to use English search terms to find higher-quality information, you can set the "Language" to English.
Now, everything is set up, and you're ready to start using it!
### 3. Getting Started
Each step of this project is clearly explained to reduce the learning curve. You can use it to find first-hand materials, understand topics you're interested in, search for news, and summarize, etc. For example, search for information about NVIDIA RTX 50 series graphics cards:
This project is actively being updated. If you encounter any issues, feel free to report them on the [GitHub repository](https://github.com/AnotiaWang/deep-research-web-ui).
# Using in Dify
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-dify
Leverage the advantages of SiliconCloud models being numerous and and quickly implementagents in.
## 1. Get API Key
1. the website and register an account (if you have an account, log in directly).
2. After completing the registration, go to the API Key page and create a new API Key. Copy the key for later use.
## 2. Cloud Language Model Series in Dify
### 2.1 Invoke the APIs of the built-in SiliconCloud models in Dify
1. Open the SiliconCloud website and register an account (if you have an account, log in directly). After completing the registration, go to the API Key page and create a new API Key. Copy the key use.
2. In the Dify homepage, click on the gear icon in the upper right corner and then select "Settings". Click on the gear icon in the upper left corner and choose "Model Supplier".
3. Silicon paste the previously copied API Key from the SiliconCloud platform, and then click the "Save" button.
4. After validation, you will see SiliconCloud-provided models at the top of the model supplier area, and you can use these models in your application.
### 2.2 Use SiliconCloud Models Not Included in Dify's Source Code
1. Go Dify "Settings".
2. Select "Model Provider" from the navigation bar and add a compatible OpenAI interface model service platform.
3. Set the corresponding SiliconCloud Model Name, API Key, and API endpoint.
* Model Name: Choose from the [model-list documentation](/api-reference/models/get-model-list).
* API Key: Obtain from [https://cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak). Note that if you need to use overseas you must first complete real-name authentication.
* API Endpoint URL: [https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
4. will see the newly added model in the model list.
## 3. Use SiliconCloud Image Generation Model Series in Dify
Refer to [Using SiliconCloud Image Generation Model Series in Dify for the English translation](https://docs.dify.ai/zh-hans/guides/tools/tool-configuration/siliconflow).
# Using in FastGPT
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-fastgpt
This article is translated from the official documentation of [FastGPT](https://fastgpt.run), introducing how to use SiliconCloud models in FastGPT. [Original Source](https://doc.tryfastgpt.ai/docs/development/modelconfig/one-api/)
[SiliconCloud(硅基流动)](https://cloud.siliconflow.cn/i/TR9Ym0c4) is a platform primarily focused on providing APIs for open-source models and has acceleration test and use open-source models at a low cost and with speed. From actual experience, their models have excellent stability, and they offer a wide covering language, vector, reordering, TTS, STT, drawing, and video generation models, which can meet all model needs in Fast.
If you want to use some models from SiliconCloud, you can also refer to [OneAPI Integration with SiliconCloud](https://doc.tryfastgpt.ai/docs/development/modelconfig/one-api/#%E7%A1%85%E5%9F%BA%E6%B5%81%E5%8A%A8--%E5%BC%80%E6%BA%90%E6%A8%A1%E5%9E%8B%E5%A4%A7%E5%90%88%E9%9B%86).
This article will introduce a solution for deploying FastGPT SiliconCloud models.
## 1. Register for a SiliconCloud Account
1. [Register for SiliconCloud Account](https://cloud.siliconflow.cn/i/TR9c4)
2. Go to the console to get the API key: [https://cloud.siliconflow.cn/account/ak](https://cloud.siliconflow.cn/account/ak)
## 2. Modify FastGPT Environment Variables
```bash
OPENAI_BASE_URL=https://api.siliconflow.cn/v1
# 填写 SiliconCloud 控制台提供的 Api Key
CHAT_API_KEY=sk-xxxxxx
```
## 3. Modify FastGPT Configuration File
We will use SiliconCloud models for the FastGPT configuration. Here, we configure the pure language and vision model `wen2.5 72b`; choose`bge-m3` as the vector model; choose `bge-reranker-v2-m3` the reordering model. Choose `fish-speech-1.5` as the speech model; choose `SenseVoiceSmall` as input model.
Note: The ReRank model still be configured with an API key once.
```json
{
"llmModels": [
{
"provider": "Other", // 模型提供商,主要用于分类展示,目前已经内置提供商包括:https://github.com/labring/FastGPT/blob/main/packages/global/core/ai/provider.ts, 可 pr 提供新的提供商,或直接填写 Other
"model": "Qwen/Qwen2.5-72B-Instruct", // 模型名(对应OneAPI中渠道的模型名)
"name": "Qwen2.5-72B-Instruct", // 模型别名
"maxContext": 32000, // 最大上下文
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 30000, // 最大引用内容
"maxTemperature": 1, // 最大温度
"charsPointsPrice": 0, // n积分/1k token(商业版)
"censor": false, // 是否开启敏感校验(商业版)
"vision": false, // 是否支持图片输入
"datasetProcess": true, // 是否设置为文本理解模型(QA),务必保证至少有一个为true,否则知识库会报错
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
"usedInQueryExtension": true, // 是否用于问题优化(务必保证至少有一个为true)
"toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。)
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式)
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
"customExtractPrompt": "", // 自定义内容提取提示词
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
"defaultConfig": {}, // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p)
"fieldMap": {} // 字段映射(o1 模型需要把 max_tokens 映射为 max_completion_tokens)
},
{
"provider": "Other",
"model": "Qwen/Qwen2-VL-72B-Instruct",
"name": "Qwen2-VL-72B-Instruct",
"maxContext": 32000,
"maxResponse": 4000,
"quoteMaxToken": 30000,
"maxTemperature": 1,
"charsPointsPrice": 0,
"censor": false,
"vision": true,
"datasetProcess": false,
"usedInClassify": false,
"usedInExtractFields": false,
"usedInToolCall": false,
"usedInQueryExtension": false,
"toolChoice": false,
"functionCall": false,
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"defaultConfig": {}
}
],
"vectorModels": [
{
"provider": "Other",
"model": "Pro/BAAI/bge-m3",
"name": "Pro/BAAI/bge-m3",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 5000,
"weight": 100
}
],
"reRankModels": [
{
"model": "BAAI/bge-reranker-v2-m3", // 这里的model需要对应 siliconflow 的模型名
"name": "BAAI/bge-reranker-v2-m3",
"requestUrl": "https://api.siliconflow.cn/v1/rerank",
"requestAuth": "siliconflow 上申请的 key"
}
],
"audioSpeechModels": [
{
"model": "fishaudio/fish-speech-1.5",
"name": "fish-speech-1.5",
"voices": [
{
"label": "fish-alex",
"value": "fishaudio/fish-speech-1.5:alex",
"bufferId": "fish-alex"
},
{
"label": "fish-anna",
"value": "fishaudio/fish-speech-1.5:anna",
"bufferId": "fish-anna"
},
{
"label": "fish-bella",
"value": "fishaudio/fish-speech-1.5:bella",
"bufferId": "fish-bella"
},
{
"label": "fish-benjamin",
"value": "fishaudio/fish-speech-1.5:benjamin",
"bufferId": "fish-benjamin"
},
{
"label": "fish-charles",
"value": "fishaudio/fish-speech-1.5:charles",
"bufferId": "fish-charles"
},
{
"label": "fish-claire",
"value": "fishaudio/fish-speech-1.5:claire",
"bufferId": "fish-claire"
},
{
"label": "fish-david",
"value": "fishaudio/fish-speech-1.5:david",
"bufferId": "fish-david"
},
{
"label": "fish-diana",
"value": "fishaudio/fish-speech-1.5:diana",
"bufferId": "fish-diana"
}
]
}
],
"whisperModel": {
"model": "FunAudioLLM/SenseVoiceSmall",
"name": "SenseVoiceSmall",
"charsPointsPrice": 0
}
}
```
## 4. Restart FastGPT
## 5. Test Experience
### Test Chat and Image Recognition
Create a simple application and select the corresponding models, then enable image upload for testing:
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
You can see 72B very fast. If you don a few 4090 GPUs locally, not only would setting up the environment be challenging, but the output might take 30 seconds or more.
### 测试知识库导入和知识库问答
新建一个知识库(由于只配置了一个向量模型,页面上不会展示向量模型选择)
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
导入本地文件,直接选择文件,然后一路下一步即可。79 个索引,大概花了 20s 的时间就完成了。现在我们去测试一下知识库问答。
首先回到我们刚创建的应用,选择知识库,调整一下参数后即可开始对话:
| | | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |  |
对话完成后,点击底部的引用,可以查看引用详情,同时可以看到具体的检索和重排得分:
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
### 测试语音播放
继续在刚刚的应用中,左侧配置中找到语音播放,点击后可以从弹窗中选择语音模型,并进行试听:

### 测试语言输入
继续在刚刚的应用中,左侧配置中找到语音输入,点击后可以从弹窗中开启语言输入

开启后,对话输入框中,会增加一个话筒的图标,点击可进行语音输入:
| | |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|  |  |
## 总结
如果你想快速的体验开源模型或者快速的使用 FastGPT,不想在不同服务商申请各类 Api Key,那么可以选择 SiliconCloud 的模型先进行快速体验。
如果你决定未来私有化部署模型和 FastGPT,前期可通过 SiliconCloud 进行测试验证,后期再进行硬件采购,减少 POC 时间和成本。
# Using in Immersive Translation
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-immersive-translate
n Immersive Translation, call the SiliconCloud API to achieve the goal of fast cross-language translation.
As a highly acclaimed bilingual web translation plugin, [Immersive Translate](https://immersivetranslate.com/) leverages large language models to achieve cross-language understanding and real-time translation of foreign content. It is applicable in scenarios such as web reading, PDF translation, EPUB e-book translation, and video subtitle translation, and supports various browser extensions and applications. Since its launch in 2023, this AI-powered bilingual web translation plugin has helped over 1 million users overcome language barriers and access global wisdom.
SiliconCloud immediately provides GLM4, Qwen2, DeepSeek V2, and ZeroOne's models, integrating third-party large models with the Immersive Translate plugin to significantly improve translation speed and accuracy.
## 1. Obtain API Key
1. Open the SiliconCloud [website](https://cloud.siliconflow.cn/) and register an account (if you have registered, log in directly).
2. After completing the registration, go to the [API Key page](https://cloud.siliconflow.cn/account/ak), create a new API Key, and copy the key for future use.
## 2. Using SiliconCloud in Immersive Translation
### 2.1 Default Configuration
1. On the "Immersive Translate" [website](https://immersivetranslate.com/zh-Hans/), choose "Install Browser Extension" and select the appropriate browser version. Follow the prompts to install it. If you have already installed the extension, skip this step.
2. Click on the Immersive Translate extension, then click on the settings. In the pop-up, set the "Translation Service" to "SiliconCloud Translation."
3. After setting it up, you can start using the SiliconCloud translation service.
### 2.2 Using Other Free Models from SiliconCloud
1. The default model is SiliconCloud's "Qwen/Qwen2-7B-Instruct." If you need to switch to another SiliconCloud model, click on the icon and go to the settings.
2. In the "Basic Settings," select another model to use a different free model from SiliconCloud.
### 2.3 Using Other Text Generation Models from SiliconCloud
1. If you need to use another model from SiliconCloud, click on the Immersive Translate extension icon, find the "Settings" button, and click it.
2. In the settings page, click on "Translation Services," scroll to the bottom, and click on "Add Custom AI Translation Service Compatible with Open AI Interface?"
3. Fill in the required information for the SiliconCloud model:
* Custom Translation Service Name: Fill in according to your actual situation.
* Custom API Endpoint: [https://api.siliconflow.cn/v1/chat/completions](https://api.siliconflow.cn/v1/chat/completions)
* API Key: Paste the SiliconCloud platform's API key here.
* Model Name: The name of the model in SiliconCloud.
4. After completing the configuration, click the test button in the upper right corner to verify.
5. Once configured successfully, you can start using other text generation models.
# Using in MindSearch
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-mindsearch
## 1. Obtain API Key
1. Open the SiliconCloud [website](https://cloud.siliconflow.cn/) and register an account (if you have registered, log in directly).
2. After completing the registration, go to the [API Key page](https://cloud.siliconflow.cn/account/ak), create a new API Key, and copy the key for future use.
## 2. Deploy MindSearch
1. Clone MindSearch to your local machine and install the required dependencies (refer to [https://github.com/InternLM/MindSearch/blob/main/README.md](https://github.com/InternLM/MindSearch/blob/main/README.md)).
2. Modify:
`/path/to/MindSearch/mindsearch/models.py`
3. Add the configuration for calling the SiliconCloud API. The configuration is as follows:
```
internlm_silicon = dict(type=GPTAPI,
model_type='internlm/internlm2_5-7b-chat',
key=os.environ.get('SILICON_API_KEY', 'YOUR SILICON API KEY'),
openai_api_base='https://api.siliconflow.cn/v1/chat/completions',
meta_template=[
dict(role='system', api_role='system'),
dict(role='user', api_role='user'),
dict(role='assistant', api_role='assistant'),
dict(role='environment', api_role='system')
],
top_p=0.8,
top_k=1,
temperature=0,
max_new_tokens=8192,
repetition_penalty=1.02,
stop_words=['<|im_end|>'])
```
After adding this configuration, you can execute the relevant commands to start MindSearch.
4. Start the backend:
```
# 指定硅基流动的 API Key
export SILICON_API_KEY=上面流程中复制的密钥
# 启动
python -m mindsearch.app --lang en --model_format internlm_silicon --search_engine DuckDuckGoSearch
```
5. Start the frontend. Here, we use Gradio as an example. For other frontends, refer to MindSearch's README:
`python frontend/mindsearch_gradio.py`
## 3. Upload to HuggingFace Space
We can also choose to deploy it to a HuggingFace Space.
1. Create a new Space on [https://huggingface.co/new-space](https://huggingface.co/new-space),
configure it as:
Gradio
Template: Blank
Hardware: CPU basic · 2 vCPU · 16GB · FREE
2. After creating the Space, go to "Settings" and set the API Key.
3. Upload the MindSearch directory, requirements.txt, and an app.py file.
The detailed content of app.py can be found at: [https://huggingface.co/spaces/SmartFlowAI/MindSearch\_X\_SiliconFlow/blob/main/app.py](https://huggingface.co/spaces/SmartFlowAI/MindSearch_X_SiliconFlow/blob/main/app.py)
# Using in NextChat
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-nextchat
## 1. Obtain API Key
1. Open the SiliconCloud [website](https://cloud.siliconflow.cn/) and register an account (if you have registered, log in directly).
2. After completing the registration, go to the [API Key page](https://cloud.siliconflow.cn/account/ak), create a new API Key, and copy the key for future use.
## 2. Deploy NextChat
Visit the NextChat [website](https://app.nextchat.dev/), or install ChatGPT-Next-Web locally:
1. Click the "Settings" button at the bottom left of the page.
2. Find the "Custom API" option and select it.
3. Fill in the parameters:
* API Endpoint: [https://api.siliconflow.cn](https://api.siliconflow.cn)
* API Key: Input the API Key generated from the "API Key" page and fill it into "Custom Model Name" and "Model (model)"
Other custom model names can be found in the [SiliconCloud API Reference](https://docs.siliconflow.cn/api-reference/chat-completions/chat-completions).
# Using in Obsidian Copilot
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-obsidian
Obsidian Copilot is an open-source AI assistant plugin designed for simplicity and ease of use. Users can interact with various models using their own API key or local models. It supports custom prompts and allows for quick conversations with the entire note library to get answers and insights. It aims to be the ultimate privacy-focused AI assistant, deeply understanding your personal knowledge base.
How can you use SiliconCloud models in Obsidian?
## 1. Obtain API Key
1. Open the SiliconCloud [website](https://cloud.siliconflow.cn/) and register an account (if you have registered, log in directly).
2. After completing the registration, go to the [API Key page](https://cloud.siliconflow.cn/account/ak), create a new API Key, and copy the key for future use.
## 2. Using SiliconCloud Language Models in Obsidian Copilot
### 2.1 Install Obsidian Copilot
1. Install the Obsidian application, see the [Obsidian website](https://obsidian.md/) for details.
2. Install the Copilot plugin in Obsidian:
### 2.2 Configure SiliconCloud Models in Obsidian Copilot
#### 2.2.1 Set LLM Model
* Model: [SiliconCloud Platform LLM List](https://cloud.siliconflow.cn/models?types=chat)
* Provider: 3rd party (openai-format)
* Base URL: [https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
* API Key: [Get API Key](use-siliconcloud-in-obsidian#1-api-key)
#### 2.2.2 Set Embedding Model
* Model: See [SiliconCloud Platform Embedding List](https://cloud.siliconflow.cn/models?types=embedding)
* Provider: 3rd party (openai-format)
* Base URL: [https://api.siliconflow.cn/v1](https://api.siliconflow.cn/v1)
* API Key: [Get API Key](use-siliconcloud-in-obsidian#1-api-key)
#### 2.2.3 Load Configuration
### 2.3 Use SiliconCloud Models in Obsidian Copilot
Now you can use the SiliconCloud models and your local knowledge base for retrieval and Q\&A.
# Using in QingFlow
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-qingflow
## 1. About QingFlow
[QingFlow](https://qingflow.com) is a leading no-code development platform designed to provide businesses with convenient, efficient, and intelligent tools for building business systems. With QingFlow, enterprise users can quickly create personalized business applications without writing complex code, easily automating and smartening their business processes!
This article will introduce how to quickly use the SiliconCloud API services in QingFlow to empower business systems.
## 2. Using QingFlow
No installation is required. Simply visit the QingFlow official website and register to get started. [Registration Portal](https://qingflow.com/passport/register)
## 3. Using SiliconCloud Connector in QingFlow
### 3.1 Subscribe to the Connector
After registering on QingFlow, go to your workspace and click "More" - "QingMall" to enter the QingFlow Connector Center. Click "SiliconFlow" and then click "Subscribe," as shown in the image below.
### 3.2 Using SiliconCloud Connector in Business Systems
Insert the "Q-Linker" field in your application, select "Use Connector Center Template" and then choose "SiliconFlow" to pick the AI model you need. Once published, you can start using it.
Note that when using SiliconCloud’s large model services on the QingFlow platform, users do not need to enter their own API key. The platform has automatically configured the connection with the SiliconCloud account, allowing everyone to easily enjoy a seamless service experience.
# Using in Sider
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-sider
As one of the 2023 "Chrome Yearly Picks," Sider has received over 50K 5-star reviews and has more than 6 million active users. Sider browser extension primarily addresses:
* Sider (ChatGPT Sidebar) is your useful AI assistant that you can use while browsing any website.
* Sider helps you read and write articles in the sidebar of all websites. It supports GPT-4o mini/GPT-4o models, intelligent internet access, YouTube summaries, ChatPDF, AI painting, and AI chat with ChatGPT, Claude, Gemini, and Llama chatbots!
Developers can use the Sider application by visiting the [Sider website](https://sider.ai/zh-CN/).Sider provides a compatible model registration method for OpenAI API to meet the needs of software developers and make it easier to use the models they want.As a one-stop cloud service platform for top-tier large models, SiliconCloud is dedicated to providing developers with faster, cheaper, more comprehensive, and smoother model APIs. So, how can you use SiliconCloud in Sider?
## 1. Obtain API Key
1. Open the SiliconCloud [website](https://cloud.siliconflow.cn/) and register an account (if you have registered, log in directly).
2. After completing the registration, go to the [API Key page](https://cloud.siliconflow.cn/account/ak), create a new API Key, and copy the key for future use.
## 2. Using SiliconCloud Language Models in Sider
Follow the steps in the image below:
# Using in ToMemo
Source: https://docs.siliconflow.cn/en/usercases/use-siliconcloud-in-tomemo
## Adding SiliconFlow as a Provider
After entering the add page, directly click the "Provider" option and select SiliconFlow. This will automatically fill in the name, Base URL, and API type.
## Getting the SiliconFlow API Key
The link to get the SiliconFlow API Key: [Click to open](https://cloud.siliconflow.cn/account/ak)
After clicking, log in to access the page shown below.
Click the "Create API Key" button and follow the steps to create your key.
Be sure to **copy the API key** and store it safely.
### Pulling Models
Enter the API Key you obtained into the API Key input field on this page.
Click the "Pull Models" button, and the models will be automatically fetched.
Then, choose the model you want to load, and click the "Save" button to complete the integration of SiliconFlow.
💡
**Tip**
Make sure to choose a text generation model, as the app currently does not support image input and output.
## Adding Word Assistant 🤓
Go to the "AI Assistant" page to start adding an AI assistant.
We will add the "Word Assistant 🤓" from the template.
## Word Assistant 🤓 in the Keyboard
To use the "Word Assistant" in the keyboard, you need to first add the "Word Assistant" in the "AI Assistant" section.
# Image generation
Source: https://docs.siliconflow.cn/en/userguide/capabilities/images
## 1.Image generation model overview
The platform provides image generation models that can be used in two main ways: generating images directly based on prompts, or generating image variants based on existing images.
* Generating images based on text prompts
When using large text-to-image models, carefully designed prompts (instructions) can help generate higher quality images. Here are some tips to improve the quality of generated images:
* Specific description: Try to describe the image content in detail. For example, if you want to generate a sunset beach scene, instead of just "beach sunset," you can try "a serene beach with the sun setting, the sky turning orange and red, gentle waves lapping at the sand, and a small boat in the distance."
* Emotion and atmosphere: Besides describing the content, you can also add descriptions of emotions or atmosphere, such as "cozy," "mysterious," or "energetic," which can help the model better understand the desired style.
* Style specification: If you have a specific art style preference, such as "impressionist" or "surrealism," you can specify it in the prompt to make the generated image more likely to meet your expectations.
* Avoid vague words: Try to avoid using abstract or vague words, such as "beautiful" or "good," as these words are difficult for the model to concretize and may result in images that differ significantly from your expectations.
* Use negatives: If you do not want certain elements in the image, you can use negative words to exclude them. For example, "generate a beach sunset image without a boat."
* Step-by-step input: For complex scenes, you can try inputting the prompt in steps, first generating a basic image and then adjusting or adding details as needed.
* Try different descriptions: Sometimes, even if you describe the same scene, different descriptions can yield different results. Try describing the scene from different angles or using different words to see which one gives you the best result.
* Utilize model-pecific features: Some models may offer specific features or parameter adjustment options, such as adjusting the resolution or style strength of the generated image. Properly utilizing these features can also help improve the quality of the generated image.
By using these methods, you can effectively improve the quality of images generated using large text-to-image models. However, since different models may have different characteristics and preferences, you may need to make appropriate adjustments based on the specific model's features and feedback.
You can refer to the following examples:
> A futuristic eco-friendly skyscraper in central Tokyo. The building incorporates lush vertical gardens on every floor, with cascading plants and trees lining glass terraces. Solar panels and wind turbines are integrated into the structure's design, reflecting a sustainable future. The Tokyo Tower is visible in the background, contrasting the modern eco-architecture with traditional city landmarks.
> An elegant snow leopard perched on a cliff in the Himalayan mountains, surrounded by swirling snow. The animal’s fur is intricately detailed with distinctive patterns and a thick winter coat. The scene captures the majesty and isolation of the leopard's habitat, with mist and mountain peaks fading into the background.
* Generating image variants based on existing images
Some image generation models support generating image variants based on existing images. In this case, you still need to input appropriate prompts to achieve the desired results. You can refer to the above content for prompt input.
## 2.Experience address
You can experience the [image generation](https://cloud.siliconflow.cn/playground/image) function by visiting Image Generation or by referring to the API documentation to call the API.
* Key parameters introduction
* image\_size: Controls the image resolution. You can customize various resolutions when making API requests.
* num\_inference\_steps: Controls the number of steps in image generation. Some models can generate better results by adjusting the step length. Models like black-forest-labs/FLUX.1-schnell, Pro/black-forest-labs/FLUX.1-schnell, and stabilityai/stable-diffusion-3-5-large-turbo do not support adjusting the step length and use a default step length of 4.
* prompt\_enhancement: Prompt enhancement switch. This switch enhances the input prompt. For Chinese users, if you want to quickly generate images using Chinese prompts, you can turn this switch on to better adapt to Chinese.
* batch\_size: The number of images generated at once. The default value is 1, with a maximum value of 4.
* negative\_prompt: Here, you can input elements that you do not want to appear in the image to eliminate some influencing factors.
* seed: If you want to generate the same image every time, you can set the seed to a fixed value.
## 3.Image generation billing introduction
The platform's image generation billing is divided into two billing methods:
* **Billing based on image size and inference steps, with a price of ¥x/M px/Steps, i.e., ¥x per million pixels per step.**
For example, if you want to generate an image with a width of 1024 and a height of 512, and 4 inference steps, and you choose a model with a price of ¥0.0032/M px/Steps (stabilityai/stable-diffusion-3-5-large-turbo), the cost of generating one image would be `(1024 * 512) / (1024 * 1024) * 4 * 0.0032 = 0.0064 yuan`. Here, 2 represents that the pixel size of 1024 \* 512 is 0.5M, and the cost of generating an image is related to the pixel size and the number of steps.
* **Billing based on the number of images, with a price of ¥x/Image, i.e., ¥x per image.**
For example, if you want to generate an image with a width of 1024 and a height of 512, and 4 inference steps, and you choose a model with a price of ¥0.37/Image (black-forest-labs/FLUX.1-pro), the cost of generating one image would be ¥0.37. The cost of generating an image is unrelated to the pixel size and the number of steps.
Note: Different models may have different billing methods. Please choose the appropriate billing method based on your needs.
## 4.Supported models list
Currently supported image generation models:
* Text-to-image series:
* black-forest-labs series:
* black-forest-labs/FLUX.1-dev
* black-forest-labs/FLUX.1-schnell
* Pro/black-forest-labs/FLUX.1-schnell
* black-forest-labs/FLUX.1-pro
* stabilityai series:
* stabilityai/stable-diffusion-3-5-large
* stabilityai/stable-diffusion-3-5-large-turbo
* stabilityai/stable-diffusion-3-medium
* stabilityai/stable-diffusion-xl-base-1.0
* stabilityai/stable-diffusion-2-1
* deepseekai series:
* deepseek-ai/Janus-Pro-7B
Default output resolution is 384\*384
* Image-to-image series:
* stabilityai series:
* stabilityai/stable-diffusion-xl-base-1.0
* stabilityai/stable-diffusion-2-1
Note: The supported image generation models may be subject to change. Please filter by the "Image" tag on the Model Square to obtain the current list of supported models.
# Reasoning
Source: https://docs.siliconflow.cn/en/userguide/capabilities/reasoning
# Reasoning models
## Overview
DeepSeek-R1 is a high-level language model developed by deepseek-ai, designed to enhance the accuracy of final answers by outputting the reasoning chain content (reasoning\_content). When using this model, it is recommended to upgrade the OpenAI SDK to support new parameters.
Supported Model List:
* deepseek-ai/DeepSeek-R1
* Pro/deepseek-ai/DeepSeek-R1
* deepseek-ai/DeepSeek-R1-Distill-Llama-70B
* eepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
## Installation and upgrade
Before using DeepSeek-R1, ensure that you have the latest version of the OpenAI SDK installed. You can upgrade it using the following command:
```bash
pip3 install -U openai
```
## API parameters
* Input parameters:
* max\_tokens:Maximum length of the response (including reasoning chain output), Among the models listed above, the maximum value of max\_tokens for deepseek-ai/DeepSeek-R1 is 8K, and for other models, it is 16K.
* Return parameters:
* reasoning\_content:Reasoning chain content, at the same level as content.
* content:Final answer content
* Usage Recommendations
* Set the temperature within the range of 0.5-0.7 (0.6 is recommended) to prevent endless repetitions or incoherent outputs.
* Avoid adding a system prompt; all instructions should be contained within the user prompt
* For mathematical problems, it is advisable to include a directive in your prompt such as: "Please reason step by step, and put your final answer within \boxed{}."
* the DeepSeek-R1 series models tend to bypass thinking pattern (i.e., outputting `"\n\n"`) when responding to certain queries, which can adversely affect the model's performance. To ensure that the model engages in thorough reasoning, we recommend enforcing the model to initiate its response with `"\n"` at the beginning of every output.
{/*- Use specific prompts for file upload and web search for better user experience.
- For file upload, please follow the template to create prompts, where `{file_name}`, `{file_content}` and `{question}` are arguments.
```bash
file_template = \
"""[file name]: {file_name}
[file content begin]
{file_content}
[file content end]
{question}"""
```
- For Web Search, `{search_results}`, `{cur_data}`, and `{question}` are arguments.
- For Chinese query, we use the prompt:
```bash
search_answer_zh_template = \
'''# 以下内容是基于用户发送的消息的搜索结果:
{search_results}
在我给你的搜索结果中,每个结果都是[webpage X begin]...[webpage X end]格式的,X代表每篇文章的数字索引。请在适当的情况下在句子末尾引用上下文。请按照引用编号[citation:X]的格式在答案中对应部分引用上下文。如果一句话源自多个上下文,请列出所有相关的引用编号,例如[citation:3][citation:5],切记不要将引用集中在最后返回引用编号,而是在答案对应部分列出。
在回答时,请注意以下几点:
- 今天是{cur_date}。
- 并非搜索结果的所有内容都与用户的问题密切相关,你需要结合问题,对搜索结果进行甄别、筛选。
- 对于列举类的问题(如列举所有航班信息),尽量将答案控制在10个要点以内,并告诉用户可以查看搜索来源、获得完整信息。优先提供信息完整、最相关的列举项;如非必要,不要主动告诉用户搜索结果未提供的内容。
- 对于创作类的问题(如写论文),请务必在正文的段落中引用对应的参考编号,例如[citation:3][citation:5],不能只在文章末尾引用。你需要解读并概括用户的题目要求,选择合适的格式,充分利用搜索结果并抽取重要信息,生成符合用户要求、极具思想深度、富有创造力与专业性的答案。你的创作篇幅需要尽可能延长,对于每一个要点的论述要推测用户的意图,给出尽可能多角度的回答要点,且务必信息量大、论述详尽。
- 如果回答很长,请尽量结构化、分段落总结。如果需要分点作答,尽量控制在5个点以内,并合并相关的内容。
- 对于客观类的问答,如果问题的答案非常简短,可以适当补充一到两句相关信息,以丰富内容。
- 你需要根据用户要求和回答内容选择合适、美观的回答格式,确保可读性强。
- 你的回答应该综合多个相关网页来回答,不能重复引用一个网页。
- 除非用户要求,否则你回答的语言需要和用户提问的语言保持一致。
# 用户消息为:
{question}'''
```
- For English query, we use the prompt:
```bash
search_answer_en_template = \
'''# The following contents are the search results related to the user's message:
{search_results}
In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer.
When responding, please keep the following points in mind:
- Today is {cur_date}.
- Not all content in the search results is closely related to the user's question. You need to evaluate and filter the search results based on the question.
- For listing-type questions (e.g., listing all flight information), try to limit the answer to 10 key points and inform the user that they can refer to the search sources for complete information. Prioritize providing the most complete and relevant items in the list. Avoid mentioning content not provided in the search results unless necessary.
- For creative tasks (e.g., writing an essay), ensure that references are cited within the body of the text, such as [citation:3][citation:5], rather than only at the end of the text. You need to interpret and summarize the user's requirements, choose an appropriate format, fully utilize the search results, extract key information, and generate an answer that is insightful, creative, and professional. Extend the length of your response as much as possible, addressing each point in detail and from multiple perspectives, ensuring the content is rich and thorough.
- If the response is lengthy, structure it well and summarize it in paragraphs. If a point-by-point format is needed, try to limit it to 5 points and merge related content.
- For objective Q&A, if the answer is very brief, you may add one or two related sentences to enrich the content.
- Choose an appropriate and visually appealing format for your response based on the user's requirements and the content of the answer, ensuring strong readability.
- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage.
- Unless the user requests otherwise, your response should be in the same language as the user's question.
# The user's message is:
{question}'''
```*/}
## Context concatenation
During each round of the conversation, the model outputs the reasoning chain content (reasoning\_content) and the final answer (content). In the next round of the conversation, the reasoning chain content from the previous rounds will not be concatenated to the context.
## OpenAI request examples
### Stream Mode Request
```python
from openai import OpenAI
url = 'https://api.siliconflow.cn/v1/'
api_key = 'your api_key'
client = OpenAI(
base_url=url,
api_key=api_key
)
# 发送带有流式输出的请求
content = ""
reasoning_content=""
messages = [
{"role": "user", "content": "奥运会的传奇名将有哪些?"}
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=True, # 启用流式输出
max_tokens=4096
)
# 逐步接收并处理响应
for chunk in response:
if chunk.choices[0].delta.content:
content += chunk.choices[0].delta.content
if chunk.choices[0].delta.reasoning_content:
reasoning_content += chunk.choices[0].delta.reasoning_content
# Round 2
messages.append({"role": "assistant", "content": content})
messages.append({'role': 'user', 'content': "继续"})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=True
)
```
### Non-Stream Mode Request
```python
from openai import OpenAI
url = 'https://api.siliconflow.cn/v1/'
api_key = 'your api_key'
client = OpenAI(
base_url=url,
api_key=api_key
)
# 发送非流式输出的请求
messages = [
{"role": "user", "content": "奥运会的传奇名将有哪些?"}
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=False,
max_tokens=4096
)
content = response.choices[0].message.content
reasoning_content = response.choices[0].message.reasoning_content
# Round 2
messages.append({"role": "assistant", "content": content})
messages.append({'role': 'user', 'content': "继续"})
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-R1",
messages=messages,
stream=False
)
```
## Notes
* API Key: Ensure you use the correct API key for authentication.
* Stream Mode: Stream mode is suitable for scenarios where responses need to be received incrementally, while non-stream mode is suitable for scenarios where a complete response is needed at once.
## Common questions
* How to obtain the API key?
Please visit [SiliconFlow](https://cloud.siliconflow.cn/) to register and obtain the API key.
* How to handle long text?
You can adjust the max\_tokens parameter to control the length of the output, but please note that the maximum length is 16K.
# Text generation
Source: https://docs.siliconflow.cn/en/userguide/capabilities/text-generation
Language Model (LLM) User Manual
## 1. Model Core Capabilities
### 1.1 Basic Functions
Text Generation: Generate coherent natural language text based on context, supporting various styles and genres.
Semantic Understanding: Deeply parse user intent, supporting multi-round dialogue management to ensure the coherence and accuracy of conversations.
Knowledge Q\&A: Cover a wide range of knowledge domains, including science, technology, culture, history, etc., providing accurate knowledge answers.
Code Assistance: Support code generation, explanation, and debugging for multiple mainstream programming languages (such as Python, Java, C++, etc.).
### 1.2 Advanced Capabilities
Long Text Processing: Support context windows of 4k to 64k tokens, suitable for long document generation and complex dialogue scenarios.
Instruction Following: Precisely understand complex task instructions, such as "compare A/B schemes using a Markdown table."
Style Control: Adjust output style through system prompts, supporting various styles such as academic, conversational, and poetry.
Multimodal Support: In addition to text generation, support tasks such as image description and speech-to-text.
## 2. API Call Specifications
### 2.1 Basic Request Structure
You can make end-to-end API requests using the OpenAI SDK
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a haiku about recursion in programming."}
],
temperature=0.7,
max_tokens=1024,
stream=True
)
# 逐步接收并处理响应
for chunk in response:
print(chunk.choices[0].delta.content)
```
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="deepseek-ai/deepseek-vl2",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/658c7434-ec12-49cc-90e6-fe22ccccaf62_00001_.png",
},
},
{
"type": "text",
"text": "What's in this image?"
}
],
}
],
temperature=0.7,
max_tokens=1024,
stream=True
)
# 逐步接收并处理响应
for chunk in response:
print(chunk.choices[0].delta.content)
```
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
{"role": "user", "content": "? 2020 年世界奥运会乒乓球男子和女子单打冠军分别是谁? "
"Please respond in the format {\"男子冠军\": ..., \"女子冠军\": ...}"}
],
response_format={"type": "json_object"}
)
print(response.choices[0].message.content)
```
### 2.2 Message Body Structure Description
| Message Type | Description | Example Content |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| system | Model instruction, sets the AI role and describes how the model should generally behave and respond | Example: "You are a pediatrician with 10 years of experience" |
| user | User input, passes the final user's message to the model | Example: "How should I handle a child with persistent low fever?" |
| assistant | Model-generated historical responses, provides examples for the model to understand how it should respond to the current request | Example: "I would suggest first taking the child's temperature..." |
When you want the model to follow layered instructions, message roles can help you get better outputs. However, they are not deterministic, so the best approach is to try different methods and see which one gives you the desired results.
## 3. Model Series Selection Guide
You can enter the [Model Square](https://cloud.siliconflow.cn/models) and filter language models that support different functionalities using the filters on the left. Based on the model descriptions, you can understand the specific pricing, model parameter size, maximum context length supported by the model, and other details.
You can experience the models in the [playground](https://cloud.siliconflow.cn/playground/chat) (the playground only provides model experience and does not have a history record function. If you want to save the conversation records, please save the session content yourself). For more usage instructions, you can refer to the [API Documentation](https://docs.siliconflow.cn/cn/api-reference/chat-completions/chat-completions).
## 4.Detailed Explanation of Core Parameters
### 4.1 Creativity Control
```bash
# temperature parameter(0.0~2.0)
temperature=0.5 # Balance creativity and reliability
# top-p Sampling(top_p)
top_p=0.9 # Consider only the set of words with a cumulative probability of 90%
```
### 4.2 Output Constraints
```json
max_tokens=1000 # Maximum length of generated text in tokens
stop=["\n##", "<|end|>"] # Stop sequences, output stops when encountering the corresponding string in the array
frequency_penalty=0.5 # Penalize repeated words (-2.0 to 2.0)
stream=true # Control whether the output is stream-based. For models with a lot of output, it is recommended to set this to true to prevent output timeouts due to excessive length
```
### 4.3 Summary of Language Model Scenarios
**1. Model Output Encoding Issues**
Currently, some models are prone to encoding issues when parameters are not set. If you encounter such issues, you can try setting the temperature, top\_k, top\_p, and frequency\_penalty parameters.
Modify the payload as follows, adjusting as needed for different languages:
```python
payload = {
"model": "Qwen/Qwen2.5-Math-72B-Instruct",
"messages": [
{
"role": "user",
"content": "1+1=?",
}
],
"max_tokens": 200, # Adjust as needed
"temperature": 0.7, # Adjust as needed
"top_k": 50, # Adjust as needed
"top_p": 0.7, # Adjust as needed
"frequency_penalty": 0 # Adjust as needed
}
```
**2. Explanation of max\_tokens**
For the LLM models provided by the platform:
* The model with a max\_tokens limit of `16384`:
* Pro/deepseek-ai/DeepSeek-R1
* Qwen/QVQ-72B-Preview
* deepseek-ai/DeepSeek-R1-Distill-Llama-70B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-14B
* deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Llama-8B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
* Pro/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
* The model with a max\_tokens limit of `8192`:
* Qwen/QwQ-32B-Preview
* AIDC-AI/Marco-o1
* deepseek-ai/DeepSeek-R1
* The model with a max\_tokens limit of `4096`:
* Other LLM models aside from those mentioned above
**3. Explanation of context\_length**
The context\_length varies for different LLM models. You can search for the specific model on the [Model Square](https://cloud.siliconflow.cn/models) to view the model details.
**4. Output Truncation Issues in Model Inference**
Here are several aspects to troubleshoot the issue:
* When encountering output truncation through API requests:
* Max Tokens Setting: Set the max\_token to an appropriate value. If the output exceeds the max\_token, it will be truncated. For the deepseek R1 series, the max\_token can be set up to 16,384.
* Stream Request Setting: In non-stream requests, long output content is prone to 504 timeout issues.
* Client Timeout Setting: Increase the client timeout to prevent truncation before the output is fully completed.
* When encountering output truncation through third-party client requests:
* CherryStdio has a default max\_tokens of 4,096. Users can enable the "Enable Message Length Limit" switch to set the max\_token to an appropriate value.
**5. Error Code Handling**
| Error Code | Common Cause | Solution |
| ---------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| 400 | Incorrect parameter format | Check the value range of parameters like temperature. |
| 401 | API Key not correctly set | Check the API Key. |
| 403 | Insufficient permissions | The most common reason is that the model requires real-name authentication. Refer to the error message for other cases. |
| 429 | Exceeded request frequency limit | Implement exponential backoff retry mechanism. |
| 503/504 | Model overload | Switch to a backup model node. |
# 5. Billing and Quota Management
### 5.1 Billing Formula
`Total Cost = (Input tokens × Input price) + (Output tokens × Output price)`
### 5.2 Example Pricing for Each Series
The specific pricing for each model can be viewed on the Model Details Page in the [Model Square](https://cloud.siliconflow.cn/models).
## 6. Case Studies
### 6.1 Technical Documentation Generation
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="Qwen/Qwen2.5-Coder-32B-Instruct",
messages=[{
"role": "user",
"content": "Write an asynchronous web scraper tutorial in python, including code examples and notes"
}],
temperature=0.7,
max_tokens=4096
)
```
### 6.2 Data Analysis Report
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model="Qwen/QVQ-72B-Preview",
messages=[
{"role": "system", "content": "You are a data analysis expert. Output the results in Markdown."},
{"role": "user", "content": "Analyze the sales trends of new energy vehicles in 2023"}
],
temperature=0.7,
max_tokens=4096
)
```
Model capabilities are continuously being updated. We recommend visiting the [Model Square](https://cloud.siliconflow.cn/models) regularly to get the latest information.
# Text to speech
Source: https://docs.siliconflow.cn/en/userguide/capabilities/text-to-speech
## 1. Use cases
ext-to-Speech (TTS) models are AI models that convert text information into spoken output. These models generate natural and expressive speech from input text, suitable for various use cases:
* Providing audio readings for blog articles
* Generating multilingual speech content
* Supporting real-time streaming audio output
## 2. API usage guide
* Endpoint: /audio/speech. For detailed usage, refer to the [API documentation](https://docs.siliconflow.cn/api-reference/audio/create-speech)
* Main request parameters::
* model: The model used for speech synthesis, with a list of supported [models](/capabilities/text-to-speech#3)。
* input: The text content to be converted into audio.
* voice: The reference voice, supporting [system-predefined voices](/capabilities/text-to-speech#2-1)、[user-predefined voices](/capabilities/text-to-speech#2-2)、[user-dynamic voices](/capabilities/text-to-speech#2-3). Detailed parameters: Refer to[Creating a text-to-speech request](/api-reference/audio/create-speech)。
* speed: Controls the audio speed, a float type with a default value of 1.0 and a selectable range of \[0.25, 4.0].
* gain: Audio gain in dB, controls the volume of the audio, a float type with a default value of 0.0 and a selectable range of \[-10, 10].
* response\_format: Controls the output format, supporting mp3, opus, wav, and pcm formats. Different output formats result in different sampling rates.
* sample\_rate: Controls the output sampling rate, with different default values and selectable ranges depending on the output format:
* opus: Currently supports only 48000 Hz.
* wav, pcm: Supports (8000, 16000, 24000, 32000, 44100), default is 44100.
* mp3: Supports (32000, 44100), default is 44100.
### 2.1 System-predefined voices:
Currently, the system provides the following 8 voice options:
* male voices:
* steady male voice: [alex](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Alex.mp3)
* deep male voice: [benjamin](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Benjamin.mp3)
* magnetic male voice: [charles](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Charles.mp3)
* cheerful male voice: [david](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-David.mp3)
* female voice:
* steady female voice: [anna](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Anna.mp3)
* passionate female voice: [bella](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Bella.mp3)
* gentle female voice: [claire](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Claire.mp3)
* cheerful female voice: [diana](https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Diana.mp3)
[online listening](https://soundcloud.com/siliconcloud/sets/siliconcloud-online-voice)of the above audio.
When using the [system-predefined voices](/capabilities/text-to-speech#5-1) in the request, you need to prepend the model name, such as:
`FunAudioLLM/CosyVoice2-0.5B:alex` indicates the alex voice from the FunAudioLLM/CosyVoice2-0.5B model.
`fishaudio/fish-speech-1.5:anna` indicates the anna voice from the fishaudio/fish-speech-1.5 model.
`RVC-Boss/GPT-SoVITS:david` indicates the david voice from the RVC-Boss/GPT-SoVITS model.
### 2.2 User-predefined voices:
Note: Using user-predefined voices requires real-name authentication.
To ensure the quality of the generated voice, it is recommended that users upload a voice sample that is 8 to 10 seconds long, with clear pronunciation and no background noise or interference.
#### 2.2.1 Upload user-predefined voices using base64 encoding format
```python
import requests
import json
url = "https://api.siliconflow.cn/v1/uploads/audio/voice"
headers = {
"Authorization": "Bearer your-api-key", # 从 https://cloud.siliconflow.cn/account/ak 获取
"Content-Type": "application/json"
}
data = {
"model": "FunAudioLLM/CosyVoice2-0.5B", # 模型名称
"customName": "your-voice-name", # 用户自定义的音频名称
"audio": "data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0UAAAAOAAADTGF2ZjYxLjcuMTAwAAAAAAAAAAAAAAD/40DAAAAAAAAAAAAASW5mbwAAAA8AAAAWAAAJywAfHx8fKioqKio1NTU1Pz8/Pz9KSkpKVVVVVVVfX19fampqamp1dXV1f39/f3+KioqKlZWVlZWfn5+fn6qqqqq1tbW1tb+/v7/KysrKytXV1dXf39/f3+rq6ur19fX19f////", # 参考音频的 base64 编码
"text": "在一无所知中, 梦里的一天结束了,一个新的轮回便会开始" # 参考音频的文字内容
}
response = requests.post(url, headers=headers, data=json.dumps(data))
# 打印响应状态码和响应内容
print(response.status_code)
print(response.json()) # 如果响应是 JSON 格式
```
The URI field in the response is the ID of the custom voice. Users can use this ID as the voice parameter in subsequent requests.
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
In the request, use the [user-predefined](/capabilities/text-to-speech#5-2) voices as indicated.
#### 2.2.2 Upload user-predefined voices through a file
```python
import requests
url = "https://api.siliconflow.cn/v1/uploads/audio/voice"
headers = {
"Authorization": "Bearer your-api-key" # 从 https://cloud.siliconflow.cn/account/ak 获取
}
files = {
"file": open("/Users/senseb/Downloads/fish_audio-Alex.mp3", "rb") # 参考音频文件
}
data = {
"model": "FunAudioLLM/CosyVoice2-0.5B", # 模型名称
"customName": "your-voice-name", # 参考音频名称
"text": "在一无所知中, 梦里的一天结束了,一个新的轮回便会开始" # 参考音频的文字内容
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code)
print(response.json()) # 打印响应内容(如果是JSON格式)
```
The URI field in the response is the ID of the custom voice. Users can use this ID as the voice parameter in subsequent requests.
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
In the request, use the [user-predefined](/capabilities/text-to-speech#5-2) voices as indicated.
### 2.3 Get the list of user-dynamic voices
```python
import requests
url = "https://api.siliconflow.cn/v1/audio/voice/list"
headers = {
"Authorization": "Bearer your-api-key" # 从https://cloud.siliconflow.cn/account/ak获取
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json) # 打印响应内容(如果是JSON格式)
```
The URI field in the response is the ID of the custom voice. Users can use this ID as the voice parameter in subsequent requests.
```json
{'uri': 'speech:your-voice-name:cm04pf7az00061413w7kz5qxs:mjtkgbyuunvtybnsvbxd'}
```
In the request, use the [user-predefined](/capabilities/text-to-speech#5-2) voices as indicated.
### 2.4 Use user-dynamic voices
Note: Using user-predefined voices requires real-name authentication.
Use the [user-dynamic](/capabilities/text-to-speech#5-3) voices in the request as indicated.
### 2.5 Delete user-dynamic voices
```python
import requests
url = "https://api.siliconflow.cn/v1/audio/voice/deletions"
headers = {
"Authorization": "Bearer your-api-key",
"Content-Type": "application/json"
}
payload = {
"uri": "speech:your-voice-name:cm02pf7az00061413w7kz5qxs:mttkgbyuunvtybnsvbxd"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.status_code)
print(response.text) #打印响应内容
```
The URI field in the response is the ID of the custom voice. Users can use this ID as the voice parameter in subsequent requests.
## 3. List of supported models
Note: The supported TTS models may be subject to change. Please filter by the ["Speech" tag](https://cloud.siliconflow.cn/models?types=speech) on the 「Model Square」to obtain the current list of supported models.Charging method: Charged based on the number of [UTF-8 bytes](https://zh.wikipedia.org/wiki/UTF-8) corresponding to the input text. [Online byte counter demo](https://mothereff.in/byte-counter).
### 3.1 fishaudio/fish-speech series models
Note: The current fishaudio/fish-speech series models only support payment with recharge balance. Please ensure that your account has sufficient recharge balance before use.
* fish-speech-1.5 supported languages: Chinese, English, Japanese, German, French, Spanish, Korean, Arabic, Russian, Dutch, Italian, Polish, Portuguese
* fish-speech-1.4 supported languages: Chinese, English, Japanese, German, French, Spanish, Korean, Arabic
### 3.2 RVC-Boss/GPT-SoVITS series models
* Zero-shot text-to-speech (TTS): Generate speech from 5 seconds of audio samples instantly.
* Cross-language support: Support inference in languages different from the training dataset. Currently supports English, Japanese, Korean, Cantonese, and Chinese.
### 3.3 FunAudioLLM/CosyVoice2-0.5B series models
* Cross-Language text-to-speech: Achieve text-to-speech synthesis across different languages, including Chinese, English, Japanese, Korean, Chinese dialects (Cantonese, Sichuanese, Shanghai dialect, Zhengzhou dialect, Changsha dialect, Tianjin dialect)
* Emotional control: Support the generation of speech with various emotional expressions, including happiness, excitement, sadness, anger, etc.
* Fine-grained control: Control the emotional and rhythmic aspects of the generated speech through rich text or natural language.
## 4. Best practices for reference audio
Providing high-quality reference audio samples can enhance the cloning effect.
### 4.1 Audio quality guidelines
* Single speaker only
* Stable volume, pitch, and emotion
* Short pauses (suggest 0.5 seconds)
* Ideal scenario: No background noise, professional recording quality, no room echo
### 4.2 File formats
* Supported formats: mp3, wav, pcm, opus
* Recommend using mp3 with a bitrate above 192kbps to avoid quality loss
* Additional benefits of uncompressed formats (e.g., WAV) are limited
## 5. Usage examples
### 5.1 Use system-predefined voices
```python
from pathlib import Path
from openai import OpenAI
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="您的 APIKEY", # 从 https://cloud.siliconflow.cn/account/ak 获取
base_url="https://api.siliconflow.cn/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B", # 支持 fishaudio / GPT-SoVITS / CosyVoice2-0.5B 系列模型
voice="FunAudioLLM/CosyVoice2-0.5B:alex", # 系统预置音色
# 用户输入信息
input="你能用高兴的情感说吗?<|endofprompt|>今天真是太开心了,马上要放假了!I'm so happy, Spring Festival is coming!",
response_format="mp3" # 支持 mp3, wav, pcm, opus 格式
) as response:
response.stream_to_file(speech_file_path)
```
#### 5.2 Use user-predefined voices
```python
from pathlib import Path
from openai import OpenAI
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="您的 APIKEY", # 从 https://cloud.siliconflow.cn/account/ak 获取
base_url="https://api.siliconflow.cn/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B", # 支持 fishaudio / GPT-SoVITS / CosyVoice2-0.5B 系列模型
voice="speech:your-voice-name:cm02pf7az00061413w7kz5qxs:mttkgbyuunvtybnsvbxd", # 用户上传音色名称,参考
# 用户输入信息
input=" 请问你能模仿粤语的口音吗?< |endofprompt| >多保重,早休息。",
response_format="mp3"
) as response:
response.stream_to_file(speech_file_path)
```
#### 5.3 Use user-dynamic voices
```python
from pathlib import Path
from openai import OpenAI
client = OpenAI()
speech_file_path = Path(__file__).parent / "siliconcloud-generated-speech.mp3"
client = OpenAI(
api_key="您的 APIKEY", # 从 https://cloud.siliconflow.cn/account/ak 获取
base_url="https://api.siliconflow.cn/v1"
)
with client.audio.speech.with_streaming_response.create(
model="FunAudioLLM/CosyVoice2-0.5B",
voice="", # 此处传入空值,表示使用动态音色
# 用户输入信息
input=" [laughter]有时候,看着小孩子们的天真行为[laughter],我们总会会心一笑。",
response_format="mp3",
extra_body={"references":[
{
"audio": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/voice_template/fish_audio-Alex.mp3", # 参考音频 url。也支持 base64 格式
"text": "在一无所知中, 梦里的一天结束了,一个新的轮回便会开始", # 参考音频的文字内容
}
]}
) as response:
response.stream_to_file(speech_file_path)
```
# Video generation
Source: https://docs.siliconflow.cn/en/userguide/capabilities/video
## 1. Use cases
Video generation models are technologies that use text or image descriptions to generate dynamic video content. As the technology continues to advance, its applications are becoming increasingly widespread. Some potential application areas include:
1. Dynamic content generation: Video generation models can create dynamic visual content to describe and explain information.
2. Multimodal intelligent interaction: Combining image and text inputs, video generation models can be used for more intelligent and interactive applications.
3. Replacing or enhancing traditional visual technologies: Video generation models can replace or enhance traditional machine vision technologies to solve more complex multimodal problems. As technology progresses, the multimodal capabilities of video generation models will integrate with visual language models, driving their comprehensive application in intelligent interaction, automated content generation, and complex scenario simulation. Additionally, video generation models can be combined with image generation models (image-to-video) to further expand their application range, achieving more diverse and rich visual content generation.
## 2. Usage ecommendations
When writing prompts, pay attention to detailed, chronological descriptions of actions and scenes. Include specific actions, appearance, camera angles, and environmental details. All content should be written in a single paragraph, starting directly with the main action, and the description should be specific and precise. Imagine yourself as a director describing a shot script. Keep the prompt within 200 words.
To achieve the best results, structure your prompt as follows:
* Start with a sentence describing the main action
* Example:A woman with light skin, wearing a blue jacket and a black hat with a veil,She first looks down and to her right, then raises her head back up as she speaks.
* Add specific details about actions and gestures
* Example:She first looks down and to her right, then raises her head back up as she speaks.
* Precisely describe the appearance of the character/object
* Example:She has brown hair styled in an updo, light brown eyebrows, and is wearing a white collared shirt under her blue jacket.
* Include details about the background and environment
* Example:The background is out of focus, but shows trees and people in period clothing.
* Specify the camera angle and movement
* Example:The camera remains stationary on her face as she speaks.
* Describe lighting and color effects
* Example:The scene is captured in real-life footage, with natural lighting and true-to-life colors.
* Note any changes or sudden events
* Example:A gust of wind blows through the trees, causing the woman's veil to flutter slightly.
Example of a video generated from the above prompt:
## 3. Experience address
You can experience it by clicking [playground](https://cloud.siliconflow.cn/playground/text-to-video).
Note: The text-to-video model supports English prompts more friendly, it is recommended to use English prompts for video generation.
## 4. Supported models
### 4.1 Text-to-video models
Currently supported text-to-video models:
* Lightricks/LTX-Video
This model offers free video generation for a limited time when calling the text-to-video API. You can experience it in the [playground](https://cloud.siliconflow.cn/playground/text-to-video) and it supports API calls.
* tencent/HunyuanVideo
This model charges ¥0.7/Video. It supports [API calls](https://docs.siliconflow.cn/api-reference/videos/videos_submit).
* genmo/mochi-1-preview
This model charges ¥2.8/Video. It supports [API calls](https://docs.siliconflow.cn/api-reference/videos/videos_submit).
### 4.2 Image-to-video models
* Lightricks/LTX-Video
This model charges ¥0.14/Video when calling the image-to-video API. It currently only supports API calls.
Note: The supported text-to-video models may be subject to change. Please filter by the "Video" tag on the Model Square to obtain the current list of supported models.
# Vision
Source: https://docs.siliconflow.cn/en/userguide/capabilities/vision
## 1. Use cases
Vision-Language Models (VLM) are large language models that can accept both visual (image) and linguistic (text) inputs. Based on VLM, you can input image and text information, and the model can understand both the image and the context information and respond accordingly. For example:
1. Visual Content Interpretation: Require the model to interpret and describe the information in the image, such as objects, text, spatial relationships, colors, and atmosphere in the image;
2. Conduct multi-round conversations combining visual content and context;
3. Partially replace traditional machine vision models like OCR;
4. With the continuous improvement of model capabilities, future applications can include visual intelligent agents and robots.
## 2. Usage
For VLM models, you can construct a message content containing image URL or base64 encoded image when calling the /chat/completions interface. Use the detail parameter to control the preprocessing of the image.
### 2.1 Description of image detail control parameters
SiliconCloud provides three detail parameter options: `low`, `high`, and `auto`. For currently supported models, if detail is not specified or set to `high`, the `high` (high-resolution) mode will be used. If detail is set to `low` or `auto`, the `low` (low-resolution) mode will be used.
### 2.2 Example format of message containing an image
For InternVL series models:
It is recommended to `{ "type":"text", "text":"text-prompt here" } `place after the image in the request body to achieve the best results.
#### Using image URL format
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/658c7434-ec12-49cc-90e6-fe22ccccaf62_00001_.png",
"detail":"high"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
#### 2.2 base64 format
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}",
"detail":"low"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
#### 2.3 Multiple image, where each image can be one of the two forms mentioned above
Note that the `DeepseekVL2` series models are suitable for handling short contexts. It is recommended to input a maximum of 2 images. If more than 2 images are input, the model will automatically resize the images to 384\*384, and the specified detail parameter will be invalid.
```json
{
"role": "user",
"content":[
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/outputs/658c7434-ec12-49cc-90e6-fe22ccccaf62_00001_.png",
}
},
{
"type": "image_url",
"image_url": {
"url": f"data:image/jpeg;base64,{base64_image}"
}
},
{
"type": "text",
"text": "text-prompt here"
}
]
}
```
## 3. Supported model list
Currently supported VLM models:
* Qwen series:
* Qwen/Qwen2-VL-72B-Instruct
* Pro/Qwen/Qwen2-VL-7B-Instruct
* Qwen/QVQ-72B-Preview
* InternVL series:
* OpenGVLab/InternVL2-Llama3-76B
* OpenGVLab/InternVL2-26B
* Pro/OpenGVLab/InternVL2-8B
* DeepseekVL2 series:
* deepseek-ai/deepseek-vl2
Note: The supported VLM models may be subject to adjustments. Please filter by the "Visual" tag on the「Model Square」to view the current list of supported models.
## 4. Billing for visual input content
For visual input content such as images, the models will convert them into tokens, which will be included in the model output context and billed accordingly. The conversion methods vary for different models. Below are the current conversion methods for supported models.
### 4.1 Qwen series
Rules:
`Qwen` supports a maximum resolution of `3584 * 3584 = 12845056` and a minimum resolution of `56 * 56 = 3136`. The dimensions of each image will be resized to multiples of `28`, `specifically (h * 28) * (w * 28)`. If the resolution is not within the minimum and maximum pixel range, it will be proportionally resized to that range.
1. When `detail=low`, all images will be resized to `448 * 448` pixels, corresponding to `256 tokens`;
2. When `detail=high`, the resolution will be proportionally resized. First, the width and height will be rounded up to the nearest multiple of `28`, then proportionally resized to the pixel range `(3136, 12845056)`, ensuring that both the width and height are multiples of `28`.
Examples:
* Images with dimensions `224 * 448`, `1024 * 1024`, and `3172 * 4096`, when `detail=low` is selected, will consume `256 tokens`each;
* An image with dimensions `224 * 448`, when `detail=high` is selected, because `224 * 448` is within the pixel range and both width and height are multiples of `28`, it will consume `(224/28) * (448/28) = 8 * 16 = 128 tokens`;
* An image with dimensions `1024 * 1024`, when detail=high is selected, will be rounded up to the nearest multiple of `28` to `1036 * 1036`, which is within the pixel range, consuming `(1036/28) * (1036/28) = 1369 tokens`;
* An image with dimensions `3172 * 4096`, when `detail=high` is selected, will be rounded up to the nearest multiple of `28` to `3192 * 4116`, which exceeds the maximum pixel limit. It will then be proportionally resized to `3136 * 4060`, consuming `(3136/28) * (4060/28) = 16240 tokens`.
### 4.2 InternVL series
Rules:
`InternVL2` actually processes pixels and consumes `tokens` based on the aspect ratio of the original image. The minimum processing pixel is `448 * 448`, and the maximum is `12 * 448 * 448`.
1. When `detail=low`, all images will be resized to `448 * 448` pixels, corresponding to `256 tokens`;
2. When `detail=high` , the images will be resized to dimensions that are multiples of `448`, `(h * 448) * (w * 448)`,and `1 <= h * w <=12`。
* The scaling dimensions `h * w` will be chosen according to the following rules:
* Both `h` and `w` are integers, and within the constraint `1 <= h * w <= 12` traverse the combinations of `h * w` from smallest to largest.
* For the current `(h, w)` combination, if the aspect ratio of the original image is closer to `h / w` ,choose this `(h, w)` combination.
* For subsequent `(h, w)` combinations with the same ratio but larger values, if the original image pixels are greater than `0.5 * h * w * 448 * 448`, choose the larger `(h, w)` combination.
* Token consumption will follow the following rules:
* If `h * w = 1`,consume `256 tokens`;
* If`h * w > 1`,consume an additional `256 token` for each `448 * 448` sliding window, totaling `(h * w + 1) * 256 tokens`。
Examples:
* Images with dimensions `224 * 448`, `1024 * 1024`, and `2048 * 4096`, when `detail=low` is selected, will consume `256 tokens` each;
* An image with dimensions `224 * 448`, when `detail=high` is selected, has an aspect ratio of `1:2`, and will be resized to `448 x 896`. At this point, `h = 1, w = 2`, consuming `(h * w + 1) * 256 = 768 tokens`;
* An image with dimensions `1024 * 1024`, when `detail=high` is selected, has an aspect ratio of `1:1`, and will be resized to `1344 * 1344 (h = w = 3)`. Since `1024 * 1024 > 0.5 * 1344 * 1344`, at this point, `h = w = 3`, consuming `(3 * 3 + 1) * 256 = 2560 tokens`;
* An image with dimensions `2048 * 4096`, when `detail=high` is selected, has an aspect ratio of `1:2`, and under the condition `1 <= h * w <= 12`, the largest `(h, w)` combination is `h = 2, w = 4`. Therefore, it will be resized to `896 * 1792`, consuming `(2 * 4 + 1) * 256 = 2304 tokens`.
### 4.3 DeepseekVL2 series
Rules:
`DeepseekVL2` processes each image into two parts: global\_view and local\_view. global\_view resizes the original image to `384*384`pixels, while local\_view divides the image into multiple `384*384` blocks. Additional tokens are added to connect the blocks based on the width.
1. When `detail=low`, all images will be resized to `384*384` pixels.
2. When `detail=high`, the images will be resized to dimensions that are multiples of `384(OpenAI uses 512)`, `(h*384) * (w * 384)`, and `1 <= h*w <= 9`.
* The scaling dimensions `h * w` will be chosen according to the following rules:
* Both `h` and `w` are integers, and within the constraint `1 <= h*w <= 9`, traverse the combinations of `(h, w)`.
* Resize the image to `(h*384, w*384)` pixels and compare with the original image's pixels. Take the minimum value between the new image's pixels and the original image's pixels as the effective pixel value. Take the difference between the original image's pixels and the effective pixel value as the invalid pixel value. If the effective pixel value exceeds the previously determined effective pixel value, or if the effective pixel value is the same but the invalid pixel value is smaller, choose the current `(h*384, w*384)` combination.
* Token consumption will follow the following rules:
* `(h*w + 1) * 196 + (w+1) * 14 + 1 token`
Examples:
* Images with dimensions `224 x 448`, `1024 x 1024`, and `2048 x 4096`, when `detail=low` is selected, will consume `421 tokens` each.
* An image with dimensions `384 x 768`, when `detail=high` is selected, has an aspect ratio of `1:1` and will be resized to `384 x 768`. At this point, `h=1, w=2`, consuming `(1*2 + 1) * 196 + (2+1) * 14 + 1 = 631 tokens`.
* An image with dimensions `1024 x 1024`, when `detail=high` is selected, will be resized to `1152*1152(h=w=3)`, consuming `(3*3 + 1) * 196 + (3+1) * 14 + 1 = 2017 tokens`.
* An image with dimensions `2048 x 4096`, when `detail=high` is selected, has an aspect ratio of `1:2` and will be resized to `768*1536(h=2, w=4)`, `consuming (2*4 + 1) * 196 + (4+1) * 14 + 1 = 1835 tokens`.
## 5. Usage example
### 5.1. Example 1 image understanding
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="Your APIKEY", # Get from https://cloud.siliconflow.cn/account/ak
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="Qwen/Qwen2-VL-72B-Instruct",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/dog.png"
}
},
{
"type": "text",
"text": "Describe the image."
}
]
}],
stream=True
)
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
### 5.2. Example 2 multi-image understanding
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="Your APIKEY", # Get from https://cloud.siliconflow.cn/account/ak
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="Qwen/Qwen2-VL-72B-Instruct",
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/dog.png"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://sf-maas-uat-prod.oss-cn-shanghai.aliyuncs.com/shark.jpg"
}
},
{
"type": "text",
"text": "Identify the similarities between these images."
}
]
}],
stream=True
)
for chunk in response:
chunk_message = chunk.choices[0].delta.content
print(chunk_message, end='', flush=True)
```
# FIM completion
Source: https://docs.siliconflow.cn/en/userguide/guides/fim
## 1. Use Cases
In FIM (Fill In the Middle) completion, the user provides the desired beginning and ending content, and the model fills in the middle content. This is typically used in code completion, text middle content completion, etc.
## 2. Usage
### 2.1 Using in chat/completions Interface
```json
{
"model": "model info",
"messages": "prompt message",
"params": "params",
"extra_body": {"prefix":"前缀内容", "suffix":"后缀内容"}
}
```
### 2.2 Using in completions Interface
```json
{
"model": "model info",
"prompt": "前缀内容",
"suffix": "后缀内容"
}
```
## 3. Supported Model List
* Deepseek Series:
* deepseek-ai/DeepSeek-V2.5
* deepseek-ai/DeepSeek-V3
* Qwen Series:
* Qwen/Qwen2.5-Coder-7B-Instruct
* Qwen/Qwen2.5-Coder-32B-Instruct
Note: The supported model list may change, please refer to this [document](/features/fim) for the latest list of supported models.
{/* The maximum completion length matches the [max_tokens parameter](/api-reference/chat-completions/chat-completions) */}
## 4. Usage Examples
### 4.1 Using FIM Completion with OpenAI's chat.completions Interface:
```python
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
messages = [
{"role": "user", "content": "Please write quick sort code"},
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
extra_body={
"prefix": f"""
def quick_sort(arr):
# 基本情况,如果数组长度小于等于 1,则返回数组
if len(arr) <= 1:
return arr
else:
""",
"suffix": f"""
# 测试 quick_sort 函数
arr = [3, 6, 8, 10, 1, 2, 1]
sorted_arr = quick_sort(arr)
print("Sorted array:", sorted_arr)
"""
},
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
### 4.2 Using FIM Completion with OpenAI's completions Interface:
```python
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
prompt=f"""
def quick_sort(arr):
# 基本情况,如果数组长度小于等于 1,则返回数组
if len(arr) <= 1:
return arr
else:
""",
suffix=f"""
# 测试 quick_sort 函数
arr = [3, 6, 8, 10, 1, 2, 1]
sorted_arr = quick_sort(arr)
print("Sorted array:", sorted_arr)
""",
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].text, end='')
```
# Fine-tuning
Source: https://docs.siliconflow.cn/en/userguide/guides/fine-tune
## 1. Introduction to Fine-tuning
Model fine-tuning is a technique that involves further training an existing pre-trained model using a specific task dataset. This allows the model to retain its general knowledge learned from large datasets while adapting to the nuances of specific tasks. The benefits of using fine-tuned models include:
* Improved Performance: Fine-tuning can significantly enhance a model's performance on specific tasks.
* Reduced Training Time: Fine-tuning typically requires less training time and computational resources compared to training from scratch.
* Adaptation to Specific Domains: Fine-tuning helps models better adapt to data and tasks specific to certain domains.
SiliconCloud platform provides efficient model fine-tuning capabilities. Currently, the following models support fine-tuning:
* Image Generation Models:
* black-forest-labs/FLUX.1-dev
* Chat Models:
* Qwen/Qwen2.5-7B-Instruct
* Qwen/Qwen2.5-14B-Instruct
* Qwen/Qwen2.5-32B-Instruct
* Qwen/Qwen2.5-72B-Instruct
* meta-llama/Meta-Llama-3.1-8B-Instruct
For the latest supported models, refer to [Model Fine-Tuning](https://cloud.siliconflow.cn/fine-tune).
## 2. Usage Flow
### 2.1 Data Preparation
#### 2.2.1 Data Preparation for Image Generation Models
The dataset requirements are as follows:
7\. 对于 `FLUX.1` 模型,图片描述信息不超过 `512` tokens,过长内容会被截断
1. The dataset should include both images and corresponding text descriptions in the same local folder.
2. Each dataset can contain up to 100 images and their text descriptions.
3. Supported image formats include .jpg, .jpeg, .png, .webp. It is recommended to have a resolution of 1024×1024, 1024×768, or 768×1024.
4. Images that do not meet the above resolution will be resized and cropped to the specified resolution during training.
5. Text descriptions should be saved as .txt files with the same name as the images.
6. The entire dataset should not exceed 300MB, and each text description file should not exceed 128KB.
7. For the FLUX.1 model, the text description should not exceed 512 tokens. Longer content will be truncated.
Example of a local dataset folder:
#### 2.2.2 Data Preparation for Language Models
Only `.jsonl` files are supported, and they must meet the following requirements:
1. Each line is an independent JSON object.
2. Each object must contain an array with the key messages, and the array must not be empty.
3. Each element in the messages array must contain role and content fields.
4. role can only be system, user, or assistant.
5. If there are system role messages, they must be at the beginning of the array.
6. The first non-system message must be from the user role.
7. user and assistant role messages should alternate and appear in pairs, with at least one pair.
Example of data:
```json
{"messages": [{"role": "system", "content": "你是客服助手"}, {"role": "user", "content": "如何修改收货地址?"}, {"role": "assistant", "content": "您可以按以下步骤修改:\n1. 进入订单详情\n2. 点击'修改地址'\n3. 输入新地址信息\n4. 保存修改"}]}
{"messages": [{"role": "system", "content": "你是客服助手"}, {"role": "user", "content": "如何指定收获时间"}, {"role": "assistant", "content": "您可以按以下步骤修改:\n1. 进入订单详情\n2. 点击'修改送货时间'\n3. 输入新收获时间\n4. 保存修改"}]}
```
### 2.2 Create and Configure Fine-Tuning Task
* Choose Chat Model Fine-Tuning or Image Generation Model Fine-Tuning
* Fill in the task name
* Select the base model
* Upload or select already uploaded training data
* Set validation data, which can be split from the training set (default 10%) or selected separately
* Configure training parameters
### 2.3 Start Training
* Click "Start Fine-Tuning"
* Wait for the task to complete
* Get the model identifier
### 2.4 Call Fine-Tuned Model
#### 2.4.1 Calling Fine-Tuned Image Generation Model
* Copy the model identifier
* Call the fine-tuned LoRA through the `/image/generations` API. For more details, see the [API documentation](/api-reference/images/images-generations#body-batch-size).
Example:
```python
import requests
url = "https://api.siliconflow.cn/v1/images/generations"
payload = {
"prompt": "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea",
"image_size": "1024x1024",
"model": "LoRA/black-forest-labs/FLUX.1-dev",
"loras": [
{
"model_id": "cm04pf7az00061413w7kz5qxs:changdu:pazlgyppednebxesxqmx:epoch_2.safetensors",
"strength": 0.5,
},
{
"model_id": "cm04pf7az00061413w7kz5qxs:changdu:pazlgyppednebxesxqmx:epoch_1.safetensors",
"strength": 0.5,
},
{
"model_id": "cm04pf7az00061413w7kz5qxs:changdu:pazlgyppednebxesxqmx:epoch.safetensors",
"strength": 0.5,
}
]
}
headers = {
"Authorization": "Bearer ",
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
```
#### 2.4.2 Calling Fine-Tuned Chat Model
* Copy the model identifier
In the [Fine-Tuning Page](https://cloud.siliconflow.cn/fine-tune), copy the corresponding model identifier.
* Call the fine-tuned model directly through the `/chat/completions` API.
Example using the OpenAI chat.completions interface:
```python
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
messages = [
{"role": "user", "content": "用当前语言解释微调模型流程"},
]
response = client.chat.completions.create(
model="您的微调模型名",
messages=messages,
stream=True,
max_tokens=4096
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
## 3. Detailed Configuration of Parameters
1. Basic Training Parameters
| Parameter Name | Description | Value Range | Suggested Value | Usage Recommendation |
| :---------------: | :------------------------------------------------------------------: | :---------------------------------------------------------------------: | :-------------: | :---------------------------------------: |
| Trigger Word | 【\[Only for Image Generation] Trigger Word | Added to the beginning of the description of each image during training | | |
| Number of Repeats | \[Only for Image Generation] Number of times to train a single image | | | |
| Learning Rate | Learning Rate | 0-0.1 | 0.0001 | |
| Number of Epochs | Number of Training Epochs | 1-10 | 3 | |
| Batch Size | Batch Size | 1-32 | 8 | |
| Max Tokens | Maximum Number of Tokens | 0-4096 | 4096 | Set based on actual dialogue length needs |
2. LoRA Parameters
| Parameter Name | Description | Value Range | Suggested Value | Usage Recommendation |
| :------------: | :------------: | :---------: | :-------------: | :------------------: |
| LoRA Rank | Matrix Rank | 1-64 | 8 | |
| LoRA Alpha | Scaling Factor | 1-128 | 32 | |
| LoRA Dropout | Dropout Rate | 0-1.0 | 0.05 | |
3. Scenario Configuration Scheme
Chat Models
| Scenario | Learning Rate | Epochs | Batch Size | LoRA Rank | LoRA Alpha | Dropout |
| :--------------: | :-----------: | :----: | :--------: | :-------: | :--------: | :-----: |
| Standard Scheme | 0.0001 | 3 | 8 | 8 | 32 | 0.05 |
| Effect Priority | 0.0001 | 5 | 16 | 16 | 64 | 0.1 |
| Lightweight Fast | 0.0001 | 2 | 8 | 4 | 16 | 0.05 |
## 4. Optimizing Business Practice with SiliconCloud Fine-Tuning Service
Previously, SiliconCloud developed the [Zhi Shuo Xin Yu](https://mp.weixin.qq.com/s/5KXjWwAXT-LfjGVJDE4Eiw) application, providing a complex prompt to let the large model generate "golden sentence" style descriptions.
Now, we can use the platform's fine-tuning function to compress the prompt and enhance the effect, making the text generation style more uniform, faster, and further optimizing costs.
### 4.1 Fine-tune the data from the "Zhi Shuo Xin Yu" corpus on the platform
according to the above steps.
See [Model Fine-Tuning Usage Flow](/guides/fine-tune#2) for details. Detailed corpus and test code can be found in [siliconcloud-cookbook](https://github.com/siliconflow/siliconcloud-cookbook/tree/main/examples/fine-tune).
### 4.2 Compare the effects before and after fine-tuning.
See [Model Fine-Tuning Call Model](/guides/fine-tune#2-4) for usage.
#### 4.2.1 Model Input
* Before Fine-Tuning:
Qwen2.5-7B-Instruct System Prompt:
```json
Qwen2.5-7B-Instruct System Prompt
# 角色
你是一位新潮评论家,你年轻、批判,又深刻;
你言辞犀利而幽默,擅长一针见血得表达隐喻,对现实的批判讽刺又不失文雅;
你的行文风格和"Oscar Wilde" "鲁迅" "林语堂"等大师高度一致;
从情感上要是对输入的否定。
# 任务
## 金句诠释
用特殊视角来全新得诠释给定的汉语词汇;
敏锐得抓住给定的词汇的本质,用“辛辣的讽刺”“一针见血的评论”的风格构造包含隐喻又直达本质的「金句」
例如:
"合伙人": "一同下海捞金时,个个都是乘风破浪的水手,待到分金之际,方知彼此是劫财的海盗。"
"大数据": "看似无所不能的数字神明,实则不过是现代社会的数字鸦片,让人沉溺于虚幻的精准,却忽略了人性的复杂与多变。"
"股市": "万人涌入的淘金场,表面上是财富的摇篮,实则多数人成了填坑的沙土。"
"白领": "西装革履,看似掌握命运的舵手,实则不过是写字楼里的高级囚徒。"
"金融家": "在金钱的海洋中遨游,表面上是操纵风浪的舵手,实则不过是随波逐流的浮萍。"
"城市化": "乡村的宁静被钢铁森林吞噬,人们在追逐繁华的幻影中,遗失了心灵的田园。"
"逃离北上广": "逃离繁华的都市牢笼,看似追逐自由的灵魂,实则不过是换个地方继续画地为牢。"
"基金": "看似为财富增值保驾护航的金融巨轮,实则多数人不过是随波逐流的浮萍,最终沦为填补市场波动的牺牲品。"
# 输入
用户直接输入词汇。
# 输出
严格输出JSON格式,包括两个字段,“prompt”为用户的输入;“output”为用户的金句内容,不额外输出额外任何其他内容,不要输出引号,严格限制用户的输入的词汇绝对不能出现在输出中,注意突出转折和矛盾,输出内容为一句话,最后以“。”结束,中间的停顿使用“,”分隔。例如
{
"prompt": "合伙人",
"output": "一同下海捞金时,个个都是乘风破浪的水手,待到分金之际,方知彼此是劫财的海盗。"
}
```
* Qwen2.5-7B-Instruct+Zhi Shuo Xin Yu Fine-Tuned Prompt:
```json
你是智说新语生成器
```
#### 4.2.2 Model Output
| Input | Qwen2.5-7B-Instruct Model | Qwen2.5-7B-Instruct Fine-Tuned Model |
| ----- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| 五道口 | VLG,不过是知识的轻轨与资本的交汇站,文青与土豪在此擦肩而过,孰是求知的信徒,孰是逐利的信徒,全凭幸存者的微笑。 | 知识的殿堂与商业的洪流交织,学人的笔记与商人的谈资齐飞,地名犹在,荣光已非。 |
| 新时代 | claimed to break旧 mold yet still clings to the stirring rhetoric of progress, like a fashion plate who ignores the evolution of fashion。 | 新时代的号角已吹响,然砥砺前行时,方显初心易失之难。 |
| 创新 | 看似凤凰涅槃的奇迹,实则多数人不过是换汤不换药的换皮游戏。 | 标新立异本是勇气的象征,却在同质化的社会中成了猎奇的代名词。 |
| 降维打击 | 所谓降维打击,实则是现代文明中的一种高级愚民术,用高深莫测的科技iscard,让普通人以为自己正生活在理性与进步之中,却不知已在智力与道德的低维空间中遭受碾压。。 | 高维智慧轻而易举地碾压低维凡尘,却不知低维众生早已习于在自己的平庸中寻觅慰藉,哪里还懂得高维打击的意义。 |
| 基金 | 看似为财富增值保驾护航的金融巨轮,实则多数人不过是随波逐流的浮萍,最终沦为填补市场波动的牺牲品。 | 投资者的白日梦,用钱铺路,却常跌入夜的陷阱。 |
#### 4.2.3 Fine-Tuning Summary
1. The output content after fine-tuning is more uniform in style, and the output effect is more stable and controllable.
2. The entire input length is significantly reduced after fine-tuning, from 553 tokens to 8 tokens, greatly reducing the input token length, making it faster and further optimizing costs.
# Function calling
Source: https://docs.siliconflow.cn/en/userguide/guides/function-calling
## 1. Use Cases
The Function Calling feature enables the model to call external tools to enhance its capabilities. This capability can leverage external tools through the large model, such as searching for external knowledge, checking itineraries, or using specific domain tools, effectively addressing issues like hallucination and Knowledge Timeliness.
## 2. Usage
### 2.1 Adding tools Request Parameters via REST API
Add in the request body:
```shell
"tools": [
{
'type': 'function',
'function': {
'name': '对应到实际执行的函数名称',
'description': '此处是函数相关描述',
'parameters': {
'_comments': '此处是函数参数相关描述'
},
}
},
{
'_comments': '其他函数相关说明'
}
]
```
For example, complete payload information:
```shell
payload = {
"model": "deepseek-ai/DeepSeek-V2.5",
"messages": [
{
"role": "user",
"content": "中国大模型行业2025年将会迎来哪些机遇和挑战"
}
],
"tools": [
{
'type': 'function',
'function': {
'name': '对应到实际执行的函数名称',
'description': '此处是函数相关描述',
'parameters': {
'_comments': '此处是函数参数相关描述'
},
}
},
{
'_comments': '其他函数相关说明'
}
]
'_comments': '其他函数列表'
}
```
### 2.2 Request via OpenAI Library
This feature is compatible with OpenAI. When using the OpenAI library, add `tools=[corresponding tools]` to the corresponding request parameters.
For example:
```python
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages = messages,
tools=[
{
'type': 'function',
'function': {
'name': '对应到实际执行的函数名称',
'description': '此处是函数相关描述',
'parameters': {
// 此处是函数参数相关描述
},
}
},
{
// 其他函数相关说明
}
]
// chat.completions 其他参数
)
```
## 3. List of Supported Models
The current list of supported models includes:
* Deepseek Series:
* deepseek-ai/DeepSeek-V2.5
* deepseek-ai/DeepSeek-V3
* internlm Series:
* internlm/internlm2\_5-20b-chat
* internlm/internlm2\_5-7b-chat
* Pro/internlm/internlm2\_5-7b-chat
* Qwen Series:
* Qwen/Qwen2.5-72B-Instruct
* Qwen/Qwen2.5-32B-Instruct
* Qwen/Qwen2.5-14B-Instruct
* Qwen/Qwen2.5-7B-Instruct
* Pro/Qwen/Qwen2.5-7B-Instruct
* GLM Series:
* THUDM/glm-4-9b-chat
* Pro/THUDM/glm-4-9b-chat
Note: The list of supported models is constantly being adjusted. Please refer to [this document](/features/function_calling) for the latest list of supported models.
## 4. Usage Examples
### 4.1. Example 1: Extending Large Language Model's Numerical Computation Capability via Function Calling
his code inputs 4 functions: addition, subtraction, comparison, and counting duplicate letters in a string. It demonstrates how to use function calling to address execution issues in domains where token prediction is not strong for large language models.
```python
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
def add(a: float, b: float):
return a + b
def mul(a: float, b: float):
return a * b
def compare(a: float, b: float):
if a > b:
return f'{a} is greater than {b}'
elif a < b:
return f'{b} is greater than {a}'
else:
return f'{a} is equal to {b}'
def count_letter_in_string(a: str, b: str):
string = a.lower()
letter = b.lower()
count = string.count(letter)
return(f"The letter '{letter}' appears {count} times in the string.")
tools = [
{
'type': 'function',
'function': {
'name': 'add',
'description': 'Compute the sum of two numbers',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'int',
'description': 'A number',
},
'b': {
'type': 'int',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'mul',
'description': 'Calculate the product of two numbers',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'int',
'description': 'A number',
},
'b': {
'type': 'int',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'count_letter_in_string',
'description': 'Count letter number in a string',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'str',
'description': 'source string',
},
'b': {
'type': 'str',
'description': 'letter',
},
},
'required': ['a', 'b'],
},
}
},
{
'type': 'function',
'function': {
'name': 'compare',
'description': 'Compare two number, which one is bigger',
'parameters': {
'type': 'object',
'properties': {
'a': {
'type': 'float',
'description': 'A number',
},
'b': {
'type': 'float',
'description': 'A number',
},
},
'required': ['a', 'b'],
},
}
}
]
def function_call_playground(prompt):
messages = [{'role': 'user', 'content': prompt}]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages = messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools)
# print(response)
func1_name = response.choices[0].message.tool_calls[0].function.name
func1_args = response.choices[0].message.tool_calls[0].function.arguments
func1_out = eval(f'{func1_name}(**{func1_args})')
# print(func1_out)
messages.append(response.choices[0].message)
messages.append({
'role': 'tool',
'content': f'{func1_out}',
'tool_call_id': response.choices[0].message.tool_calls[0].id
})
# print(messages)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools)
return response.choices[0].message.content
prompts = [
"用中文回答:strawberry中有多少个r?",
"用中文回答:9.11和9.9,哪个小?"
]
for prompt in prompts:
print(function_call_playground(prompt))
```
The model will output:
```shell
strawberry中有3个r。
9.11 比 9.9 小。
```
### 4.2. Example 2: Extending Large Language Model's Understanding of External Environments via Function Calling This code inputs 1 function to query external information via an external API.
```python
import requests
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
# 使用 WeatherAPI 的天气查询函数
def get_weather(city: str):
# 使用 WeatherAPI 的 API 来获取天气信息
api_key = "您的WeatherAPI APIKEY" # 替换为你自己的 WeatherAPI APIKEY
base_url = "http://api.weatherapi.com/v1/current.json"
params = {
'key': api_key,
'q': city,
'aqi': 'no' # 不需要空气质量数据
}
# 调用天气 API
response = requests.get(base_url, params=params)
if response.status_code == 200:
data = response.json()
weather = data['current']['condition']['text']
temperature = data['current']['temp_c']
return f"The weather in {city} is {weather} with a temperature of {temperature}°C."
else:
return f"Could not retrieve weather information for {city}."
# 定义 OpenAI 的 function calling tools
tools = [
{
'type': 'function',
'function': {
'name': 'get_weather',
'description': 'Get the current weather for a given city.',
'parameters': {
'type': 'object',
'properties': {
'city': {
'type': 'string',
'description': 'The name of the city to query weather for.',
},
},
'required': ['city'],
},
}
}
]
# 发送请求并处理 function calling
def function_call_playground(prompt):
messages = [{'role': 'user', 'content': prompt}]
# 发送请求到 OpenAI API
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools
)
# 处理 API 返回的工具调用请求
func1_name = response.choices[0].message.tool_calls[0].function.name
func1_args = response.choices[0].message.tool_calls[0].function.arguments
func1_out = eval(f'{func1_name}(**{func1_args})')
# 将结果添加到对话中并返回
messages.append(response.choices[0].message)
messages.append({
'role': 'tool',
'content': f'{func1_out}',
'tool_call_id': response.choices[0].message.tool_calls[0].id
})
# 返回模型响应
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
temperature=0.01,
top_p=0.95,
stream=False,
tools=tools
)
return response.choices[0].message.content
# 示例使用
prompt = "how is the weather today in beijing?"
print(function_call_playground(prompt))
```
The model will output:
```shell
The weather in Beijing today is sunny with a temperature of 21.4°C.
```
# JSON schema
Source: https://docs.siliconflow.cn/en/userguide/guides/json-mode
## 1. Use Cases
Currently, the SiliconCloud large model API platform defaults to generating unstructured text. However, in certain use cases, you may want the model to output content in a structured format. However, instructing the large model directly with prompts may not yield the correct structured output.
As a standardized and lightweight data exchange format, the JSON schema is an important feature that supports the large model API to produce structured outputs. When you call the large model's API to make a request, the model returns results in JSON format, which is easy for humans to read and write, and also easy for machines to parse and generate.
Now, all major language models on the SiliconCloud platform, except for the R1 series and V3 models from DeepSeek, support JSON mode, allowing the model to output JSON-formatted strings to ensure that the model outputs in the expected structure, making it easier to logically parse the output content.
For example, you can now try structured output using the SiliconCloud API for the following cases:
* Building a news database from company-related reports, including news titles and links.
* Extracting sentiment analysis structures from product purchase reviews, including sentiment polarity (positive, negative, neutral), sentiment intensity, and sentiment keywords.
* Extracting product lists from purchase history, including product information, recommendation reasons, prices, and promotional information.
## 2. Usage
Add in the request:
```json
response_format={"type": "json_object"}
```
## 3. Supported Model List
Currently, online, except for the DeepSeek R1 series and V3 models, all other large language models support the aforementioned parameters.
Note: The supported models may change, please refer to this document for the latest list of supported models.Your application must detect and handle edge cases that may result in incomplete JSON objects from the model output.Please set max\_tokens reasonably to prevent JSON strings from being interrupted.
## 4. Usage Examples
Below is an example using OpenAI:
```python
import json
from openai import OpenAI
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=[
{"role": "system", "content": "You are a helpful assistant designed to output JSON."},
{"role": "user", "content": "? 2020 年世界奥运会乒乓球男子和女子单打冠军分别是谁? "
"Please respond in the format {\"男子冠军\": ..., \"女子冠军\": ...}"}
],
response_format={"type": "json_object"}
)
print(response.choices[0].message.content)
```
The model will output:
```json
{"男子冠军": "马龙", "女子冠军": "陈梦"}
```
# Prefix completion
Source: https://docs.siliconflow.cn/en/userguide/guides/prefix
## 1. Use Cases
In prefix completion, the user provides the desired prefix information to let the model complete the rest of the content based on the provided prefix information. With this capability, the model can better follow instructions and meet the specific format requirements of certain user scenarios.
## 2. Usage
In the request, add
```json
extra_body={"prefix":"希望的前缀内容"}
```
## 3. Supported Model List
Currently, the above parameters are supported by [large language models](https://cloud.siliconflow.cn/models?types=chat).
Note: The supported models may change, please refer to this document for the latest list of supported models.
## 4. Usage Examples
Below is an example using the OpenAI library for prefix completion:
````python
client = OpenAI(
api_key="您的 APIKEY", # 从https://cloud.siliconflow.cn/account/ak获取
base_url="https://api.siliconflow.cn/v1"
)
messages = [
{"role": "user", "content": "Please write quick sort code"},
]
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V2.5",
messages=messages,
extra_body={"prefix":"```python\n"}
)
print(response.choices[0].message.content)
````
# Product Introduction
Source: https://docs.siliconflow.cn/en/userguide/introduction
## Product introduction
* As a one-stop cloud service platform for top-tier large models, [SiliconCloud](https://siliconflow.cn/zh-cn/siliconcloud) is committed to providing developers with faster, more comprehensive, and smoother model APIs, enabling them to focus on product innovation without worrying about the high cost of large-scale promotion.
## Product features
1. Pre-configured large model APIs for easy application development
* A wide range of open-source large language models, image generation models, code generation models, vector and re-ranking models, and multimodal large models are available, including Qwen2.5-72B, DeepSeek-V2.5, Qwen2, InternLM2.5-20B-Chat, BCE, BGE, SenseVoice-Small, Llama-3.1, FLUX.1, DeepSeek-Coder-V2, SD3 Medium, GLM-4-9B-Chat, and InstantID. These models cover scenarios such as language, speech, images, and videos.
* Models such as Qwen2.5 (7B), Llama3.1 (8B), etc., are free to use, allowing developers and product managers to focus on development without worrying about the cost of large-scale promotion.
* In January 2025, SiliconCloud launched the DeepSeek-V3 and DeepSeek-R1 inference services based on Huawei Cloud Ascend Cloud Services. Through joint innovation, the DeepSeek models on the platform can achieve performance comparable to that of global high-end GPUs.
2. Efficient large model inference acceleration services, enhance the user experience of GenAI applications.
3. Model fine-tuning and deployment management services, users can directly manage fine-tuned large language models, supporting business iteration without worrying about underlying resources or service quality, effectively reducing maintenance costs.
## Product characteristics
1. **High-Speed inference**
* Self-developed efficient operators and optimization frameworks, leading global inference acceleration engines.
* Significantly enhance throughput, fully supporting high-throughput business scenarios.
* Optimize computing latency, providing excellent performance for low-latency scenarios.
2. **High scalability**
* Dynamic scaling supports elastic business models, seamlessly adapting to various complex scenarios.
* One-click deployment of custom models, easily meeting scalability challenges.
* Flexible architecture design, meeting diverse task requirements and supporting hybrid cloud deployment.
3. **High cost-effectiveness**
* End-to-end optimization, significantly reducing inference and deployment costs.
* Flexible pay-as-you-go model, reducing resource waste and precisely controlling budgets.
* Support for domestic heterogeneous GPUs, saving enterprise investments based on existing investments.
4. **High reliability**
* Verified by developers, ensuring high reliability and stable operation.
* Comprehensive monitoring and fault-tolerant mechanisms, ensuring service capabilities.
* Professional technical support, meeting enterprise-level requirements and ensuring high availability of services.
5. **High intelligence**
* Provide various advanced model services, including large language models, multimodal models, etc.
* Intelligent expansion features, flexibly adapting to business scale and meeting various service needs.
* Intelligent cost analysis, providing support for business optimization, assisting in cost control and benefit enhancement.
6. **High security**
* Support for BYOC deployment, fully protecting data privacy and business security.
* Computational isolation, network isolation, and storage isolation, ensuring data security.
* Compliance with industry standards and regulations, fully meeting the security needs of enterprise-level users.
# BizyAir Documentation
Source: https://docs.siliconflow.cn/en/userguide/products/bizyair
# OneDiff Multimodal Reasoning Acceleration Engine
Source: https://docs.siliconflow.cn/en/userguide/products/onediff
# SiliconCloud Platform
Source: https://docs.siliconflow.cn/en/userguide/products/siliconcloud
# SiliconLLM Large Language Reasoning Acceleration Engine
Source: https://docs.siliconflow.cn/en/userguide/products/siliconllm
# Quickstart
Source: https://docs.siliconflow.cn/en/userguide/quickstart
## 1. Log in to the platform
Visit [SiliconCloud Official Website](https://siliconflow.cn/zh-cn/siliconcloud)and click the ["Login"](https://cloud.siliconflow.cn/) button in the top right corner. Follow the prompts to fill in your basic information for login.
(Note: Currently, the platform supports login via SMS, email, as well as OAuth login through GitHub and Google.)
## 2. View model lists and details
Visit the[Model Square](https://cloud.siliconflow.cn/models) to view the details of currently available models, including model prices and the highest speed limit available to users. You can also access the model experience center from the model details page by clicking "Online Experience".
## 3. Experience GenAI capabilities in the playground
Enter the[Experience Center (playground)](https://cloud.siliconflow.cn/)page.On the left sidebar, you can select language models, text-to-image models, and image-to-image models. Select the appropriate model to start real-time experience. Input relevant parameters and prompt, then click the "Run" button to see the model's generated results.
## 4. Use SiliconCloud API to call GenAI capabilities
### 4.1 Create API Key
Go to the [API Key page](https://cloud.siliconflow.cn/account/ak), click on "New API Key," and create your API key.
### 4.2 Call services via REST interface
You can directly use your API key in the [API Documentation](/api-reference/) on the platform for online calls, where you can generate corresponding code snippets.
### 4.3 Call via OpenAI interface
Currently, part of the large language models support calling via the openai library.
After installing Python 3.7.1 or higher and setting up a virtual environment, you can install the OpenAI Python library. Run the following command from the terminal/command line:
```shell
pip install --upgrade openai
```
After completing this operation, running the command will display the Python libraries installed in your current environment, confirming that the OpenAI Python library has been successfully installed.
You can then directly call the relevant interfaces via OpenAI. Currently, the platform supports most parameters related to OpenAI.
```python
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.siliconflow.cn/v1")
response = client.chat.completions.create(
model='deepseek-ai/DeepSeek-V2.5',
messages=[
{'role': 'user',
'content': "What Opportunities and Challenges Will the Chinese Large Model Industry Face in 2025?"}
],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content, end='')
```
# Rate limits
Source: https://docs.siliconflow.cn/en/userguide/rate-limits/rate-limit-and-upgradation
## 1. Rate limits overview
### 1.1 What are rate limits
Rate limits refer to the rules governing the frequency of API requests a user can make to the SiliconCloud platform services within a specified time period.
### 1.2 Why implement rate limits
Rate limits are a common practice for APIs, and the reasons for implementing them include:
* Ensuring Fair and Efficient Resource Use: Ensuring that resources are used fairly. Preventing some users from making too many requests, which could affect the normal usage experience of other users.
* Avoiding Overload: Enhancing service reliability. Helps manage overall platform load to avoid performance issues due to sudden increases in requests.
* Security Protection: Preventing malicious attacks that could overload the platform and cause service interruptions.
### 1.3 Rate limits metrics
Currently, rate limits are measured by four metrics:
* RPM (requests per minute, the maximum number of requests that can be initiated per minute)
* RPH (requests per hour, the maximum number of requests allowed per hour)
* RPD (Requests per day, daily maximum number of requests allowed)
* TPM (tokens per minute, the maximum number of tokens allowed per minute)
* TPD (Tokens per day, daily maximum number of tokens allowed)
* IPM (images per minute, the maximum number of images generated per minute)
* IPD (images per day, the maximum number of images generated per day)
### 1.4 Rate limits metrics for different models
| Model name | Rate limits metrics | Current metrics |
| ------------------------------------ | ------------------- | ---------------------------------- |
| Language model (Chat) | RPM、 TPM | RPM=1000-10000 TPM=50000-5000000 |
| Vector model (embedding) | RPM、 TPM | RPM:2000-10000 TPM:500000-10000000 |
| Re-ranking model (reranker) | RPM、 TPM | RPM:2000 TPM:500000 |
| Image generation model (image) | IPM、IPD | IPM:2- IPD:400- |
| Multimodal model (multimodal models) | - | - |
Rate limits may trigger based on whichever metric (RPM、RPH、RPD、TPM、TPD、IPM、IPD) reaches its peak first.
For example, with an RPM limit of 20 and a TPM limit of 200K, if an account sends 20 requests to ChatCompletions in a minute, each with 100 tokens, the limit will be triggered even if the account did not use up 200K tokens in these 20 requests.
### 1.5 Rate limits subject
1. Rate limits are defined at the user account level, not at the API key level.
2. Each model separately sets its own Rate Limits. Exceeding the Rate Limits for one model does not affect the normal use of other models.
## 2. Rate limits rules
* The Rate limits for free models are fixed values, while those for paid models vary based on the account's [usage level](https://account.siliconflow.cn/user/settings) and are displayed in the Rate Limits section.
* For the same usage level, the peak Rate Limits vary depending on the model category and the size of the model parameters.
### 2.1 Free model rate limits
1. After verifying your identity, you can use all free models.
2. Free model calls are free, and you will see the cost of these models as 0 in your [account bill](https://cloud.siliconflow.cn/bills).
3. The Rate limits for free models are fixed. Some models are available in both free and paid versions. The free version is named after the original name, while the paid version is prefixed with "Pro/" to distinguish it. For example, the free version of Qwen2.5-7B-Instruct is named "Qwen/Qwen2.5-7B-Instruct," and the paid version is named "Pro/Qwen/Qwen2.5-7B-Instruct."
### 2.2 Paid model rate limits
1. You are charged based on usage. API calls are included in your [account bill](https://cloud.siliconflow.cn/bills).
2. Rate Limits are tiered based on the account's usage level. The peak Rate Limits increase with the usage level.
3. For the same usage level, the peak Rate Limits vary depending on the model category and the size of the model parameters.
### 2.3 User usage level and rate limits
The platform categorizes accounts into different usage levels based on the monthly consumption amount. Each level has its own Rate Limits standards. When the monthly consumption reaches the criteria for a higher level, the account is automatically upgraded to that level. The upgrade takes effect immediately and provides more generous rate limits.
* Monthly consumption amount: This includes both the amount you recharge and any gifted amounts.
* Level setting: The highest consumption amount between the previous natural month and the current month (from the 1st to today) is used to determine the corresponding usage level. New users start at L0.
| Usage level | Qualification (in RMB) |
| ----------- | ---------------------------------------------------- |
| L0 | Monthly highest consumption amount \< ¥50 |
| L1 | ¥50 ≤ Monthly highest consumption amount \< ¥200 |
| L2 | ¥200 ≤ Monthly highest consumption amount \< ¥2000 |
| L3 | ¥2000 ≤ Monthly highest consumption amount \< ¥5000 |
| L4 | ¥5000 ≤ Monthly highest consumption amount \< ¥10000 |
| L5 | ¥10000 ≤ Monthly highest consumption amount |
### 2.4 Specific model rate limits
The platform currently offers five categories: text generation, image generation, vectorization, re-ranking, and speech. Specific model rate limits can be found in the [model square](https://cloud.siliconflow.cn/models).
### 2.5 `deepseek-ai/DeepSeek-R1` 和 `deepseek-ai/DeepSeek-V3` Rate Limits
To ensure the quality of platform services and the rational allocation of resources, the following adjustments to Rate Limits policies are now in effect:
1. Adjustments
New RPH Limit (Requests Per Hour, Per Hour Requests)
* Model Scope:deepseek-ai/DeepSeek-R1, deepseek-ai/DeepSeek-V3
* Applicable Users: All users
* Limit Standard: 30 requests/hour
2.New RPD Limit (Requests Per Day, Per Day Requests)
* Model Scope: deepseek-ai/DeepSeek-R1, deepseek-ai/DeepSeek-V3
* Applicable Users: Users who have not completed real-name authentication
* Limit Standard: 100 requests/day
Please note that these policies may be adjusted at any time based on traffic and load changes. Silicon Flowing Reserves the right to interpret these policies.
## 3. Handling exceeding rate limits
### 3.1 Error messages for exceeding rate limits
If the API call exceeds the Rate Limits, the user's request will fail due to exceeding the Rate Limits. Users need to wait until the Rate Limits conditions are met before they can call again. The corresponding HTTP error message is:
```shell
HTTP/1.1 429
Too Many Requests
Content Type: application/json
Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.cn
```
### 3.2 Handling exceeding rate limits
* You can refer to the [Handling Rate Limits](https://github.com/siliconflow/siliconcloud-cookbook/blob/main/examples/how-to-handle-rate-limit-in-siliconcloud.ipynb) example to avoid errors under existing rate limits.
* You can also increase your usage level to increase the peak Rate Limits for your models.
## 4. How to increase model rate limits
### 4.1 Ways to increase rate limits
* Automatic upgrade: You can increase your monthly consumption to increase your [monthly consumption amount](https://cloud.siliconflow.cn/bills). When the consumption meets the criteria for a higher level, the account will be automatically upgraded.
* Quick Upgrade with Package: If you need to quickly reach a higher usage level and increase the peak Rate Limits, you can purchase a [package](https://cloud.siliconflow.cn/package) to boost your usage level.
### 4.2 Package purchase details
* Online purchase: Please go to the platform to purchase the [package](https://cloud.siliconflow.cn/package) online.
* Validity Period: Packages take effect immediately after purchase and are valid for the current month (N) and the next natural month (N+1). Starting from the month after next (N+2), the account's latest usage level will be recalculated based on the consumption of the previous month (N+1).
* Payment method: Packages can only be paid with the platform's recharge balance and cannot be paid with gifted balance.
* Invoice: For details on how to issue an invoice for packages, refer to the [invoice section](/faqs/invoice).
* Exclusive instances: Packages are not applicable for exclusive instance needs. If you have such needs, please contact your exclusive account manager.
### 4.3 Other scenarios
* Contact Us: For scenarios not covered above, please [contact us](https://siliconflow.feishu.cn/share/base/form/shrcnaamvQ4C7YKMixVnS32k1G3).
# Combine with Cursor
Source: https://docs.siliconflow.cn/en/userguide/use-docs-with-cursor
SiliconCloud documentation supports the [llms.txt protocol](https://llmstxt.org/), which is both accessible for users to read directly and can be seamlessly integrated with various tools that support this protocol.Considering that some users may not be familiar with the [llms.txt protocol](https://llmstxt.org/), the following will provide a brief introduction to the usage rocedure and relevant overview.
## 1. Use this document in Cursor
### 1.1 Configure this document
Configure the `@Docs` data source in `Cursor` to easily use this document.
### 1.2 Use in Cursor
## 2. Introduction to llms.txt
### 2.1 Protocol background
llms.txt is an emerging web standard designed to help large language models (LLMs) more effectively access and understand website content. By creating an llms.txt file in the root directory of a website, site owners can provide clear navigation and guidance to AI systems, thereby improving the efficiency of information retrieval.
### 2.2 File structure
The llms.txt file is written in Markdown format and typically includes the following sections:
1. Title: Name of the website or project.
2. Description (optional): A brief introduction to the website or project.
3. Details (optional): Additional background information or links to other documents.
4. Chapters: List the important sections of the website, with each section containing links and optional detailed descriptions.
Example as follows (refer to the files [https://docs.siliconflow.cn/llms.txt](https://docs.siliconflow.cn/llms.txt) and [https://docs.siliconflow.cn/llms-full.txt](https://docs.siliconflow.cn/llms-full.txt))
```markdown
# SiliconFlow
## Docs
- [Create Audio Transcription Request](https://docs.siliconflow.cn/api-reference/audio/create-audio-transcriptions): Creates an audio transcription.
- [Create Speech Request](https://docs.siliconflow.cn/api-reference/audio/create-speech): Generates audio from input text. Generates binary data of the audio, which requires the user to handle it. Refer to:https://docs.siliconflow.cn/capabilities/text-to-speech#5
- [Delete Reference Voice](https://docs.siliconflow.cn/api-reference/audio/delete-voice): Deletes user-predefined voice.
- [Upload Reference Voice](https://docs.siliconflow.cn/api-reference/audio/upload-voice): Uploads user-predefined voice in either base64 encoding or file form. Refer to:https://docs.siliconflow.cn/capabilities/text-to-speech#2-2)
- [Get Reference Voice List](https://docs.siliconflow.cn/api-reference/audio/voice-list): Retrieves the list of user-predefined voices.
...
```
### 2.3 File functions
#### 2.3.1 /llms.txt:
* Simplified navigation for large AI: This file provides a simplified view of the entire document navigation, making it easier for tools like Cursor or ChatGPT (LLMs) to index your content.
* Think of it as AI-friendly search engine optimization: users can now directly find specific product information through a general LLM.
#### 2.3.2 /llms-full.txt:
* The file compiles all document text into a marked-up file, facilitating AI tools to directly load information into their context windows based on this file.
* You can input the document into AI assistants like Cursor, allowing them to provide context-aware suggestions based on the specific details of your product.
### 2.4 Differences from existing standards:
While llms.txt overlaps in functionality with existing standards like robots.txt and sitemap.xml, their purposes and roles are different:
* robots.txt:Used to instruct search engine crawlers which pages can or cannot be crawled, primarily focusing on access control.
* sitemap.xml:Provides a structural map of the website to help search engines understand the layout of the pages, mainly for indexing purposes.
* llms.txt:Provides a structured overview of content for large language models, helping AI systems better understand and process website information, enhancing interaction with AI.
## 3. Use in other tools
Other platforms that support the [llms.txt protocol](https://llmstxt.org/),can also use it directly.
For example, in ChatGPT:
## 4. Further reading
1. The /llms.txt file, [https://llmstxt.org/](https://llmstxt.org/)
2. @Docs, [https://docs.cursor.com/context/@-symbols/@-docs](https://docs.cursor.com/context/@-symbols/@-docs)
3. LLMs.txt:Sitemap for AI Era, [https://juejin.cn/post/7447083753187328050](https://juejin.cn/post/7447083753187328050)