Using Text Completion Format - with Completion()
If your prefer interfacing with the OpenAI Text Completion format this tutorial covers how to use LiteLLM in this format
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β
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β
response = text_completion(
model="text-davinci-003",
prompt='Write a tagline for a traditional bavarian tavern',
temperature=0,
max_tokens=100)
With llama2β
response = text_completion(
model="togethercomputer/llama-2-70b-chat",
prompt='Write a tagline for a traditional bavarian tavern',
temperature=0,
max_tokens=100)