推理提供商文档
Cerebras
加入 Hugging Face 社区
并获得增强的文档体验
开始使用
Cerebras
所有受支持的Cerebras模型都可以在这里找到
Cerebras作为全球最快的AI推理和训练平台独树一帜。医疗研究、密码学、能源和智能AI等领域的组织使用我们的CS-2和CS-3系统来构建本地超级计算机,而世界各地的开发人员和企业可以通过我们的按需付费云服务访问Cerebras的强大功能。
支持的任务
聊天补全 (LLM)
了解更多关于聊天补全 (LLM) 的信息,请点击这里。
语言
客户端
提供商
import os
from huggingface_hub import InferenceClient
client = InferenceClient(
provider="cerebras",
api_key=os.environ["HF_TOKEN"],
)
completion = client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[
{
"role": "user",
"content": "What is the capital of France?"
}
],
)
print(completion.choices[0].message)
聊天补全 (VLM)
了解更多关于聊天补全 (VLM) 的信息,请点击这里。
语言
客户端
提供商
import os
from huggingface_hub import InferenceClient
client = InferenceClient(
provider="cerebras",
api_key=os.environ["HF_TOKEN"],
)
completion = client.chat.completions.create(
model="meta-llama/Llama-4-Scout-17B-16E-Instruct",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
],
)
print(completion.choices[0].message)