---
title: "Using Text Completion Format - with Completion()"
url: "/docs/tutorials/text_completion"
canonical_url: "https://docs.litellm.ai/docs/tutorials/text_completion"
type: "docs"
last_updated: "2026-10-09"
summary: "If your prefer interfacing with the OpenAI Text Completion format this tutorial covers how to use LiteLLM in this format"
related:
  - "/docs/tutorials/first_playground"
  - "/docs/tutorials/mock_completion"
---
# Using Text Completion Format - with Completion()

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


If your prefer interfacing with the OpenAI Text Completion format this tutorial covers how to use LiteLLM in this format
```python
response = openai.Completion.create(
    model="text-davinci-003",
    prompt='Write a tagline for a traditional bavarian tavern',
    temperature=0,
    max_tokens=100)
```

## Using LiteLLM in the Text Completion format
### With gpt-3.5-turbo
```python
from litellm import text_completion
response = text_completion(
    model="gpt-3.5-turbo",
    prompt='Write a tagline for a traditional bavarian tavern',
    temperature=0,
    max_tokens=100)
```

### With text-davinci-003
```python
response = text_completion(
    model="text-davinci-003",
    prompt='Write a tagline for a traditional bavarian tavern',
    temperature=0,
    max_tokens=100)
```

### With llama2
```python
response = text_completion(
    model="together_ai/togethercomputer/llama-2-70b-chat",
    prompt='Write a tagline for a traditional bavarian tavern',
    temperature=0,
    max_tokens=100)
```

## Related pages

- [Create your first LLM playground](https://docs.litellm.ai/docs/tutorials/first_playground.md)
- [Mock Completion Responses - Save Testing Costs](https://docs.litellm.ai/docs/tutorials/mock_completion.md)
