Closed ralyodio closed 4 months ago
You can generate examples in curl (or for an SDK) with the following steps:
View Code
in the lower right cornercurl
as your language in the dropdown at the top of the view code boxHere is an example curl from view code
curl "https://api.groq.com/openai/v1/chat/completions" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GROQ_API_KEY}" \
-d '{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant"
},
{
"role": "user",
"content": "Hello"
}
],
"model": "llama3-8b-8192",
"temperature": 1,
"max_tokens": 1024,
"top_p": 1,
"stream": true,
"stop": null
}'
what is the max tokens I can put?
It varies for each model. The context window
parameter in the models page is the max tokens the model can handle.
If you pass don't provide a value for max_tokens
in your query, your query will use the max context available for the model.
I find this library to be overly complex and I'd like to just hit groq's api with fetch.
Anyone know how to fix? The official sdk is overly complex and I just want to make fetch requests.