Creating a completion

Use client.completions.create to create a completion for a code or language models:
import os
from together import Together

client = Together()

response = client.completions.create(
    model="meta-llama/Llama-2-70b-hf",
    prompt="def fibonacci(n): ",
    stream=True,
)

for chunk in response:
    print(chunk.choices[0].text or "", end="", flush=True)