Shadow AI is a macOS desktop overlay that listens to your system audio in real time, transcribes it using Groq Whisper, and generates AI-powered responses โ all in a window invisible to screen sharing and recording software.
Built for technical interviews, coding challenges, and meetings โ your interviewer sees nothing.
- ๐๏ธ Real-time system audio capture โ captures everything playing on your Mac (Zoom calls, browser audio, etc.)
- ๐คซ Invisible to screen sharing โ the overlay is hidden from any screen recording or sharing tool
- ๐ง Context-aware AI responses โ remembers conversation history and gives structured, interview-quality answers
- ๐ป 8 specialized session modes โ SDE, Data Science, PM, Business, Data Analyst, Meeting, General, and Custom
- โจ๏ธ Manual question input โ type questions directly when you don't want to rely on audio
- ๐ธ Screen capture mode โ AI can see and analyze what's on your screen
- ๐พ Code detail windows โ dedicated floating windows for code snippets with syntax highlighting
- ๐ Code compare view โ side-by-side naive vs optimal solution viewer
- ๐ Document upload โ upload PDFs and DOCX files as context for the AI
- ๐ Auto-fallback โ switches to Cerebras when Groq hits rate limits (seamless, no interruption)
- ๐ Token-optimized โ smart conversation history compression saves ~40-50% in API costs
| Requirement | Version |
|---|---|
| macOS | 12 Monterey or later |
| Node.js | 18+ |
| npm | 8+ |
| Groq API Key | Free at console.groq.com |
| Cerebras API Key (optional) | Free at cloud.cerebras.ai |
Windows/Linux are not supported. The app uses macOS-specific APIs for window invisibility, system audio capture, and screen recording permissions.
git clone https://github.com/YOUR_USERNAME/ShadowChatbot.git
cd ShadowChatbotnpm installOpen services/groq.js in any text editor:
nano services/groq.js
# or
code services/groq.jsFind the constructor (around line 6) and replace the placeholder values with your own keys:
class GroqService {
constructor(apiKey) {
// โ
Replace with your Groq API key
this.apiKey = 'YOUR_GROQ_API_KEY_HERE';
// โ
Replace with your Cerebras API key (used as fallback when Groq rate-limits)
this.cerebrasApiKey = 'YOUR_CEREBRAS_API_KEY_HERE';
// ... rest of the constructor
}
}Important: Never commit your real API keys to GitHub. See the API Key Security section below.
- Open System Settings โ Privacy & Security โ Screen Recording
- Enable the toggle for Electron (or your app's name)
- If it doesn't appear, run the app once (
npm start) and it will prompt for access
npm startGroq powers both speech-to-text (Whisper large-v3-turbo) and the LLM (Llama 3.3 70B). Groq's free tier is generous:
- Go to console.groq.com
- Sign up or log in
- Click API Keys in the sidebar โ Create API Key
- Copy the key (starts with
gsk_...) - Paste it into
services/groq.jsas shown above
Cerebras is used as an automatic fallback when Groq hits rate limits. Highly recommended for sustained usage:
- Go to cloud.cerebras.ai
- Sign up or log in
- Click your profile โ API Keys โ Create new API key
- Copy the key (starts with
csk_...) - Paste it into
services/groq.jsasthis.cerebrasApiKey
If you don't have a Cerebras key, just leave the field blank โ the app will only use Groq. Set
this.cerebrasApiKey = '';to disable the fallback.
โ ๏ธ NEVER commit your API keys to a public repository.
To keep your keys safe, use a .env file pattern:
Option A โ Environment variables (recommended)
Create a .env file in the project root:
GROQ_API_KEY=gsk_your_key_here
CEREBRAS_API_KEY=csk_your_key_here
Add .env to .gitignore:
echo ".env" >> .gitignoreThen in services/groq.js, read from environment:
// In Electron renderer, use ipcMain to pass env vars from main process
// Or use a local config file pattern
this.apiKey = process.env.GROQ_API_KEY || 'fallback';Option B โ Local config file
Create config.local.js (add to .gitignore):
module.exports = {
groqApiKey: 'gsk_your_key_here',
cerebrasApiKey: 'csk_your_key_here'
};Import it in services/groq.js:
const config = require('../config.local.js');
this.apiKey = config.groqApiKey;- Launch the app with
npm start - On the home screen, choose your session mode (SDE, DS, PM, etc.)
- Optionally add a briefing โ paste your resume, job description, or any context you want the AI to know
- Click Launch Overlay
| Shortcut | Action |
|---|---|
Cmd + Shift + L |
Toggle audio listening on/off |
Cmd + Shift + H |
Show/hide the overlay |
Cmd + Q |
Quit the app |
- Press Cmd+Shift+L to start listening โ the overlay picks up system audio automatically
- Talk or let the interviewer talk โ transcripts appear in the left pane
- After 5 seconds of silence, the AI generates a response in the right pane
- Use the manual input box at the bottom to type questions directly
- Click any AI response to copy it or view code in a detail window
| Mode | Best For |
|---|---|
| ๐ป SDE | LeetCode, system design, FAANG-style coding interviews |
| ๐ Data Scientist | ML concepts, SQL, statistics, A/B testing, case studies |
| ๐ฏ Product Manager | Product sense, strategy, metrics, estimation, roadmaps |
| ๐ Business & Marketing | Consulting cases, marketing analytics, financial analysis |
| ๐ Data Analyst | SQL queries, Excel, Tableau/Power BI, dashboards |
| ๐ค Meeting Assistant | Live note-taking, action items, Q&A during meetings |
| โจ General | All-purpose assistant for anything |
| โ๏ธ Custom | Write your own system prompt for any use case |
ShadowChatbot/
โโโ main.js # Electron main process โ windows, IPC, permissions
โโโ preload.js # Secure bridge between main and renderer
โโโ renderer.js # Core UI logic, audio pipeline, AI response handling
โโโ index.html # Overlay window HTML
โโโ home.html # Setup/briefing screen HTML
โโโ styles.css # Overlay styles
โโโ home-styles.css # Home screen styles
โโโ home-renderer.js # Home screen logic
โโโ code-detail.html # Floating code window
โโโ code-compare.html # Side-by-side code compare window
โโโ code-viewer.html # Code snippet list window
โโโ services/
โโโ groq.js # Groq + Cerebras API wrapper (STT + LLM)
โโโ audio.js # System audio capture + WAV encoding
โโโ prompts.js # Session mode system prompts
โโโ context.js # Screen capture + context extraction
โโโ code-extractor.js # Code snippet parser from AI responses
macOS System Audio
โ
desktopCapturer (Electron)
โ
getUserMedia (audio + video stream)
โ (video track kept alive to maintain capture session)
MediaStream (audio-only) โ MediaRecorder (timeslice: 3s)
โ
ondataavailable โ WebM chunks
โ
AudioContext.decodeAudioData โ OfflineAudioContext resample to 16kHz
โ
WAV blob โ Groq Whisper API โ Transcript text
โ
Transcript buffer (5s silence timeout) โ Groq Llama 3.3 70B โ AI Response
- Check Screen Recording permission โ System Settings โ Privacy & Security โ Screen Recording โ Electron โ
- Fully quit and restart after granting permission (
Cmd+Q, not just closing the window) - Make sure audio is actually playing โ the app captures system audio, so something must be playing (YouTube, Zoom, etc.)
- Check the DevTools console (
Cmd+Option+I) for[Audio]log messages
- Check your Groq API key is set correctly in
services/groq.js - Check the console for API error messages (401 = wrong key, 429 = rate limit)
- If you see rate limit errors, add a Cerebras API key as a fallback
These are harmless DevTools protocol warnings from Electron โ ignore them. They don't affect functionality.
Ensure you are running the app with npm start (not packaged). The setContentProtection(true) flag is set for all windows, which hides them from screen capture on macOS.
Pull requests are welcome! For major changes, open an issue first to discuss what you'd like to change.
- Fork the repo
- Create your feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add my feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
MIT License โ see LICENSE for details.
Shadow AI is intended for personal productivity and learning. Use responsibly and in accordance with the terms of service of any platform you use it with. The authors are not responsible for misuse.