The Problem
Three clients ask for a prediction on the same Wikidata revision, and the model computes it three times:
- Wikimedia Enterprise, querying LiftWing directly.
- change-prop, driving the prediction stream so the data lands in the Data Lake.
- RecentChanges, expected next. (after T429049)
That is expensive here: the model is GPU-backed and slow, and adding the second client in July already caused a latency regression for Enterprise (T420883).
Proposal
Adopt the proposed Linked Artifacts Cache architecture in Prep Pantry (https://wikitech.wikimedia.org/wiki/Prep_Pantry/Architectures#Linked_Artifacts_Cache), matching the second diagram in T433699#12211658:
- revertrisk-wikidata becomes a LAC lambda (KServe v2 over gRPC).
- A MediaWiki JobQueue precompute job warms the artifact on PageLatestRevisionChanged for wikidatawiki.
- MediaWiki produces the prediction event from LinkedArtifactPrecomputed, replacing change-prop and removing event production from LiftWing.
- Enterprise and RecentChanges read from LAC instead of calling LiftWing.
One inference per revision, shared by all three clients. Every read after the artifact exists becomes a Cassandra lookup instead of reaching the model on LiftWing.
Implications
- Moving off change-prop means moving its controls into the precompute config. For revertrisk-wikidata, change-prop gives us:
- Filtering. We consume mediawiki.page_change.v1 and match wiki_id: wikidatawiki, page_change_kind: edit|create|move, namespace_id: 0, is_redirect: false, excluding canary.
- Concurrency. concurrency: 2, capping in-flight requests to the model.
- Retries. retry_on for 502 and 503.
- The artifact serves two kinds of consumers. Enterprise and RecentChanges read it directly, and MediaWiki builds the prediction event from it, so the payload has to cover both.
- Slim events (T433699#12221969). The break is acceptable for us, as downstream users read the prediction from the Data Lake table and can join mediawiki.page_change for the rest. ML team needs to decide on the slim event data model and whether it is a v2 or a new stream.
- Clients would depend on LAC's read SLO, and ours becomes the lambda's compute latency.
Dependencies
- ML team — add v2/gRPC to the isvc; define the artifact payload and the slim event data model together; define the lambda SLI
- Data Persistence SRE — register the artifact; read SLO
- Data Engineering — the MediaWiki precompute job
- Wikimedia Enterprise — switch to the LAC endpoint, and tell us what freshness they need after an edit.
Open questions
- [Data Engineering] does the precompute config provide equivalents for change-prop?
- [Data Engineering] how long after an edit does the precompute job run?
- [Data Persistence SRE] if a client read arrives before the precompute finishes, does it trigger a second inference, or wait on the one already in flight?
- [Data Engineering] if a precompute fails, is it retried? Otherwise the revision produces no prediction event.
Next steps
- Discuss internally in the ML team first, then follow up with the other teams on the open questions and dependencies.