Switch language

LiteLLM

Use Bitdeer AI through the LiteLLM proxy for unified multi-provider access.

LiteLLM provides a unified interface for calling 100+ LLM providers. Configure Bitdeer like any other provider with a custom base URL and your API key.

Installation

pip install litellm

Direct usage

import litellm

response = litellm.completion(
    model="openai/deepseek-ai/DeepSeek-V4-Pro",
    messages=[{"role": "user", "content": "Hello!"}],
    api_base="https://api-inference.bitdeer.ai/v1",
    api_key="YOUR_API_KEY",
)

print(response.choices[0].message.content)

Proxy configuration

Add Bitdeer AI to your litellm_config.yaml:

model_list:
  - model_name: deepseek-v4-pro
    litellm_params:
      model: openai/deepseek-ai/DeepSeek-V4-Pro
      api_base: https://api-inference.bitdeer.ai/v1
      api_key: YOUR_API_KEY

  - model_name: qwen3.5-397b
    litellm_params:
      model: openai/Qwen/Qwen3.5-397B-A17B
      api_base: https://api-inference.bitdeer.ai/v1
      api_key: YOUR_API_KEY

  - model_name: kimi-k2.6
    litellm_params:
      model: openai/moonshotai/Kimi-K2.6
      api_base: https://api-inference.bitdeer.ai/v1
      api_key: YOUR_API_KEY

Start the proxy:

litellm --config litellm_config.yaml

Streaming

response = litellm.completion(
    model="openai/deepseek-ai/DeepSeek-V4-Pro",
    messages=[{"role": "user", "content": "Tell me a joke."}],
    api_base="https://api-inference.bitdeer.ai/v1",
    api_key="YOUR_API_KEY",
    stream=True,
)

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

Last updated on

On this page

LiteLLM · Bitdeer AI