推理提供商文档

DeepInfra

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

DeepInfra

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

DeepInfra 是一个无服务器 AI 推理平台,提供行业内最具成本效益的单 token 定价。DeepInfra 拥有超过 100 个模型的目录,涵盖大语言模型 (LLM)、文本生成图像、文本生成语音、语音转文本、视频生成、OCR 等,让开发者能够以最少的配置轻松地将广泛的 AI 能力集成到其应用程序中。

资源

支持的任务

对话补全 (LLM)

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

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://router.huggingface.co/v1",
    api_key=os.environ["HF_TOKEN"],
)

completion = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro:deepinfra",
    messages=[
        {
            "role": "user",
            "content": "What is the capital of France?"
        }
    ],
)

print(completion.choices[0].message)

对话补全 (VLM)

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

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://router.huggingface.co/v1",
    api_key=os.environ["HF_TOKEN"],
)

completion = client.chat.completions.create(
    model="Qwen/Qwen3.6-35B-A3B:deepinfra",
    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)
在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.