简介
SiliconCloud 基于优秀的开源基础模型,提供高性价比的 GenAI 服务。
不同于多数大模型云服务平台只提供自家大模型 API,SiliconCloud 上架了包括 Qwen、DeepSeek、GLM、Yi、Mistral、LLaMA 3、SDXL、InstantID 在内的多种开源大语言模型及图片生成模型,用户可自由切换适合不同应用场景的模型。
更重要的是,SiliconCloud 提供开箱即用的大模型推理加速服务,为您的 GenAI 应用带来更高效的用户体验。
注意:测试期间(6月18日前)赠送42元额度
2024-6-25更新 新用户赠送14元额度,小模型免费
免费模型
简单上手
当前公测版本,RPM 限制为 100 ,RPS 为3
注册账号
访问 注册页 注册账号
获取密钥
访问 密钥页 点击 创建新API密钥 获取密钥
oneapi配置
对话模型
- base_url:https://api.siliconflow.cn
- key:你的密钥
- model:deepseek-v2-chat, deepseek-Ilm-67b-chat, Qwen2-72B-Instruct, Qwen2-7B-Instruct, Qwen2-57B-A14B-Instruct, Qwen1.5-110B-Chat, Qwen1.5-32B-Chat, Qwen1.5-14B-Chat, Qwen1.5-7B-Chat, Yi-1.5-34B-Chat, Yi-1.5-9B-Chat, Yi-1.5-6B-Chat, chatglm3-6B, glm4-9B-chat, Mixtral-8x7B-Instruct-v0.1, Mistral-7B-Instruct-v0.2, gemma-7b-it, gemma-2b-it
- 模型重定向:
{
"deepseek-v2-chat": "deepseek-ai/DeepSeek-V2-Chat",
"deepseek-Ilm-67b-chat": "deepseek-ai/deepseek-Ilm-67b-chat",
"deepseek-coder-v2-instruct": "deepseek-ai/DeepSeek-Coder-V2-Instruct",
"Qwen2-72B-Instruct": "Qwen/Qwen2-72B-Instruct",
"Qwen2-7B-Instruct": "Qwen/Qwen2-7B-Instruct",
"Qwen2-57B-A14B-Instruct": "Qwen/Qwen2-57B-A14B-Instruct",
"Qwen1.5-110B-Chat": "Qwen/Qwen1.5-110B-Chat",
"Qwen1.5-32B-Chat": "Qwen/Qwen1.5-32B-Chat",
"Qwen1.5-14B-Chat": "Qwen/Qwen1.5-14B-Chat",
"Qwen1.5-7B-Chat": "Qwen/Qwen1.5-7B-Chat",
"Yi-1.5-34B-Chat": "01-ai/Yi-1.5-34B-Chat-16K",
"Yi-1.5-9B-Chat": "01-ai/Yi-1.5-9B-Chat-16K",
"Yi-1.5-6B-Chat": "01-ai/Yi-1.5-6B-Chat",
"chatglm3-6B": "THUDM/chatglm3-6b",
"glm4-9B-chat": "THUDM/glm-4-9b-chat",
"Mixtral-8x7B-Instruct-v0.1": "mixtralai/Mixtral-8x7B-Instruct-v0.1",
"Mistral-7B-Instruct-v0.2": "mixtralai/Mistral-7B-Instruct-v0.2",
"gemma-7b-it": "meta-llama/Meta-Llama-3-8B-Instruct",
"gemma-2b-it": "meta-llama/Meta-Llama-3-8B-Instruct"
}
文生图模型
- base_url:你的worker地址
- key:你的密钥
- model: stable-diffusion-3-medium, stable-diffusion-xl-base-1.0, stable-diffusion-2-1, sd-turbo, sdxl-turbo, SDXL-Lightning
- 模型重定向
{
"stable-diffusion-3-medium":"stabilityai/stable-diffusion-3-medium",
"stable-diffusion-xl-base-1.0":"stabilityai/stable-diffusion-xl-base-1.0",
"stable-diffusion-2-1":"stabilityai/stable-diffusion-2-1",
"sd-turbo":"stabilityai/sd-turbo",
"sdxl-turbo":"stabilityai/sdxl-turbo",
"SDXL-Lightning":"ByteDance/SDXL-Lightning"
}
worker.js
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
try {
const body = await request.json();
const { model, messages } = body;
if (!model || !messages || messages.length === 0) {
return new Response(
`Bad Request: Missing required fields`,
{ status: 400, headers: { 'Content-Type': 'application/json' } }
);
}
const prompt = messages[messages.length - 1].content;
const newUrl = `https://api.siliconflow.cn/v1/${model}/text-to-image`;
const newRequestBody = {
prompt: prompt,
image_size: "1024x1024",
batch_size: 1,
num_inference_steps: 4,
guidance_scale: 1
};
const modifiedRequest = new Request(newUrl, {
method: 'POST',
headers: {
'accept': 'application/json',
'content-type': 'application/json',
'Authorization': request.headers.get('Authorization')
},
body: JSON.stringify(newRequestBody)
});
const response = await fetch(modifiedRequest);
const responseBody = await response.json();
const imageUrl = responseBody.images[0].url;
const uniqueId = Date.now();
const currentTimestamp = Math.floor(uniqueId / 1000);
const responsePayload = {
id: uniqueId,
object: "chat.completion.chunk",
created: currentTimestamp,
model: model,
choices: [
{
index: 0,
delta: {
content: ``
},
finish_reason: "stop"
}
]
};
const dataString = JSON.stringify(responsePayload);
return new Response(`data: ${dataString}\n\n`, {
status: 200,
headers: {
"Content-Type": "text/event-stream",
'Access-Control-Allow-Origin': '*',
"Access-Control-Allow-Headers": '*'
}
});
} catch (error) {
return new Response("Internal Server Error: " + error.message, {
status: 500,
headers: {
"Content-Type": "application/json",
'Access-Control-Allow-Origin': '*',
"Access-Control-Allow-Headers": '*'
}
});
}
}





