79523629

Date: 2025-03-20 17:03:34
Score: 2.5
Natty:
Report link

OpenAI does not officially support a model named llama3.1-8b.Therefore, attempting to use llama3.1-8b with OpenAI's API may result in unexpected behavior. Here's a list of OpenAI's supported models as of March 2025: https://platform.openai.com/docs/models

Together AI's API is compatible with OpenAI's libraries, making it easy to try open-source llms.You can get the API key by registering at Together AI website. Here's the code example:

import openai

client = openai.OpenAI(api_key=""TOGETHER_API_KEY"", base_url="https://api.together.xyz/v1")

response = client.chat.completions.create(
    model="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
    messages=[{"role": "user", "content": "Please tell me a joke"}],
    stream=True  
)

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

ref: OpenAI library with Together AI documentation

Reasons:
  • RegEx Blacklisted phrase (2.5): Please tell me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Nick Wu