---
title: "provider_specific_params"
url: "/docs/tutorials/provider_specific_params"
canonical_url: "https://docs.litellm.ai/docs/tutorials/provider_specific_params"
type: "docs"
last_updated: "2026-10-08"
related:
  - "/docs/tutorials/gradio_integration"
  - "/docs/tutorials/model_fallbacks"
---
# provider_specific_params

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt

### 設定提供者特定參數 {#setting-provider-specific-params}

目標：跨 OpenAI + Cohere 設定 max tokens

**1. 透過 completion**

LiteLLM 會自動將 max_tokens 轉換為該特定模型提供者所遵循的命名慣例。

```python
from litellm import completion
import os

## set ENV variables 
os.environ["OPENAI_API_KEY"] = "your-openai-key" 
os.environ["COHERE_API_KEY"] = "your-cohere-key" 

messages = [{ "content": "Hello, how are you?","role": "user"}]

# openai call
response = completion(model="gpt-5.6-luna", messages=messages, max_tokens=100)

# cohere call
response = completion(model="command-nightly", messages=messages, max_tokens=100)
print(response)
```

**2. 透過提供者特定設定**

對於 LiteLLM 上的每個提供者，我們都已取得其特定參數（依照其命名慣例等）。您只要透過 `litellm.<provider_name>Config` 叫出該提供者，就能為該提供者設定。 

所有提供者設定都有型別與 docstring，因此您應該會在 VSCode 中看到自動完成，並附上其意義的說明。 

以下是透過提供者設定來設定 max tokens 的範例。

## Related pages

- [Gradio 聊天機器人 + LiteLLM 教學](https://docs.litellm.ai/docs/tutorials/gradio_integration.md)
- [模型備援（提供者失敗轉移）搭配 LiteLLM](https://docs.litellm.ai/docs/tutorials/model_fallbacks.md)
