You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
change import openai to from groq import Groq
change client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY")) to client = Groq(api_key=os.getenv("GROQ_API_KEY"))
change model: str = "gpt-4-turbo" to model: str = "llama3-8b-8192" or model: 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:
@jeffxtang Thanks for the suggestions!
Adding support for Llama would be a great extension to the codebase. Would you like to submit a PR with the proposed extension incorporating the Groq APIs? Much appreciated.
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: