Hyperbolic

Hyperbolic

Hyperbolic은 레거시 클라우드 비용의 일부로 최신 모델에 접근을 제공하며, LLM, 이미지 생성 등을 위한 OpenAI 호환 API를 제공해요. 모든 Hyperbolic 모델을 지원해요. completion 요청 시 hyperbolic/ 접두사로 설정하기만 하면 돼요.

출처: 문서

본문

개요 (Overview)

속성 설명
설명 레거시 클라우드 비용의 일부로 최신 모델 접근 제공. LLM, 이미지 생성 등을 위한 OpenAI 호환 API
LiteLLM 라우트 hyperbolic/
공급자 문서 Hyperbolic Documentation
기본 URL https://api.hyperbolic.xyz/v1
지원 작업 /chat/completions

사용 가능한 모델 (Available Models)

언어 모델

모델 설명 컨텍스트 창 백만 토큰당 가격
hyperbolic/deepseek-ai/DeepSeek-V3 DeepSeek V3 - 빠르고 효율적 131,072 토큰 $0.25
hyperbolic/deepseek-ai/DeepSeek-V3-0324 DeepSeek V3 2024년 3월 버전 131,072 토큰 $0.25
hyperbolic/deepseek-ai/DeepSeek-R1 DeepSeek R1 - Reasoning 모델 131,072 토큰 $2.00
hyperbolic/deepseek-ai/DeepSeek-R1-0528 DeepSeek R1 2028년 5월 버전 131,072 토큰 $0.25
hyperbolic/Qwen/Qwen2.5-72B-Instruct Qwen 2.5 72B Instruct 131,072 토큰 $0.40
hyperbolic/Qwen/Qwen2.5-Coder-32B-Instruct 코드 생성용 Qwen 2.5 Coder 32B 131,072 토큰 $0.20
hyperbolic/Qwen/Qwen3-235B-A22B Qwen 3 235B A22B 변형 131,072 토큰 $2.00
hyperbolic/Qwen/QwQ-32B Qwen QwQ 32B 131,072 토큰 $0.20
hyperbolic/meta-llama/Llama-3.3-70B-Instruct Llama 3.3 70B Instruct 131,072 토큰 $0.80
hyperbolic/meta-llama/Meta-Llama-3.1-405B-Instruct Llama 3.1 405B Instruct 131,072 토큰 $5.00
hyperbolic/moonshotai/Kimi-K2-Instruct Kimi K2 Instruct 131,072 토큰 $2.00

필수 변수

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

Hyperbolic 대시보드에서 API 키를 가져와요.

LiteLLM Python SDK 사용법

비스트리밍 (Non-streaming)

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)

스트리밍 (Streaming)

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)

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 사용법

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 서버 시작:

litellm --config config.yaml
# RUNNING on http://0.0.0.0:4000

OpenAI SDK (비스트리밍):

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)

OpenAI SDK (스트리밍):

from openai import OpenAI

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

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 SDK (비스트리밍):

import litellm

response = litellm.completion(
    model="litellm_proxy/deepseek-fast",
    messages=[{"role": "user", "content": "What are the benefits of renewable energy?"}],
    api_base="http://localhost:4000",
    api_key="your-proxy-api-key"
)
print(response.choices[0].message.content)

LiteLLM SDK (스트리밍):

import litellm

response = litellm.completion(
    model="litellm_proxy/qwen-coder",
    messages=[{"role": "user", "content": "Implement a binary search algorithm"}],
    api_base="http://localhost:4000",
    api_key="your-proxy-api-key",
    stream=True
)

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

cURL (비스트리밍):

curl http://localhost:4000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-p...-key" \
  -d '{
    "model": "deepseek-fast",
    "messages": [{"role": "user", "content": "What is machine learning?"}]
  }'

cURL (스트리밍):

curl http://localhost:4000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-p...-key" \
  -d '{
    "model": "qwen-coder",
    "messages": [{"role": "user", "content": "Write a REST API in Python"}],
    "stream": true
  }'

지원되는 OpenAI 파라미터

Hyperbolic은 다음 OpenAI 호환 파라미터를 지원해요:

파라미터 타입 설명
messages array 필수. 'role'과 'content'가 있는 메시지 객체 배열
model string 필수. Model ID (예: deepseek-ai/DeepSeek-V3, Qwen/Qwen2.5-72B-Instruct)
stream boolean 선택. 스트리밍 응답 활성화
temperature float 선택. 샘플링 온도 (0.0 ~ 2.0)
top_p float 선택. Nucleus sampling 파라미터
max_tokens integer 선택. 생성할 최대 토큰 수
frequency_penalty float 선택. 빈번한 토큰에 패널티
presence_penalty float 선택. 존재에 기반한 토큰 패널티
stop string/array 선택. 중지 시퀀스
n integer 선택. 생성할 완성 수
tools array 선택. 사용 가능한 도구/함수 목록
tool_choice string/object 선택. 도구/함수 호출 제어
response_format object 선택. 응답 형식 사양
seed integer 선택. 재현성용 랜덤 시드
user string 선택. 사용자 식별자

고급 사용법 (Advanced Usage)

사용자 지정 API Base

사용자 지정 Hyperbolic 배포를 쓰는 경우:

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"
)

Rate Limits

Hyperbolic은 다양한 등급을 제공해요:

  • Basic: 분당 60 요청 (RPM)
  • Pro: 600 RPM
  • Enterprise: 사용자 지정 한도

가격 (Pricing)

Hyperbolic은 숨은 수수료나 장기 계약 없이 경쟁력 있는 종량제 가격을 제공해요. 자세한 백만 토큰당 가격은 위 모델 표를 참고하세요.

정밀도 옵션 (Precision Options)

  • BF16: 최고 정밀도와 성능, 정확성이 중요한 태스크에 적합
  • FP8: 효율성과 속도에 최적화, 낮은 비용으로 고처리량 애플리케이션에 이상적

더 알아보기 (Learn more)