Add Chrome Built-in AI (Prompt API / Gemini Nano) as a zero-download local provider in the AI Harness
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- playwright, react, typescript
Rechercherichtung
Start with src/lib/ai/providers.ts, src/lib/ai/types.ts, and src/lib/ai/local-adapter.ts, then inspect the provider settings panels in src/components/studio/views/ai-harness-settings*.tsx. Implement and test capability detection plus provider integration in src/lib/ai/tools.ts and src/lib/ai/provider-errors.ts, using Playwright to mock the Prompt API. Done means an available built-in provider appears only for supported browsers, structured output and errors work through the existing adapter interface, and unit and E2E coverage passes.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
The AI Harness supports OpenRouter, Ollama, and in-browser models (transformers.js). There is a fourth local-first option that fits the product's "zero backend, minimal download" philosophy: the Chrome Built-in AI Prompt API (Gemini Nano). It ships with the browser — no weights to download, no remote calls, no Ollama install — and supports constrained/structured output, which is ideal for the harness's tool-calling and claim-extraction flows.
Evidence
- Provider surface:
src/lib/ai/providers.ts+src/lib/ai/local-adapter.ts(Ollama + in-browser models) +src/lib/ai/types.ts(provider abstraction to extend). - The Settings/AI Harness panels (
src/components/studio/views/ai-harness-settings*.tsx) already model per-provider capability gating — the pattern to copy for capability detection. - No references to
LanguageModel/window.ai/ Prompt API exist insrc/today.
Impact
- New feature with zero infrastructure: instant local AI for Chrome/Edge users without the ~25 MB model download of the semantic path or an Ollama install.
- Fits privacy posture: on-device inference, opt-in, nothing leaves the device — consistent with ADR 045's threat model.
- Structured output:
responseConstraintgives JSON that always parses — a better primitive for client-side tool calls (src/lib/ai/tools.ts) than prompt-engineering.
Proposed approach
- Capability-detect
self.LanguageModel.availability()(andLanguageModelParams); expose as a new provider in the harness only when available. - Implement behind the existing provider adapter interface; reuse
url-guard.ts-style defensive coding for the (absent) network path. - Keep it clearly labeled "Chrome/Edge only" in the provider picker; follow the repo's capability-ladder UX: Prompt API → WebGPU in-browser model → Ollama → OpenRouter.
- E2E: mock the Prompt API in Playwright; unit tests for availability detection and error mapping via
provider-errors.ts.
References
- Chrome Built-in AI / Prompt API docs: https://developer.chrome.com/docs/ai/prompt-api
- 2026 browser-AI runtime comparison (Prompt API vs WebGPU vs transformers.js): https://pockit.tools/blog/run-llms-browser-webgpu-transformers-js-chrome-built-in-ai-guide/
- Capability-ladder pattern: https://nirajiitr.com/blog/client-side-webgpu-ai-small-language-models-browser
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3
- Forks
- 2
- Ø Merge
- 11 Std. 49 Min.
- Gemergte PRs (30 T.)
- 102
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus d-oit/do-knowledge-studio
-
Migrate do-harness.toml to the current [[sensors]] schema (do-harness CLI 0.6.0 cannot parse it)Offenchore config priority: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
d-oit/do-knowledge-studio#1219 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Dependabot only scans the root manifest — add workspace packages/* directories, cooldown, and grouped updatesEvtl. vergeben @d-oit hat das heute übernommen. Offenci config deps priority: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
d-oit/do-knowledge-studio#1212 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation priority: low
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
d-oit/do-knowledge-studio#1218 ·
Maintainer antworten meist innerhalb von 1 Tag
-
chore priority: low skills
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
d-oit/do-knowledge-studio#1217 ·
Maintainer antworten meist innerhalb von 1 Tag
-
discussion enhancement performance priority: low search
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
d-oit/do-knowledge-studio#1216 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in d-oit/do-knowledge-studio
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
danielmiessler/LifeOS#3028 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
Koenkk/zigbee2mqtt#33855 ·
Maintainer antworten meist innerhalb von 1 Tag