跳到主要内容

Triton 推理服务器

LiteLLM 支持 Triton 推理服务器上的嵌入模型

属性详情
描述NVIDIA Triton 推理服务器
LiteLLM 上的提供商路由triton/
支持的操作/chat/completion/completion/embedding
支持的 Triton 端点/infer/generate/embeddings
提供商文档链接Triton 推理服务器 ↗

Triton /generate - 对话补全

使用 triton/ 前缀路由到 Triton 服务器

from litellm import completion
response = completion(
model="triton/llama-3-8b-instruct",
messages=[{"role": "user", "content": "who are u?"}],
max_tokens=10,
api_base="https://:8000/generate",
)

Triton /infer - 对话补全

使用 triton/ 前缀路由到 Triton 服务器

from litellm import completion


response = completion(
model="triton/llama-3-8b-instruct",
messages=[{"role": "user", "content": "who are u?"}],
max_tokens=10,
api_base="https://:8000/infer",
)

Triton /embeddings - 嵌入

使用 triton/ 前缀路由到 Triton 服务器

from litellm import embedding
import os

response = await litellm.aembedding(
model="triton/<your-triton-model>",
api_base="https://your-triton-api-base/triton/embeddings", # /embeddings endpoint you want litellm to call on your server
input=["good morning from litellm"],
)