推理提供商文档

SambaNova

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

SambaNova

所有支持的 SambaNova 模型可在此处找到

SambaNova 的 AI 平台是未来十年 AI 创新的技术支柱。客户正在转向 SambaNova,以快速部署最先进的 AI 和深度学习功能,帮助他们在竞争中脱颖而出。

支持的任务

聊天补全 (LLM)

了解更多关于聊天补全 (LLM) 的信息,请点击这里

import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    provider="sambanova",
    api_key=os.environ["HF_TOKEN"],
)

completion = client.chat.completions.create(
    model="meta-llama/Llama-3.1-8B-Instruct",
    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="sambanova",
    api_key=os.environ["HF_TOKEN"],
)

completion = client.chat.completions.create(
    model="meta-llama/Llama-4-Maverick-17B-128E-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="sambanova",
    api_key=os.environ["HF_TOKEN"],
)

result = client.feature_extraction(
    "Today is a sunny day and I will get some ice cream.",
    model="intfloat/e5-mistral-7b-instruct",
)
< > 在 GitHub 上更新