Nerede?
}
Build and ship a Turkish-English semantic search with EmbeddingGemma 2. A hands-on workshop proposal for GDG DevFest İstanbul 2026 · 19 December · Wyndham Grand İstanbul Levent
Try the live demo Start the workshop
Ask "nerede balık ekmek yenir?", "when is DevFest?" or "how big is the model?" and get answers from three small collections, matched by meaning rather than keywords: Istanbul places (with photos), DevFest İstanbul 2026 and EmbeddingGemma 2 itself. Turkish questions find English answers, and English questions find Turkish ones.
-
Python first
Embed, index, evaluate and route with
sentence-transformersin a few dozen lines. -
LiteRT
The same model as a 165 MB int4 file. No PyTorch, loads in 0.3 s, and the container starts in about a second.
-
In the browser
transformers.js on WebGPU. The query never leaves the device, and the whole demo can be hosted for free as static files.
-
Photos too
Photos and text share one vector space: index Istanbul photos once, then search them with plain words.
Quick start¶
You only need uv, it installs Python for you. Details in Setup.
git clone https://github.com/onuralpszr/nerede && cd nerede
# downloads the models, run it at home
uv run workshop/00_setup_check.py
# embeds 147 docs, keeps the shipped photo vectors
uv run workshop/02_build_index.py --no-images
NEREDE_BACKEND=litert uv run uvicorn app.main:app
On Windows PowerShell, set the variable first: $env:NEREDE_BACKEND = "litert", then uv run uvicorn app.main:app (details).
Open http://127.0.0.1:8000 and switch between Server and Browser mode.
No laptop power, no credit card?
Everything in this workshop runs for free: on any laptop CPU, in the Colab notebook, or as a static site on GitHub Pages. See Free options.
One model, three runtimes¶
flowchart LR
D[data/*.jsonl<br/>+ photos] -->|PyTorch, step 2| I[(index<br/>768d vectors)]
I --> S[FastAPI + LiteRT<br/>container]
I -->|256d export| W[index.json]
W --> B[Browser<br/>transformers.js]
I --> C[CLI and notebook]
The index is built once with PyTorch. LiteRT searches it on the server and transformers.js searches it in the browser. This works because the three runtimes produce the same vectors. Across runtimes the cosine similarity is 0.98 to 0.99 and recall does not change.
Agenda (60 minutes)¶
Run uv run workshop/00_setup_check.py at home first: the models are about 1.7 GB, too much for venue Wi-Fi.
Parts 5 and 7 are short speaker demos, so run them later at your own pace.
| Time | Part | You will |
|---|---|---|
| 0:00 | Intro | Learn what embeddings are and what is new in EmbeddingGemma 2 |
| 0:05 | 1. Embeddings | Embed sentences, use task prompts, search across languages |
| 0:13 | 2. Index and search | Build a vector index of places, DevFest facts and model docs |
| 0:23 | 3. Measure | Evaluate recall at 768, 512, 256 and 128 dimensions |
| 0:30 | 4. Router | Classify questions with no training data, fix one-word queries |
| 0:37 | 5. Runtimes | Demo: PyTorch, LiteRT and OpenVINO on CPU and GPU |
| 0:42 | 6. Ship it | Run the API and UI, build a container, publish for free |
| 0:52 | 7. Photos | Demo: search photos with words, and places with a photo |
| 0:57 | Wrap-up | Questions and what to try next |