推理提供商文档
PublicAI
加入 Hugging Face 社区
并获得增强的文档体验
开始使用
PublicAI
您可以在此处找到 PublicAI 推理实用程序支持的所有模型。
Public AI 推理实用程序是一个非营利性开源项目。他们的团队开发产品并组织宣传活动,以支持瑞士 AI 倡议、新加坡 AI、瑞典 AI 和巴塞罗那超级计算中心等公共 AI 模型构建者的工作。
他们相信公共 AI——AI 作为公共基础设施,如同高速公路、水或电力。可以将其想象成 AI 的 BBC、AI 的公共事业,或 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="allenai/Olmo-3.1-32B-Instruct:publicai",
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="allenai/Molmo2-8B:publicai",
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)
