> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siliconflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prefix Completion

## 1. Use Cases

In prefix completion, the user provides the desired prefix information, allowing the model to complete the rest of the content based on the prefix provided by the user.\
With this capability, the model demonstrates better instruction-following abilities and can address user requirements for specific formats in certain scenarios.

## 2. How to Use

Add the following to your request:

```json theme={null}
extra_body={"prefix":"desired prefix content"}
```

## 3. Supported Models

Currently, [large language models](https://cloud.siliconflow.com/models?types=chat) support the above parameter.

<Note>Note: The list of supported models may change. Please refer to this document for the latest list of supported models.</Note>

## 4. Example Usage

Below is an example of using prefix completion with the OpenAI library:

````python theme={null}
client = OpenAI(
    api_key="Your APIKEY", # Obtain from https://cloud.siliconflow.com/account/ak
    base_url="https://api.siliconflow.com/v1"
)
 
messages = [
    {"role": "user", "content": "Please write quick sort code"},
]

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V2.5",
    messages=messages,
    extra_body={"prefix":"```python\n"}
)

print(response.choices[0].message.content)
````
