Local AI-powered Icelandic grammar teacher. Analyse sentences word by word with streaming responses, anti-hallucination verification, and a bilingual (FR/EN) interface. Runs fully offline with Ollama.
Technical article in 2 parts on my blog :
- Word-by-word grammar analysis — conjugation, morphology, natural translation, and contextual examples
- Streaming responses — first tokens appear in ~0.5s via Server-Sent Events; no waiting for the full generation
- Anti-hallucination pipeline — two-stage verification (generate → verify → correct if needed) with deterministic temperature
- Bilingual interface — French and English, switchable at runtime
- Light / dark theme
- Fully offline — no external API calls; everything runs locally via Ollama
| Layer | Technology |
|---|---|
| Backend | Node.js 18+, Express, ESM |
| Frontend | React 18, Vite |
| AI runtime | Ollama (local LLM) |
| Markdown | react-markdown + remark-gfm |
- Node.js >= 18
- Ollama installed and running — ollama.com/download
- A compatible model pulled, e.g.
llama3:8b:
ollama pull llama3:8bgit clone https://github.com/Candyfair/IcelandicTeacher.git
cd IcelandicTeachercp .env.example .envEdit .env to match your setup (see Configuration).
# Backend
npm install
# Frontend
cd frontend && npm install && cd ..Make sure Ollama is running, then start the model:
ollama serve # starts the Ollama server (skip if already running)
ollama run llama3:8b # loads the model into memoryYou can stop
ollama runonce the model is loaded — the server keeps it in memory. To verify Ollama is ready:curl http://localhost:11434
cd frontend && npm run build && cd ..npm startThe app is available at http://localhost:3000.
Development mode (backend auto-reload + Vite HMR):
# Terminal 1 — backend npm run dev # Terminal 2 — frontend cd frontend && npm run dev
Copy .env.example to .env and adjust the values:
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
Port the Express server listens on |
HOST |
0.0.0.0 |
Bind address |
OLLAMA_BASE_URL |
http://localhost:11434 |
Ollama API base URL |
MODEL_NAME |
llama3:8b |
Model used for generation and verification |
REQUEST_TIMEOUT_MS |
120000 |
Request timeout in milliseconds |
PROVIDER |
ollama |
AI provider (ollama only for now) |
NODE_ENV |
development |
Node environment |
IcelandicTeacher/
├── server.js # Entry point
├── app.js # Express app setup
├── src/
│ ├── config/config.js # Environment variables & model parameters
│ ├── controllers/ # Route handlers
│ ├── services/
│ │ ├── analyzeService.js # Generation + streaming + anti-hallucination
│ │ └── validationService.js# Answer validation (double-pass)
│ ├── providers/
│ │ └── localOllamaProvider.js # Ollama integration (blocking + streaming)
│ ├── routes/apiRoutes.js # API routes
│ └── middlewares/ # Error handling
└── frontend/
└── src/
├── components/ # InputForm, ResultBlock, ThemeToggle
├── hooks/ # useGrammarAnalysis
├── services/api.js # SSE client
└── locales/ # fr.js, en.js
See the open issues for the full list of planned features and known bugs.
This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later). See the GPL-3.0 license for details.

