A simple Node.js project that lets you ask any question to an AI model powered by Groq and LLaMA 3.3 70B.
ask-ai/
β
βββ src/
β βββ askAI.js # Core AI function using Groq SDK
βββ index.js # Entry point β run your question here
βββ .env # Your API key (never push this!)
βββ .gitignore # Ignores node_modules and .env
βββ package.json
βββ README.md
git clone https://github.com/your-username/ask-ai.git
cd ask-ainpm installCreate a .env file in the root folder:
API_KEY=your_groq_api_key_hereGet your free API key from π https://console.groq.com
node src/askAI.jsnode src/chatWithMemory.js
---
## π‘ How It Works
1. `index.js` defines a question and calls the `askAI()` function
2. `askAI.js` sends the question to **Groq API** using the **LLaMA 3.3 70B** model
3. The AI response is returned and printed in the terminal
---
## π§ Model Used
| Property | Value |
|----------|-------|
| Provider | [Groq](https://groq.com) |
| Model | `llama-3.3-70b-versatile` |
| Speed | Ultra-fast inference |
| Cost | Free tier available |
---
## π¦ Dependencies
| Package | Purpose |
|---------|---------|
| `groq-sdk` | Groq API client |
| `dotenv` | Load environment variables |
---
## πΈ Sample Output
```bash
Answer to 'What is the weather in New York?':
I don't have real-time data, but I can tell you that New York
typically experiences cold winters and hot summers...