Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 64 additions & 33 deletions src/pages/api.astro
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ const playgroundSystems = [
<section class="api-hero">
<div class="container">
<p class="eyebrow eyebrow-accent">API & playground</p>
<h1>Try it. Copy the snippet. Ship.</h1>
<h1>Try the API.</h1>
<p class="hero-deck">
The Interscript REST API runs at <code>https://interscript.org/api/</code> — open to all, no auth,
no rate limits (yet). Three endpoints: <code>/api/transliterate</code>, <code
>/api/systems</code
>, <code>/api/detect</code>. Or run the same engine locally in JS, TypeScript, Ruby, or your
terminal.
The REST API runs at <code>https://api.interscript.org/v1</code>. No account, no API key.
Send a POST request with a JSON body. Endpoints: <code>/transliterate</code> (one
conversion), <code>/transliterate/batch</code> (many), <code>/systems</code> (the 289-system
catalogue), <code>/detect</code> (which system explains a source–target pair), and
<code>/infer</code> (neural models — diacritization and grapheme-to-phoneme). Responses
allow cross-origin requests, so browser scripts can call the API directly.
</p>
<pre
class="hero-curl"><code set:html={`# Live, no install needed:
curl -G 'https://interscript.org/api/transliterate' \\
--data-urlencode 'system=bgnpcgn-ukr-Cyrl-Latn-2019' \\
--data-urlencode 'input=Антон'
# → {"system":"bgnpcgn-ukr-Cyrl-Latn-2019","input":"Антон","output":"Anton",…}`} /></pre>
class="hero-curl"><code set:html={`curl -X POST 'https://api.interscript.org/v1/transliterate' \\
-H 'Content-Type: application/json' \\
-d '{"system": "bgnpcgn-ukr-Cyrl-Latn-2019", "input": "Антон"}'
# → {"system":"bgnpcgn-ukr-Cyrl-Latn-2019","input":"Антон","output":"Anton"}`} /></pre>
</div>
</section>

Expand All @@ -55,9 +55,19 @@ curl -G 'https://interscript.org/api/transliterate' \\
<h3>npm</h3>
</header>
<pre><code>npm install interscript</code></pre>
<pre><code set:html={`import { transliterate } from "interscript"
<pre><code set:html={`import {
configure,
iscStrategy,
transliterateAsync
} from "interscript"

configure({
strategies: [
iscStrategy({ baseUrl: "https://interscript.org/maps" })
]
})

const out = transliterate(
const out = await transliterateAsync(
"bgnpcgn-ukr-Cyrl-Latn-2019",
"Антон"
)
Expand All @@ -79,29 +89,49 @@ out = Interscript.transliterate(
# → "Anton"`} /></pre>
</article>

<article class="install-card">
<header>
<span class="runtime-badge">Python</span>
<h3>pip</h3>
</header>
<pre><code>pip install interscript</code></pre>
<pre><code set:html={`import os, interscript

# Point at a checkout of github.com/interscript/maps
# (the pip package ships the engine, not the corpus):
interscript.add_load_path(
os.environ["INTERSCRIPT_MAPS_PATH"]
)

print(interscript.transliterate(
"bgnpcgn-ukr-Cyrl-Latn-2019", "Антон"
))
# → Anton`} /></pre>
</article>

<article class="install-card">
<header>
<span class="runtime-badge">Browser</span>
<h3>CDN</h3>
</header>
<pre><code>npm install interscript
# or: https://esm.sh/interscript-ts</code></pre>
<pre><code>No build step. Import from a CDN:</code></pre>
<pre><code set:html={`import {
transliterateAsync,
httpStrategy,
configure
} from "https://esm.sh/interscript-ts"
configure,
iscStrategy,
transliterateAsync
} from "https://esm.sh/interscript@5.3.1"

configure({
strategies: [httpStrategy({
baseUrl: "https://interscript.org/maps"
})]
strategies: [
iscStrategy({ baseUrl: "https://interscript.org/maps" })
]
})

const out = await transliterateAsync(
"bgnpcgn-ukr-Cyrl-Latn-2019",
"Антон"
)`} /></pre>
)
// → "Anton Olehovych"`} /></pre>
</article>
</div>
</div>
Expand Down Expand Up @@ -143,8 +173,9 @@ const out = await transliterateAsync(
<p class="eyebrow">CLI &amp; CI</p>
<h2>Transliterate from the terminal.</h2>
<p class="section-deck">
The <code>interscript-ts</code> CLI runs anywhere Node does — your laptop, a build pipeline,
a GitHub Action. Same engine, same maps, same byte-for-byte output.
The <code>interscript</code> CLI runs anywhere Node does — a laptop, a build pipeline,
a GitHub Action. Maps load from interscript.org; no local checkout needed
(npm package 5.3.1 or later). Same engine and same output as every other runtime.
</p>
</header>

Expand All @@ -154,9 +185,9 @@ const out = await transliterateAsync(
<span class="runtime-badge">CLI</span>
<h3>Install</h3>
</header>
<pre><code>npm install -g interscript-ts
# or use without installing:
npx interscript-ts --help</code></pre>
<pre><code>npm install -g interscript
# or run it once without installing:
npx interscript --help</code></pre>
</article>

<article class="cli-card">
Expand All @@ -165,11 +196,11 @@ npx interscript-ts --help</code></pre>
<h3>Single call</h3>
</header>
<pre><code set:html={`# Transliterate from stdin
echo "Антон" | interscript-ts t bgnpcgn-ukr-Cyrl-Latn-2019
echo "Антон" | interscript t bgnpcgn-ukr-Cyrl-Latn-2019
# → Anton

# Or from a file
interscript-ts t bgnpcgn-ukr-Cyrl-Latn-2019 \\
interscript t bgnpcgn-ukr-Cyrl-Latn-2019 \\
-i input.txt -o output.txt`} /></pre>
</article>

Expand All @@ -179,11 +210,11 @@ interscript-ts t bgnpcgn-ukr-Cyrl-Latn-2019 \\
<h3>Batch (CSV)</h3>
</header>
<pre><code set:html={`# names.txt has one name per line
interscript-ts b bgnpcgn-ukr-Cyrl-Latn-2019 \\
interscript b bgnpcgn-ukr-Cyrl-Latn-2019 \\
names.txt --csv > romanized.csv

# Or: list every BGN/PCGN Cyrillic system
interscript-ts list --authority bgnpcgn \\
interscript list --authority bgnpcgn \\
--source-script Cyrl --maps-dir ./maps`} /></pre>
</article>

Expand All @@ -202,7 +233,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npx interscript-ts@latest \\
- run: npx interscript@latest \\
b bgnpcgn-ukr-Cyrl-Latn-2019 \\
names.txt --csv \\
--http https://interscript.org/maps \\
Expand Down
8 changes: 4 additions & 4 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ for (const code of systemCodes) {
<div class="container">
<header class="section-head">
<p class="eyebrow">The neural layer</p>
<h2>Where maps end, models begin.</h2>
<h2>Neural models for what maps cannot cover.</h2>
<p class="section-deck">
Some conversions have no authority document: restoring the diacritics a scribe left out,
reading Thai or Urdu as phonemes. Those ship as checksummed neural artifacts under the
Expand Down Expand Up @@ -321,10 +321,10 @@ for (const code of systemCodes) {
gem install interscript

# TypeScript / JavaScript
npm install interscript-ts
npm install interscript

# Or load a single map's IR directly
curl interscript.org/maps/&lt;system-code&gt;.json</code></pre>
# Or fetch a single map's source directly
curl interscript.org/maps/&lt;system-code&gt;.isc</code></pre>
</div>
</div>
</section>
Expand Down
19 changes: 13 additions & 6 deletions src/pages/ml.astro
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const clientModels = [
<div class="container">
<p class="eyebrow eyebrow-accent">The neural layer</p>
<h1 class="page-headline">
Where maps end,<br /><em>models</em> begin.
Neural models for the<br /><em>conversions maps cannot cover</em>.
</h1>
<p class="hero-lead">
The 289 authority-backed maps cover romanization systems that a committee has published.
Expand All @@ -134,7 +134,7 @@ const clientModels = [
<div class="container">
<header class="section-head">
<p class="eyebrow">The catalogue</p>
<h2>Every model, with its number.</h2>
<h2>Every model, with its measured score.</h2>
<p class="section-deck">
The index resolves 23 models across five languages. No model is published without a
measured metric next to its teacher's, on the same harness, in the open. Students are
Expand Down Expand Up @@ -211,8 +211,8 @@ const clientModels = [
<section class="section surface-deep" id="leaderboard">
<div class="container">
<header class="section-head">
<p class="eyebrow">The frontier, measured</p>
<h2>580M parameters against the frontier.</h2>
<p class="eyebrow">Measurements</p>
<h2>Our results against the frontier.</h2>
<p class="section-deck">
SadeedDiac-25 — all 1,200 paragraphs, Misraj's own evaluator, windowed zero-skip
protocol, one instrument for every row. Our dedicated 580M teacher is the best
Expand Down Expand Up @@ -364,7 +364,7 @@ const clientModels = [
<div class="container contract-grid">
<div>
<p class="eyebrow">The instrument</p>
<h2>Every trap we fell into, now a rule.</h2>
<h2>How we measure.</h2>
<p class="section-deck">
Measurement discipline isn't ceremony — each of these rules exists because the naive
version produced a wrong number we nearly shipped. They are why a number on this page
Expand Down Expand Up @@ -468,6 +468,13 @@ model.translate("สวัสดี")
>SECRYST_CACHE</code
>. Both are read at call time in all three runtimes.
</p>
<p class="env-note">
Without installing anything: the same models answer the REST endpoint
<code>POST https://api.interscript.org/v1/infer</code> (open CORS, no key), and run in the
browser at <a href="/neural">the demo page</a>. In a script with no build step, the map
layer loads from <a href="https://esm.sh/interscript@5.3.1">esm.sh</a> — full recipe in the
package's <code>docs/CDN.md</code>.
</p>
</div>
</section>

Expand All @@ -478,7 +485,7 @@ model.translate("สวัสดี")
<div class="container cta-grid">
<div class="cta-text">
<p class="eyebrow eyebrow-accent">Provenance</p>
<h2>Measured, or it doesn't ship.</h2>
<h2>Every number is measured.</h2>
<p class="cta-deck">
Teachers are frozen before distillation and never LLM-generated — language-model teachers
hallucinate diacritics. Every number in the ledger links to a protocol in the open results
Expand Down
19 changes: 9 additions & 10 deletions src/scripts/api-playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ const state: State = {
}

function snippetJs(s: State): string {
return `import { transliterate } from "interscript"
return `import { configure, iscStrategy, transliterateAsync } from "interscript"

const result = transliterate(
configure({
strategies: [iscStrategy({ baseUrl: "https://interscript.org/maps" })],
})

const result = await transliterateAsync(
"${s.system}",
${JSON.stringify(s.input)}
)
Expand All @@ -64,15 +68,10 @@ puts result
}

function snippetCurl(s: State): string {
return `# GET request — easy to test in any terminal
curl -G 'https://interscript.org/api/transliterate' \\
--data-urlencode 'system=${s.system}' \\
--data-urlencode 'input=${s.input}'

# Or POST a JSON body:
curl -X POST 'https://interscript.org/api/transliterate' \\
return `curl -X POST 'https://api.interscript.org/v1/transliterate' \\
-H 'Content-Type: application/json' \\
-d '{"system": "${s.system}", "input": ${JSON.stringify(s.input)}}'`
-d '{"system": "${s.system}", "input": ${JSON.stringify(s.input)}}'
# → {"system":"${s.system}","input":${JSON.stringify(s.input)},"output":${JSON.stringify(s.output)}}`
}

function render() {
Expand Down