Page MenuHomePhabricator
Paste P96652

Testing RR-Wikidata on Staging
ActivePublic

Authored by gkyziridis on Oct 9 2026, 10:38 AM.
Project Tags
None
Referenced Files
F107234407: Testing RR-Wikidata on Staging
Oct 9 2026, 10:38 AM
Subscribers
None
URL=https://inference-staging.svc.codfw.wmnet:30443
HOST="Host: revertrisk-wikidata.revertrisk.wikimedia.org"
# v1 regression check (should be unchanged):
curl -s $URL/v1/models/revertrisk-wikidata:predict -H "$HOST" \
-H "Content-Type: application/json" -d '{"rev_id": 1892513445}'
{"model_name":"revertrisk-wikidata","model_version":"2","revision_id":1892513445,"output":{"prediction":false,"probabilities":{"true":0.10437076243299818,"false":0.8956292375670019}}}
# v1 with the cache's payload (new in the patch). It should return the same body as the regression check:
$ curl -s $URL/v1/models/revertrisk-wikidata:predict -H "$HOST" \
-H "Content-Type: application/json" \
-d '{"wiki_id":"wikidatawiki","page_id":108601362,"revision_id":1892513445}'
{"model_name":"revertrisk-wikidata","model_version":"2","revision_id":1892513445,"output":{"prediction":false,"probabilities":{"true":0.10437076243299818,"false":0.8956292375670019}}}
# v2 REST (new). The prediction comes back JSON-encoded in outputs[0].data[0], and jq decodes it:
$ curl -s $URL/v2/models/revertrisk-wikidata/infer -H "$HOST" \
-H "Content-Type: application/json" \
-d '{"inputs":[{"name":"input","shape":[1],"datatype":"BYTES","data":["{\"wiki_id\":\"wikidatawiki\",\"page_id\":108601362,\"revision_id\":1892513445}"]}]}' \
| jq '.outputs[0].data[0] | fromjson'
{
"model_name": "revertrisk-wikidata",
"model_version": "2",
"revision_id": 1892513445,
"output": {
"prediction": false,
"probabilities": {
"true": 0.10437076243299818,
"false": 0.8956292375670019
}
}
}
# Error check. A wiki_id other than wikidatawiki should return a 400 with an Invalid wiki_id message, not a 500:
$ curl -s -w ' %{http_code}\n' $URL/v1/models/revertrisk-wikidata:predict -H "$HOST" \
-H "Content-Type: application/json" \
-d '{"wiki_id":"enwiki","page_id":1,"revision_id":1892513445}'
{"detail":"Invalid wiki_id: enwiki. This model only handles Wikidata edits (wiki_id must be 'wikidatawiki')."} 400