跳至主要內容

Petals

Petals: https://github.com/bigscience-workshop/petals

在 Colab 中開啟

前置需求

請確認您已安裝 petals

uv add git+https://github.com/bigscience-workshop/petals

用法

請確認您將 petals/ 加為所有 petals LLM 的前綴。這會將 custom_llm_provider 設為 petals

from litellm import completion

response = completion(
model="petals/petals-team/StableBeluga2",
messages=[{ "content": "Hello, how are you?","role": "user"}]
)

print(response)

串流用法

response = completion(
model="petals/petals-team/StableBeluga2",
messages=[{ "content": "Hello, how are you?","role": "user"}],
stream=True
)

print(response)
for chunk in response:
print(chunk)

模型詳細資料

模型名稱函式呼叫
petals-team/StableBelugacompletion('petals/petals-team/StableBeluga2', messages)
huggyllama/llama-65bcompletion('petals/huggyllama/llama-65b', messages)
🚅
LiteLLM Enterprise
為正式環境打造的 SSO/SAML、稽核記錄、支出追蹤、多團隊管理與防護欄。
深入瞭解 →