---
title: "模型別名"
url: "/docs/completion/model_alias"
canonical_url: "https://docs.litellm.ai/docs/completion/model_alias"
type: "docs"
last_updated: "2026-10-08"
related:
  - "/docs/completion/drop_params"
  - "/docs/guides/finetuned_models"
---
# 模型別名

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


您顯示給終端使用者的模型名稱，可能與您傳遞給 LiteLLM 的名稱不同——例如，前端顯示 `GPT-5.6`，而後端呼叫 `gpt-5.6-luna`。

LiteLLM 透過讓您傳入模型別名對應來簡化這件事。

## 預期格式 {#expected-format}

```python
litellm.model_alias_map = {
    # a dictionary containing a mapping of the alias string to the actual litellm model name string
    "model_alias": "litellm_model_name"
}
```

## 使用方式  {#usage}

### 相關程式碼 {#relevant-code}
```python
model_alias_map = {
    "GPT-5.6": "gpt-5.6-luna",
    "llama2": "replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"
}

litellm.model_alias_map = model_alias_map
```

### 完整程式碼 {#complete-code}
```python
import litellm 
from litellm import completion 

## set ENV variables
os.environ["OPENAI_API_KEY"] = "openai key"
os.environ["REPLICATE_API_KEY"] = "cohere key"

## set model alias map
model_alias_map = {
    "GPT-5.6": "gpt-5.6-luna",
    "llama2": "replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca12251a30609463dcfd4cd76703f22e96cdf"
}

litellm.model_alias_map = model_alias_map

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

# call "gpt-5.6-luna"
response = completion(model="GPT-5.6", messages=messages)

# call replicate/llama-2-70b-chat:2796ee9483c3fd7aa2e171d38f4ca1...
response = completion("llama2", messages)
```

## Related pages

- [移除不支援的參數](https://docs.litellm.ai/docs/completion/drop_params.md)
- [呼叫微調模型](https://docs.litellm.ai/docs/guides/finetuned_models.md)
