推理提供商文件
Nscale
加入 Hugging Face 社群
並獲得增強的文件體驗
開始使用
Nscale
所有支援的 Nscale 模型都可以在此處找到。
Nscale 是一個垂直整合的 AI 雲,提供定製的、主權 AI 基礎設施,並實現規模化部署。
在此基礎上,Nscale 的推理服務為開發者提供了各種模型和即用型推理服務,這些服務可以整合到工作流中,而無需管理底層基礎設施。
支援的任務
聊天補全(LLM)
瞭解更多關於聊天補全 (LLM) 的資訊,請點選這裡。
語言
客戶端
提供商
import os
from huggingface_hub import InferenceClient
client = InferenceClient(
provider="nscale",
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="nscale",
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)
文字到影像
瞭解更多關於文字到影像的資訊,請點選這裡。
語言
提供商
import os
from huggingface_hub import InferenceClient
client = InferenceClient(
provider="nscale",
api_key=os.environ["HF_TOKEN"],
)
# output is a PIL.Image object
image = client.text_to_image(
"Astronaut riding a horse",
model="stabilityai/stable-diffusion-xl-base-1.0",
)