Skip to content

Commit a0916fc

Browse files
authored
Merge pull request #1 from interscript/feat/rest-openapi-v1
feat: REST v1 (OpenAPI 3.1) + models index + ML inference proxy
2 parents 4fdf7c0 + 0265e6d commit a0916fc

12 files changed

Lines changed: 1280 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,19 @@ ruby -e '... see scripts/build-maps.rb ...'
8080
`test/fixtures/parity.json` holds queries recorded from the production
8181
Ruby API; CI replays them against this implementation. Zero-diff is the
8282
release gate.
83+
84+
85+
## REST v1 (OpenAPI)
86+
87+
REST endpoints serve alongside GraphQL (which remains at `POST /graphql`):
88+
89+
- `GET /openapi.json` — the OpenAPI 3.1 document
90+
- `GET /v1/info` — version + capability summary
91+
- `GET /v1/maps` / `GET /v1/maps/{code}` — bundled transliteration systems
92+
- `POST /v1/transliterate` — `{system, input}` → `{output}`
93+
- `POST /v1/detect` — `{input, output}` → ranked systems
94+
- `GET /v1/models` / `GET /v1/models/{id}` — the neural model index (IMF v1, generated from interscript-ml's models.yaml via `npm run gen:models`)
95+
- `POST /v1/infer` — `{model, input}` → `{output}`; proxies to the
96+
inference service configured with `ML_ENDPOINT` + `ML_TOKEN` env vars
97+
(Interscript runs `src/api/inference.py` on Modal: the same
98+
parity-verified ONNX decode that gates every release)

‎dist/src/generated/models.json‎

Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,312 @@
1+
{
2+
"version": 1,
3+
"models": [
4+
{
5+
"id": "khm-latn-1.0",
6+
"task": "translit",
7+
"scripts": [
8+
"Khmr",
9+
"Latn"
10+
],
11+
"precision": "fp32",
12+
"filename": "khm-latn-1.0-fp32.zip",
13+
"url": "https://github.com/interscript/interscript-ml/releases/download/khm-latn-1.0/khm-latn-1.0-fp32.zip",
14+
"parts": null,
15+
"sha256": "55993d473a2ed9489058779cad7e115db05e4020085b71616468cfae4f2f65cb",
16+
"size": 1418009977,
17+
"metrics": [
18+
{
19+
"name": "cer",
20+
"value": 27.42,
21+
"source": "secryst/docs/RESULTS.md#khmer-transliteration-2026-08-14"
22+
},
23+
{
24+
"name": "em",
25+
"value": 59.66,
26+
"source": "secryst/docs/RESULTS.md#khmer-transliteration-2026-08-14"
27+
}
28+
],
29+
"parity": {
30+
"samples": 895,
31+
"cer_delta": 0.0
32+
},
33+
"license": "BSD-3-Clause"
34+
},
35+
{
36+
"id": "urd-g2p-1.0",
37+
"task": "g2p",
38+
"scripts": [
39+
"Arab",
40+
"IPA"
41+
],
42+
"precision": "fp32",
43+
"filename": "urd-g2p-1.0-fp32.zip",
44+
"url": "https://github.com/interscript/interscript-ml/releases/download/urd-g2p-1.0/urd-g2p-1.0-fp32.zip",
45+
"parts": null,
46+
"sha256": "9f0a248c7116aa7f6b9ac125fb9684a3556f3b8ce8b64567c05a5e7e7a018ebf",
47+
"size": 1418039605,
48+
"metrics": [
49+
{
50+
"name": "cer",
51+
"value": 14.77,
52+
"source": "rababa-urdu/docs/RESULTS.md#g2p-urdu-text--ipa"
53+
},
54+
{
55+
"name": "em",
56+
"value": 33.6,
57+
"source": "rababa-urdu/docs/RESULTS.md#g2p-urdu-text--ipa"
58+
}
59+
],
60+
"parity": {
61+
"samples": 12699,
62+
"cer_delta": 0.0
63+
},
64+
"license": "BSD-3-Clause"
65+
},
66+
{
67+
"id": "urd-diac-1.0",
68+
"task": "diacritization",
69+
"scripts": [
70+
"Arab",
71+
"Arab"
72+
],
73+
"precision": "fp32",
74+
"filename": "urd-diac-1.0-fp32.zip",
75+
"url": "https://github.com/interscript/interscript-ml/releases/download/urd-diac-1.0/urd-diac-1.0-fp32.zip",
76+
"parts": null,
77+
"sha256": "c299ea44a4da4851a52283f8e42d2fb6f8c7a9c443ba7eb0270f97372e10b8ea",
78+
"size": 1417851421,
79+
"metrics": [
80+
{
81+
"name": "cer",
82+
"value": 3.74,
83+
"source": "rababa-urdu/docs/RESULTS.md#diacritization-urdu-text--text--haraqat"
84+
}
85+
],
86+
"parity": {
87+
"samples": 11940,
88+
"cer_delta": 0.0
89+
},
90+
"license": "BSD-3-Clause"
91+
},
92+
{
93+
"id": "heb-diac-1.0",
94+
"task": "diacritization",
95+
"scripts": [
96+
"Hebr",
97+
"Hebr"
98+
],
99+
"precision": "fp32",
100+
"filename": "heb-diac-1.0-fp32.zip",
101+
"url": null,
102+
"parts": [
103+
{
104+
"url": "https://github.com/interscript/interscript-ml/releases/download/heb-diac-1.0/heb-diac-1.0-fp32.zip.part-00",
105+
"sha256": "5497f70cc3c96829e65f1eb0cc401c2d1ffeb4fa909acd4def824c2e019cbc37",
106+
"size": 1500000000
107+
},
108+
{
109+
"url": "https://github.com/interscript/interscript-ml/releases/download/heb-diac-1.0/heb-diac-1.0-fp32.zip.part-01",
110+
"sha256": "a7d2011ab4f9326a86e234cc49cb50daf82949e51efbf03a21d5796c46465e9d",
111+
"size": 1281139753
112+
}
113+
],
114+
"sha256": "b32fa239e0c56708b6004942de4b9e6e9f265e7cc3828f41d560e96386e20dd8",
115+
"size": 2781139753,
116+
"metrics": [
117+
{
118+
"name": "der_greedy",
119+
"value": 29.0,
120+
"source": "rababa/docs/RESULTS.md#hebrew-diacritization"
121+
},
122+
{
123+
"name": "der_beam4",
124+
"value": 17.46,
125+
"source": "rababa/docs/RESULTS.md#hebrew-diacritization"
126+
}
127+
],
128+
"parity": {
129+
"samples": 600,
130+
"cer_delta": 0.0
131+
},
132+
"license": "BSD-3-Clause"
133+
},
134+
{
135+
"id": "tha-g2p-base-1.0",
136+
"task": "g2p",
137+
"scripts": [
138+
"Thai",
139+
"IPA"
140+
],
141+
"precision": "fp32",
142+
"filename": "tha-g2p-base-1.0-fp32.zip",
143+
"url": null,
144+
"parts": [
145+
{
146+
"url": "https://github.com/interscript/interscript-ml/releases/download/tha-g2p-base-1.0/tha-g2p-base-1.0-fp32.zip.part-00",
147+
"sha256": "c4525414e5dec91a54d055ca9f1acd51c198f81fbfc55977aa82c1fb038d58d7",
148+
"size": 1500000000
149+
},
150+
{
151+
"url": "https://github.com/interscript/interscript-ml/releases/download/tha-g2p-base-1.0/tha-g2p-base-1.0-fp32.zip.part-01",
152+
"sha256": "f5d11fbd75f92e8b5471add867418e2dd4f49a5e258b9ded2f3b5ffa630abe24",
153+
"size": 1281174343
154+
}
155+
],
156+
"sha256": "f341a5868867a9847d3f897d1fcc4d1d63b9a59b8913871bcf4ecab48f4fa895",
157+
"size": 2781174343,
158+
"metrics": [
159+
{
160+
"name": "per_teacher",
161+
"value": 4.43,
162+
"source": "interscript/interscript-ml docs/RESULTS.md#tha-g2p-base-1.0"
163+
},
164+
{
165+
"name": "per_student",
166+
"value": 9.19,
167+
"source": "interscript/interscript-ml docs/RESULTS.md#tha-g2p-base-1.0"
168+
}
169+
],
170+
"parity": {
171+
"samples": 1219,
172+
"cer_delta": 0.0
173+
},
174+
"license": "BSD-3-Clause"
175+
},
176+
{
177+
"id": "tha-g2p-small-1.0",
178+
"task": "g2p",
179+
"scripts": [
180+
"Thai",
181+
"IPA"
182+
],
183+
"precision": "int8",
184+
"filename": "tha-g2p-small-1.0-int8.zip",
185+
"url": "https://github.com/interscript/interscript-ml/releases/download/tha-g2p-small-1.0/tha-g2p-small-1.0-int8.zip",
186+
"parts": null,
187+
"sha256": "f2cfa93a42d98aabf08fdc82dfc6bd1574e21993f36558aa581fbe29e0588a94",
188+
"size": 257468517,
189+
"metrics": [
190+
{
191+
"name": "per_teacher",
192+
"value": 4.43,
193+
"source": "interscript/interscript-ml docs/RESULTS.md#tha-g2p-small-1.0"
194+
},
195+
{
196+
"name": "per_student",
197+
"value": 12.06,
198+
"source": "interscript/interscript-ml docs/RESULTS.md#tha-g2p-small-1.0"
199+
}
200+
],
201+
"parity": {
202+
"samples": 1219,
203+
"cer_delta": 0.0803
204+
},
205+
"license": "BSD-3-Clause"
206+
},
207+
{
208+
"id": "tha-g2p-small-1.0-int4",
209+
"task": "g2p",
210+
"scripts": [
211+
"Thai",
212+
"IPA"
213+
],
214+
"precision": "int4",
215+
"filename": "tha-g2p-small-1.0-int4.zip",
216+
"url": "https://github.com/interscript/interscript-ml/releases/download/tha-g2p-small-1.0/tha-g2p-small-1.0-int4.zip",
217+
"parts": null,
218+
"sha256": "e5d12a3d65c6ac39fa08f52c975c99ff7a51c3e7b7aca7fbb461d2de2345e4cb",
219+
"size": 201958073,
220+
"metrics": [
221+
{
222+
"name": "per_teacher",
223+
"value": 4.43,
224+
"source": "interscript/interscript-ml docs/RESULTS.md#tha-g2p-small-1.0"
225+
},
226+
{
227+
"name": "per_student",
228+
"value": 12.06,
229+
"source": "interscript/interscript-ml docs/RESULTS.md#tha-g2p-small-1.0"
230+
}
231+
],
232+
"parity": {
233+
"samples": 600,
234+
"cer_delta": 0.0734
235+
},
236+
"license": "BSD-3-Clause"
237+
},
238+
{
239+
"id": "heb-diac-small-1.0",
240+
"task": "diacritization",
241+
"scripts": [
242+
"Hebr",
243+
"Hebr"
244+
],
245+
"precision": "fp32",
246+
"filename": "heb-diac-small-1.0-fp32.zip",
247+
"url": "https://github.com/interscript/interscript-ml/releases/download/heb-diac-small-1.0/heb-diac-small-1.0-fp32.zip",
248+
"parts": null,
249+
"sha256": "905c53873d5a62bbe6252c6ec0ecef5f37e96e78cb01e8cd99b6b24c4d4d74ad",
250+
"size": 1418663344,
251+
"metrics": [
252+
{
253+
"name": "der_teacher_greedy",
254+
"value": 24.79,
255+
"source": "interscript/interscript-ml docs/RESULTS.md#heb-diac-small-1.0"
256+
},
257+
{
258+
"name": "der_student_greedy",
259+
"value": 30.37,
260+
"source": "interscript/interscript-ml docs/RESULTS.md#heb-diac-small-1.0"
261+
}
262+
],
263+
"parity": {
264+
"samples": 1864,
265+
"cer_delta": 0.0
266+
},
267+
"license": "BSD-3-Clause"
268+
},
269+
{
270+
"id": "fas-g2p-1.0",
271+
"task": "g2p",
272+
"scripts": [
273+
"Arab",
274+
"Latn"
275+
],
276+
"precision": "fp32",
277+
"filename": "fas-g2p-1.0-fp32.zip",
278+
"url": null,
279+
"parts": [
280+
{
281+
"url": "https://github.com/interscript/interscript-ml/releases/download/fas-g2p-1.0/fas-g2p-1.0-fp32.zip.part-00",
282+
"sha256": "6c475e53f3c7ef3edcef5a24d2d81f51d13ddf4c417de98440943c9a32b03e55",
283+
"size": 1500000000
284+
},
285+
{
286+
"url": "https://github.com/interscript/interscript-ml/releases/download/fas-g2p-1.0/fas-g2p-1.0-fp32.zip.part-01",
287+
"sha256": "c5656c649412f41e201c567e002514d31390b636d4650d9dcb6dfed1973fb3d5",
288+
"size": 1280254270
289+
}
290+
],
291+
"sha256": "b53fd69196127efcc596935d24e135b3c897006872c1646c674e70f3c0d9a0e3",
292+
"size": 2780254270,
293+
"metrics": [
294+
{
295+
"name": "cer",
296+
"value": 1.6,
297+
"source": "interscript/interscript-ml docs/RESULTS.md#fas-g2p-1.0"
298+
},
299+
{
300+
"name": "sb_homograph_ezafe_norm",
301+
"value": 77.34,
302+
"source": "interscript/interscript-ml docs/RESULTS.md#fas-g2p-1.0"
303+
}
304+
],
305+
"parity": {
306+
"samples": 1000,
307+
"cer_delta": 0.0
308+
},
309+
"license": "BSD-3-Clause"
310+
}
311+
]
312+
}

0 commit comments

Comments
 (0)