commit - d195ecc2648dc74c89e96ed15110ef3dffe19724
commit + bdb5c09d1ad64dcf8a2db0266ae04f4b065defc2
blob - 0154aacfc12328ee609fd5adb4a8e439e8c10bf3
blob + 0bc9045f55d1cbdd7e2c8e1c0432a3a965b2d586
--- bin/llama
+++ bin/llama
import sys
import urllib.request
-# these models hallucinate
-# model = "llama3.1-8b-instant"
-# model = "llama-3.1-70b-versatile"
-
url = "https://api.groq.com/openai/v1/chat/completions"
-model = "llama3-8b-8192"
-big = "llama3-70b-8192"
+# small models include:
+# llama-3.1-8b-instant
+# llama-3.2-3b-preview
+# llama-3.2-1b-preview
+model = "llama-3.2-3b-preview"
+big = "llama-3.1-70b-versatile"
def read_token(name):
with open(name) as f:
req = urllib.request.Request(url, json.dumps(message).encode())
req.add_header("Content-Type", "application/json")
req.add_header("Authorization", "Bearer "+token)
-# groq blocks urllib's user agent?!
+# groq blocks urllib's user agent
req.add_header("User-Agent", "curl/8.9.0")
with urllib.request.urlopen(req) as resp:
blob - 522c0479bd640805b911a31bca763d9286d4b450
blob + 9d2f1051da0c09ddd0921b3a3f3dd2751f0c2f5e
--- man/llama.1
+++ man/llama.1
reads a prompt from the standard input
and sends it to a large language model hosted by Groq.
The reply is written to the standard output.
-The default model is Llama 3 8B.
+The default model is Llama 3.2 3B.
.Pp
A Groq API token must be written to
.Pa $HOME/.config/groq/token .
The following flags are understood:
.Bl -tag -width Ds
.It Fl b
-Prompt the "bigger" 70B model.
+Prompt the "bigger" LLama 3.1 70B model.
.Sh EXAMPLE
.Dl echo 'What is LLM slop?' | llama
.Sh EXIT STATUS