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/Qwen/Qwen3.8-27B",
    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: qwen3.8-27b
    litellm_params:
      model: openai/Qwen/Qwen3.8-27B
      api_base: https://api-inference.bitdeer.ai/v1
      api_key: YOUR_API_KEY

  - model_name: glm-5.3
    litellm_params:
      model: openai/zai-org/GLM-5.3
      api_base: https://api-inference.bitdeer.ai/v1
      api_key: YOUR_API_KEY

  - model_name: glm-5.3-flash
    litellm_params:
      model: openai/zai-org/GLM-5.3-Flash
      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/Qwen/Qwen3.8-27B",
    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