Microphone
│
▼
[STT] nvidia/parakeet_realtime_eou_120m-v1 (CPU)
│ transcript text
▼
[LLM] gemma-2-2b-it via LM Studio (GPU)
│ examiner reply
▼
[TTS] nvidia/tts_en_fastpitch + HiFi-GAN (CPU)
│ audio waveform
▼
Speakers
| Component | Runs on | VRAM |
|---|---|---|
| gemma-2-2b-it Q4_K_M (all 28 layers on GPU) | GPU | ~1.4 GB |
| KV cache @ 4096 context | GPU | ~0.3 GB |
| parakeet STT 120M | CPU | 0 |
| FastPitch + HiFi-GAN TTS | CPU | 0 |
| Total | ~1.7 GB |
STT and TTS deliberately run on CPU to leave all VRAM for the LLM. The 120M parakeet model is fast enough on a modern CPU (~200 ms RTF). FastPitch synthesis of a 15-word sentence takes ~0.5 s on CPU.
| Setting | Value | Reason |
|---|---|---|
| Context Length | 4096 | As specified; fits in VRAM |
| GPU Layers | 28 (ALL) | Fully offload gemma-2-2b-it |
| CPU Threads | 6 | For any CPU fallback |
| Batch Size (n_batch) | 256 | Balanced throughput vs memory |
| Flash Attention | ✅ ON | Saves ~200 MB VRAM |
| KV Cache Quantisation | Q8_0 | Saves ~100 MB VRAM |
| mmap | ✅ ON | Faster cold load |
| mlock | ❌ OFF | Don't pin all weights in RAM |
| Temperature | 0.7 | Set per-request in agent.py |
| Rope Scaling | Default | gemma-2 handles natively |
The agent uses the OpenAI-compatible endpoint (not /api/v1/chat):
POST http://localhost:1234/v1/chat/completions
{
"model": "gemma-2-2b-it",
"messages": [
{"role": "system", "content": "You are an IELTS examiner…"},
{"role": "user", "content": "Student answer here"}
],
"max_tokens": 256,
"temperature": 0.7
}
The
/api/v1/chatendpoint you quoted is LM Studio's native v1 stateful API (added in v0.4.0) which usesinputinstead ofmessages[]. Both work, but the OpenAI-compat endpoint is simpler and more stable.
ASRModel.from_pretrained("nvidia/parakeet_realtime_eou_120m-v1")FastPitchModel.from_pretrained("nvidia/tts_en_fastpitch")HifiGanModel.from_pretrained("nvidia/tts_hifigan")# 1. Set up environment (first time only)
bash setup.sh
# 2. Activate venv
source .venv/bin/activate
# 3. Start LM Studio → load gemma-2-2b-it → Start Server
# 4. Run the agent
python agent.py
q to end session| Goal | Change |
|---|---|
| Faster LLM responses | Lower MAX_TOKENS to 128 |
| More natural TTS pace | Adjust pace param in FastPitch (default 1.0) |
| Less VRAM | Use Q3_K_M quantisation in LM Studio |
| Better mic silence detection | Tune SILENCE_THRESH in agent.py (0.01–0.03) |
| Longer student answers | Increase MAX_REC_SEC |
1 commits
Python
100.0%
Microphone
│
▼
[STT] nvidia/parakeet_realtime_eou_120m-v1 (CPU)
│ transcript text
▼
[LLM] gemma-2-2b-it via LM Studio (GPU)
│ examiner reply
▼
[TTS] nvidia/tts_en_fastpitch + HiFi-GAN (CPU)
│ audio waveform
▼
Speakers
| Component | Runs on | VRAM |
|---|---|---|
| gemma-2-2b-it Q4_K_M (all 28 layers on GPU) | GPU | ~1.4 GB |
| KV cache @ 4096 context | GPU | ~0.3 GB |
| parakeet STT 120M | CPU | 0 |
| FastPitch + HiFi-GAN TTS | CPU | 0 |
| Total | ~1.7 GB |
STT and TTS deliberately run on CPU to leave all VRAM for the LLM. The 120M parakeet model is fast enough on a modern CPU (~200 ms RTF). FastPitch synthesis of a 15-word sentence takes ~0.5 s on CPU.
| Setting | Value | Reason |
|---|---|---|
| Context Length | 4096 | As specified; fits in VRAM |
| GPU Layers | 28 (ALL) | Fully offload gemma-2-2b-it |
| CPU Threads | 6 | For any CPU fallback |
| Batch Size (n_batch) | 256 | Balanced throughput vs memory |
| Flash Attention | ✅ ON | Saves ~200 MB VRAM |
| KV Cache Quantisation | Q8_0 | Saves ~100 MB VRAM |
| mmap | ✅ ON | Faster cold load |
| mlock | ❌ OFF | Don't pin all weights in RAM |
| Temperature | 0.7 | Set per-request in agent.py |
| Rope Scaling | Default | gemma-2 handles natively |
The agent uses the OpenAI-compatible endpoint (not /api/v1/chat):
POST http://localhost:1234/v1/chat/completions
{
"model": "gemma-2-2b-it",
"messages": [
{"role": "system", "content": "You are an IELTS examiner…"},
{"role": "user", "content": "Student answer here"}
],
"max_tokens": 256,
"temperature": 0.7
}
The
/api/v1/chatendpoint you quoted is LM Studio's native v1 stateful API (added in v0.4.0) which usesinputinstead ofmessages[]. Both work, but the OpenAI-compat endpoint is simpler and more stable.
ASRModel.from_pretrained("nvidia/parakeet_realtime_eou_120m-v1")FastPitchModel.from_pretrained("nvidia/tts_en_fastpitch")HifiGanModel.from_pretrained("nvidia/tts_hifigan")# 1. Set up environment (first time only)
bash setup.sh
# 2. Activate venv
source .venv/bin/activate
# 3. Start LM Studio → load gemma-2-2b-it → Start Server
# 4. Run the agent
python agent.py
q to end session| Goal | Change |
|---|---|
| Faster LLM responses | Lower MAX_TOKENS to 128 |
| More natural TTS pace | Adjust pace param in FastPitch (default 1.0) |
| Less VRAM | Use Q3_K_M quantisation in LM Studio |
| Better mic silence detection | Tune SILENCE_THRESH in agent.py (0.01–0.03) |
| Longer student answers | Increase MAX_REC_SEC |
1 commits
Python
100.0%