跳至主要內容

Hyperbolic

總覽

屬性詳細資訊
說明Hyperbolic 讓您以傳統雲端成本的一小部分,存取最新模型,並提供相容 OpenAI 的 LLM、圖像生成等 API。
LiteLLM 提供者路由hyperbolic/
提供者文件連結Hyperbolic 文件 ↗
Base URLhttps://api.hyperbolic.xyz/v1
支援的操作/chat/completions


https://docs.hyperbolic.xyz

我們支援所有 Hyperbolic 模型;在送出 completion 請求時,只要將 hyperbolic/ 設為前綴即可

可用模型

語言模型

模型說明上下文視窗Pricing per 1M tokens
hyperbolic/deepseek-ai/DeepSeek-V3DeepSeek V3 - 快速且高效率131,072 tokens$0.25
hyperbolic/deepseek-ai/DeepSeek-V3-0324DeepSeek V3 2024 年 3 月版本131,072 tokens$0.25
hyperbolic/deepseek-ai/DeepSeek-R1DeepSeek R1 - 推理模型131,072 tokens$2.00
hyperbolic/deepseek-ai/DeepSeek-R1-0528DeepSeek R1 2028 年 5 月版本131,072 tokens$0.25
hyperbolic/Qwen/Qwen2.5-72B-InstructQwen 2.5 72B Instruct131,072 tokens$0.40
hyperbolic/Qwen/Qwen2.5-Coder-32B-Instruct用於程式碼生成的 Qwen 2.5 Coder 32B131,072 tokens$0.20
hyperbolic/Qwen/Qwen3-235B-A22BQwen 3 235B A22B 變體131,072 tokens$2.00
hyperbolic/Qwen/QwQ-32BQwen QwQ 32B131,072 tokens$0.20
hyperbolic/meta-llama/Llama-3.3-70B-InstructLlama 3.3 70B Instruct131,072 tokens$0.80
hyperbolic/meta-llama/Meta-Llama-3.1-405B-InstructLlama 3.1 405B Instruct131,072 tokens$5.00
hyperbolic/moonshotai/Kimi-K2-InstructKimi K2 Instruct131,072 tokens$2.00

必要變數

Environment Variables
os.environ["HYPERBOLIC_API_KEY"] = ""  # your Hyperbolic API key

Hyperbolic 儀表板 取得您的 API 金鑰。

用法 - LiteLLM Python SDK

非串流

Hyperbolic Non-streaming Completion
import os
import litellm
from litellm import completion

os.environ["HYPERBOLIC_API_KEY"] = "" # your Hyperbolic API key

messages = [{"content": "What is the capital of France?", "role": "user"}]

# Hyperbolic call
response = completion(
model="hyperbolic/Qwen/Qwen2.5-72B-Instruct",
messages=messages
)

print(response)

串流

Hyperbolic Streaming Completion
import os
import litellm
from litellm import completion

os.environ["HYPERBOLIC_API_KEY"] = "" # your Hyperbolic API key

messages = [{"content": "Write a short poem about AI", "role": "user"}]

# Hyperbolic call with streaming
response = completion(
model="hyperbolic/deepseek-ai/DeepSeek-V3",
messages=messages,
stream=True
)

for chunk in response:
print(chunk)

函式呼叫

Hyperbolic Function Calling
import os
import litellm
from litellm import completion

os.environ["HYPERBOLIC_API_KEY"] = "" # your Hyperbolic API key

tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather in a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
}
]

response = completion(
model="hyperbolic/deepseek-ai/DeepSeek-V3",
messages=[{"role": "user", "content": "What's the weather like in New York?"}],
tools=tools,
tool_choice="auto"
)

print(response)

用法 - LiteLLM Proxy

將以下內容加入您的 LiteLLM Proxy 設定檔:

config.yaml
model_list:
- model_name: deepseek-fast
litellm_params:
model: hyperbolic/deepseek-ai/DeepSeek-V3
api_key: os.environ/HYPERBOLIC_API_KEY

- model_name: qwen-coder
litellm_params:
model: hyperbolic/Qwen/Qwen2.5-Coder-32B-Instruct
api_key: os.environ/HYPERBOLIC_API_KEY

- model_name: deepseek-reasoning
litellm_params:
model: hyperbolic/deepseek-ai/DeepSeek-R1
api_key: os.environ/HYPERBOLIC_API_KEY

啟動您的 LiteLLM Proxy 伺服器:

Start LiteLLM Proxy
litellm --config config.yaml

# RUNNING on http://0.0.0.0:4000
Hyperbolic via Proxy - Non-streaming
from openai import OpenAI

# Initialize client with your proxy URL
client = OpenAI(
base_url="http://localhost:4000", # Your proxy URL
api_key="your-proxy-api-key" # Your proxy API key
)

# Non-streaming response
response = client.chat.completions.create(
model="deepseek-fast",
messages=[{"role": "user", "content": "Explain quantum computing in simple terms"}]
)

print(response.choices[0].message.content)
Hyperbolic via Proxy - Streaming
from openai import OpenAI

# Initialize client with your proxy URL
client = OpenAI(
base_url="http://localhost:4000", # Your proxy URL
api_key="your-proxy-api-key" # Your proxy API key
)

# Streaming response
response = client.chat.completions.create(
model="qwen-coder",
messages=[{"role": "user", "content": "Write a Python function to sort a list"}],
stream=True
)

for chunk in response:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")

如需更詳細的 LiteLLM Proxy 使用資訊,請參閱 LiteLLM Proxy 文件

支援的 OpenAI 參數

Hyperbolic 支援以下與 OpenAI 相容的參數:

參數類型說明
messagesarray必要。包含 'role' 和 'content' 的訊息物件陣列
modelstring必要。模型 ID(例如 deepseek-ai/DeepSeek-V3、Qwen/Qwen2.5-72B-Instruct)
streamboolean選用。啟用串流回應
temperaturefloat選用。採樣溫度(0.0 到 2.0)
top_pfloat選用。核採樣參數
max_tokensinteger選用。要生成的最大 token 數
frequency_penaltyfloat選用。對高頻 token 進行懲罰
presence_penaltyfloat選用。根據存在與否對 token 進行懲罰
stopstring/array選用。停止序列
ninteger選用。要生成的 completion 數量
toolsarray選用。可用工具/函式清單
tool_choicestring/object選用。控制工具/函式呼叫
response_formatobject選用。回應格式規格
seedinteger選用。用於重現性的隨機種子
userstring選用。使用者識別碼

進階用法

自訂 API Base

如果您使用的是自訂 Hyperbolic 部署:

Custom API Base
import litellm

response = litellm.completion(
model="hyperbolic/deepseek-ai/DeepSeek-V3",
messages=[{"role": "user", "content": "Hello"}],
api_base="https://your-custom-hyperbolic-endpoint.com/v1",
api_key="your-api-key"
)

速率限制

Hyperbolic 提供不同方案:

  • Basic:每分鐘 60 次請求(RPM)
  • Pro:600 RPM
  • Enterprise:自訂限制

定價

Hyperbolic 提供具競爭力的按用量付費定價,沒有隱藏費用或長期承諾。每百萬 token 的具體價格請參閱上方模型表。

精度選項

  • BF16:最佳精度與效能,適合對準確性要求嚴格的任務
  • FP8:針對效率與速度最佳化,適合在較低成本下追求高吞吐量的應用

其他資源