LiteLLM 為 100+ 個 LLM 提供者提供統一的 Python API。CometAPI 原生支援——使用Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
cometapi/ 前綴即可透過 CometAPI 的模型目錄路由請求。
先決條件
- Python 3.6+
- 擁有有效 API key 的 CometAPI 帳戶——在此取得
提示與疑難排解
提示與疑難排解
- 模型格式:CometAPI 模型使用前綴
cometapi/<model-name>,例如cometapi/your-model-id。可用模型請參閱 CometAPI Models 頁面。 - 微調(Fine-tuning)回應:LiteLLM 支援
temperature、max_tokens與top_p——可將它們加入任何completion()呼叫中,例如completion(..., temperature=0.7)。 - 錯誤處理:使用
try/except包裝呼叫,以捕捉無效 key 錯誤或網路問題。 - 安全性:切勿將 API key 提交到版本控制。請使用環境變數或祕密管理工具。
- 速率限制:在 CometAPI 主控台 監控使用量。
- 更多文件:LiteLLM documentation — CometAPI quick start