Skip to content

Free-tier desktop screen embeddings on-device: stop the per-frame Gemini call for free users, keep Gemini upload for paid (follow-on to #13456) #13465

Closed

Description

@Git-on-my-level

Decision (David, 2026-09-10)

Free desktop users move to on-device screen embeddings first; paid users keep the Gemini upload until phone-side screen search has a server-side encoder. Follow-on to #13456, which ships the local engine opt-in and does not touch the per-frame Gemini call.

Why free first

  • plan_catalog.json already declares desktop_free.cloud_screen_vectors: false, and the backend honours it: grants_cloud_screen_vectors gates the Pinecone upsert. A free user's Gemini vectors today serve only desktop-local cosine search, so swapping the embedder changes nothing cross-device for them.
  • The client never reads that catalog value: RewindIndexer → OCREmbeddingService.embedScreenshot → v1/proxy/gemini/…gemini-embedding-001:embedContent runs on every plan, and desktop_proxy.py leaves embedContent outside _PLAN_GATED_PROXY_ACTIONS (TBD-4 / S24). Modelled spend $28.85/day, ~85% from free users (gcp-cost-efficiency evidence 2026-09-02, lever 6).
  • Apple NLContextualEmbedding measured on an M-series Mac: 512-d, ~7 ms per frame, 85 MB OS-managed asset, 2 KB per row vs 12 KB for Gemini 3072-d.

Scope

  1. Real-engine benchmark first (gate). feat(desktop): opt-in on-device embeddings with FTS hybrid retrieval; backend keyword fallback for screen search #13456's benchmark ran on the test_hash engine. Run local_embedding_benchmark with apple_nlce against a real Rewind DB that still holds Gemini blobs, and report recall@10 / nDCG@10 for FTS, vector, hybrid, and Gemini on the same queries. The flip proceeds only if hybrid ≥ Gemini-alone within an agreed margin (David rules on the margin).
  2. Entitlement-aware embed path. Gate the per-frame Gemini call in OCREmbeddingService on the cached plan (FloatingBarUsageLimiter.hasPaidPlan / SubscriptionPlanType.hasPaidCapability, cached in floatingBarCachedPlan) and on a passing local probe: free + probe passes → local only, no Gemini; free + probe fails → FTS-only, never Gemini (fail-closed as in feat(desktop): opt-in on-device embeddings with FTS hybrid retrieval; backend keyword fallback for screen search #13456); paid → today's Gemini upload continues, desktop search still routes local when available.
  3. Default flip for free. Replace the opt-in default (LocalEmbeddingKillSwitches.isEnabled) with plan-derived default: on for free, on for non-production, opt-in for paid until (5). Keep OMI_DISABLE_LOCAL_EMBEDDINGS as the hard kill.
  4. Route the Rewind UI search (RewindViewModel.swift OCREmbeddingService.searchSimilar) through ScreenHistorySearchRoute like the chat tool.
  5. Server side. Mirror the client gate: 402/403 embedContent for basic on desktop_proxy.py once the client change is released (a server cut before the client ships would blank free users' vectors with no local replacement). Telemetry: count local vs Gemini vs FTS-only routes per plan.
  6. Not in scope: paid users' cross-device parity (needs a shared embedder on device and server — separate follow-on), Intel Macs beyond "probe fails → FTS-only".

Evidence needed before closing

  • Benchmark table (real DB, real engine), 8-hour energy/thermal sample on battery with capture on, and one week of route telemetry after release.

Related: #13456 (foundation), TBD-4 / S24 in the local-models-free-tier program.

Activity

  1. Git-on-my-level commented on Sep 11, 2026

    @Git-on-my-level
    MemberAuthor

    Foundation landed on branch feat/desktop-free-tier-local-embeddings (cut from #13456's head; retarget after that merges): ScreenEmbeddingPolicy decides Gemini/local/FTS-only from the cached plan, capture and backfill enforce it, unknown plan resolves as free.

    Two dependencies found during review, being fixed in the same PR before it opens:

    • Stable-channel legacy screen sync selects only rows with a Gemini vector (embedding IS NOT NULL); lossless sync is off on stable. Free users' vectorless rows must stay sync-eligible once OCR is final, or cloud chat and phone time-window browse lose their screen rows.
    • The per-route telemetry fired one remote event per frame; it is being bounded to decision changes plus an hourly heartbeat.
  2. Git-on-my-level commented on Sep 11, 2026

    @Git-on-my-level
    MemberAuthor

    Opened as #13473 (stacked on #13456; retarget to main after that merges).

    Real-fixture benchmark on one Beta DB (144 Gemini-embedded rows, apple_nlce 512-d): hybrid beats FTS-only and vector-only on both slices (held-out self-retrieval recall@1 0.84 hybrid vs 0.71 FTS vs 0.34 vector; recall@10 1.00 / 0.98 / 0.66). Top-10 agreement with Gemini's ranking is 0.30 for hybrid, which shows the rankings differ, not which is better; a labelled query set is needed to settle that. The Apple model alone is a weak retriever; FTS carries the hybrid. Sample is small.

  3. added
    capture
    p2
    p3
    and removed
    capture
    p2
    p3
    on Oct 6, 2026
  4. aryanorastar commented on Oct 30, 2026

    @aryanorastar
    Collaborator

    Fixed on main by #22141 (6d4ddac81f8f). Free plans set shouldEmbedWithGemini false, and embedScreenshot returns before the Gemini call unless that flag is set.

  5. moved this from Someday to In review in omi TODO / bountieson Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    capturep2

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions