The sentence helper is an optional download (Settings → Sentence helper): Gemma 4 E2B in Google's web build, run by Google's LiteRT-LM web runtime on the graphics chip, in a worker. ✨ beside the message turns the words chosen into three sentences, fitting what the partner said if it was typed in, or suggests four replies when no words are chosen yet. The suggestions take the word predictions' place, at their height, so no cell moves (SPEC §3); the person chooses one and speaks it. Nothing is spoken by itself, and nothing typed leaves the device. - ai_helper.rs: the catalogue (aac-ai-index/1), prompts, whether a device can run it (a WebGPU hardware adapter, never the processor), download, continue, remove and re-check, and suggestions that a later request supersedes. The model's parts (64 MiB, SHA-256 checked) and the one runtime build this browser runs live in the model store; the worker streams the parts from there into GPU memory. - third_party/litert-lm: @litert-lm/core 0.17.1 vendored and pinned (npm integrity, each file's size and SHA-256), with our worker bundled by esbuild 0.28.2; the runtime's CDN default is emptied. - tools/ai: build_ai.py (the pinned model → parts and catalogue), check_packs.py, languages.json (English, Spanish, German and Hindi ready; Swahili not yet), and eval/: the 20 exchanges, a harness that runs the app's own prompts (a test keeps them word for word), and the judged answers. - Measured: Chrome on an M5 Max, 0.4-0.7 s an answer. A real iPad Air (M3) in Safari 27: 101 s to download and check 2 GB, about 80 s for the first start, 5.9 s for later starts, 0.8-1.4 s an answer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
244 lines
6.5 KiB
JSON
244 lines
6.5 KiB
JSON
{
|
|
"about": "The languages the sentence helper is offered in, with the examples the model is shown before each request (tools/ai/build_ai.py copies them into the catalogue). A language is ready only after testing: tools/ai/eval's 20 everyday exchanges per language, each answer read for whether one of the suggestions says what the person meant, in good grammar. Languages not listed have not been tested and are not offered.",
|
|
"languages": {
|
|
"en": {
|
|
"status": "ready",
|
|
"name": "English",
|
|
"model": "gemma-4-e2b-it-web",
|
|
"note": "In our test of 20 everyday exchanges, 18 had a usable sentence among the three offered, and its replies were natural.",
|
|
"examples": {
|
|
"sentence": [
|
|
{
|
|
"partner": "Good morning!",
|
|
"words": "fine you",
|
|
"out": [
|
|
"I'm fine, and you?",
|
|
"Fine, thank you. And you?",
|
|
"I'm doing fine, how about you?"
|
|
]
|
|
},
|
|
{
|
|
"partner": null,
|
|
"words": "phone",
|
|
"out": [
|
|
"I need my phone.",
|
|
"Can you give me my phone?",
|
|
"Where is my phone?"
|
|
]
|
|
}
|
|
],
|
|
"reply": [
|
|
{
|
|
"partner": "Good morning!",
|
|
"out": [
|
|
"Good morning! How are you?",
|
|
"Morning! I slept well.",
|
|
"Good morning, I'm tired today.",
|
|
"Hi! Good to see you."
|
|
]
|
|
},
|
|
{
|
|
"partner": "What do you need?",
|
|
"out": [
|
|
"I need some water, please.",
|
|
"I need the bathroom.",
|
|
"Nothing right now, thanks.",
|
|
"Can you help me sit up?"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"es": {
|
|
"status": "ready",
|
|
"name": "Spanish",
|
|
"model": "gemma-4-e2b-it-web",
|
|
"note": "In our test of 20 everyday exchanges, 17 had a usable sentence among the three offered, and its replies were natural.",
|
|
"examples": {
|
|
"sentence": [
|
|
{
|
|
"partner": "¡Buenos días!",
|
|
"words": "bien tú",
|
|
"out": [
|
|
"Estoy bien, ¿y tú?",
|
|
"Bien, gracias. ¿Y tú?",
|
|
"Estoy muy bien, ¿y tú cómo estás?"
|
|
]
|
|
},
|
|
{
|
|
"partner": null,
|
|
"words": "teléfono",
|
|
"out": [
|
|
"Necesito mi teléfono.",
|
|
"¿Me das mi teléfono?",
|
|
"¿Dónde está mi teléfono?"
|
|
]
|
|
}
|
|
],
|
|
"reply": [
|
|
{
|
|
"partner": "¡Buenos días!",
|
|
"out": [
|
|
"¡Buenos días! ¿Cómo estás?",
|
|
"Buenos días, dormí bien.",
|
|
"Buenos días, hoy estoy cansado.",
|
|
"¡Hola! Qué bueno verte."
|
|
]
|
|
},
|
|
{
|
|
"partner": "¿Qué necesitas?",
|
|
"out": [
|
|
"Necesito agua, por favor.",
|
|
"Necesito ir al baño.",
|
|
"Nada por ahora, gracias.",
|
|
"¿Me ayudas a sentarme?"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"de": {
|
|
"status": "ready",
|
|
"name": "German",
|
|
"model": "gemma-4-e2b-it-web",
|
|
"note": "In our test of 20 everyday exchanges, 17 had a usable sentence among the three offered, and its replies were natural.",
|
|
"examples": {
|
|
"sentence": [
|
|
{
|
|
"partner": "Guten Morgen!",
|
|
"words": "gut du",
|
|
"out": [
|
|
"Mir geht es gut, und dir?",
|
|
"Gut, danke. Und dir?",
|
|
"Mir geht's gut, wie geht's dir?"
|
|
]
|
|
},
|
|
{
|
|
"partner": null,
|
|
"words": "Handy",
|
|
"out": [
|
|
"Ich brauche mein Handy.",
|
|
"Gibst du mir mein Handy?",
|
|
"Wo ist mein Handy?"
|
|
]
|
|
}
|
|
],
|
|
"reply": [
|
|
{
|
|
"partner": "Guten Morgen!",
|
|
"out": [
|
|
"Guten Morgen! Wie geht es dir?",
|
|
"Morgen! Ich habe gut geschlafen.",
|
|
"Guten Morgen, ich bin heute müde.",
|
|
"Hallo! Schön, dich zu sehen."
|
|
]
|
|
},
|
|
{
|
|
"partner": "Was brauchst du?",
|
|
"out": [
|
|
"Ich brauche Wasser, bitte.",
|
|
"Ich muss auf die Toilette.",
|
|
"Gerade nichts, danke.",
|
|
"Kannst du mir helfen, mich aufzusetzen?"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"hi": {
|
|
"status": "ready",
|
|
"name": "Hindi",
|
|
"model": "gemma-4-e2b-it-web",
|
|
"note": "In our test of 20 everyday exchanges, 15 had a usable sentence among the three offered, and its replies were natural.",
|
|
"examples": {
|
|
"sentence": [
|
|
{
|
|
"partner": "सुप्रभात!",
|
|
"words": "ठीक आप",
|
|
"out": [
|
|
"मैं ठीक हूँ, और आप?",
|
|
"ठीक हूँ, धन्यवाद। आप कैसे हैं?",
|
|
"मैं बिल्कुल ठीक हूँ, आप सुनाइए?"
|
|
]
|
|
},
|
|
{
|
|
"partner": null,
|
|
"words": "फ़ोन",
|
|
"out": [
|
|
"मुझे अपना फ़ोन चाहिए।",
|
|
"क्या आप मुझे मेरा फ़ोन देंगे?",
|
|
"मेरा फ़ोन कहाँ है?"
|
|
]
|
|
}
|
|
],
|
|
"reply": [
|
|
{
|
|
"partner": "सुप्रभात!",
|
|
"out": [
|
|
"सुप्रभात! आप कैसे हैं?",
|
|
"सुप्रभात, मैं अच्छे से सोया।",
|
|
"सुप्रभात, आज मैं थका हुआ हूँ।",
|
|
"नमस्ते! आपको देखकर अच्छा लगा।"
|
|
]
|
|
},
|
|
{
|
|
"partner": "तुम्हें क्या चाहिए?",
|
|
"out": [
|
|
"मुझे पानी चाहिए, कृपया।",
|
|
"मुझे शौचालय जाना है।",
|
|
"अभी कुछ नहीं, धन्यवाद।",
|
|
"क्या आप मुझे बैठने में मदद करेंगे?"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"sw": {
|
|
"status": "not-yet",
|
|
"name": "Swahili",
|
|
"note": "In our test of 20 everyday exchanges, many of its Swahili sentences and replies were not grammatical.",
|
|
"examples": {
|
|
"sentence": [
|
|
{
|
|
"partner": "Habari za asubuhi!",
|
|
"words": "nzuri wewe",
|
|
"out": [
|
|
"Nzuri, na wewe je?",
|
|
"Salama, asante. Na wewe?",
|
|
"Niko vizuri, habari yako?"
|
|
]
|
|
},
|
|
{
|
|
"partner": null,
|
|
"words": "simu",
|
|
"out": [
|
|
"Nahitaji simu yangu.",
|
|
"Unaweza kunipa simu yangu?",
|
|
"Simu yangu iko wapi?"
|
|
]
|
|
}
|
|
],
|
|
"reply": [
|
|
{
|
|
"partner": "Habari za asubuhi!",
|
|
"out": [
|
|
"Nzuri! Habari yako?",
|
|
"Nzuri, nimelala vizuri.",
|
|
"Salama, ila nimechoka leo.",
|
|
"Habari! Nafurahi kukuona."
|
|
]
|
|
},
|
|
{
|
|
"partner": "Unahitaji nini?",
|
|
"out": [
|
|
"Nahitaji maji, tafadhali.",
|
|
"Nahitaji kwenda chooni.",
|
|
"Sihitaji kitu sasa, asante.",
|
|
"Unaweza kunisaidia kukaa?"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|