-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use free Llama 3 on Groq instead of OpenAI #16
Labels
Comments
Add one more line: change |
@jeffxtang Thanks for the suggestions! @icecreamzhao good catch! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If using OpenAI is too expensive for you to try out examples with long text, you can create a free API key in seconds at https://console.groq.com/keys using your gmail or github then make the changes below:
run:
pip install groq
Add a new line in your .env file (renamed from .env.sample, originally with a line starting with "OPEN_API_KEY"):
GROQ_API_KEY="your_groq_api_key"
In src/translation_agent/utils.py, make 3 changes:
import openai
tofrom groq import Groq
client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
toclient = Groq(api_key=os.getenv("GROQ_API_KEY"))
model: str = "gpt-4-turbo"
tomodel: str = "llama3-8b-8192"
ormodel: str = "llama3-70b-8192"
Now running
python examples/example_script.py
will use Llama 3 on Groq for free.The text was updated successfully, but these errors were encountered: