Concepts
An app, a key, a model version, the response time, sharing, and what a device downloads.
Five words carry most of what you see on sdk.quranlab.ai.
App
An app is one build target that uses the SDK: an iOS app, an Android app, a web origin, a Windows or Linux program. You never create one by hand. On its first launch with a key, the SDK registers the app, and it shows up on your Home with its platform and its identity (a bundle id, a package name, an origin, a package family name or a reverse-DNS id).
An app's page shows figures as totals per day, never a row per person, and hides any group of fewer than 10 installs. From it you can pause the app: a paused app cannot register or fetch model settings, and devices that already have the model keep working offline.
Key
A key links an app to your workspace. It has a type, chosen when it is made and fixed after: apps (iOS and Android), web (exact https origins) or desktop (macOS, Windows and Linux), and an environment, production or development. One key per app is the guideline. Keys says what a key does and where to keep it.
Model version
A model has a version, such as TajweedFormer V4 4.0.0: the weights and what they recognise. Quran Lab can publish more than one build of the same version, for example one that adds a program for a phone's accelerator. A new build carries the same weights, so it is not a new version.
Your app gets the newest build of the released version that its SDK can read. Quran Lab chooses the build; the SDK never does. You can pin an app to a version: the app's page has a prompt for your coding assistant that does it. The SDK reports the version it runs, so the app's page can name it.
Every model file is listed in a manifest signed by Quran Lab. The SDK checks the signature, then each file's size and SHA-256, before it opens anything.
Response time
The model streams: it answers in chunks while the learner recites. The chunk length is the model's context, and it is the response time your learners feel.
| Context | Chunk | Use |
|---|---|---|
c8_l64 |
160 ms | The fastest response; CPU engine only |
c16_l64 |
320 ms | The default |
c24_l72 |
480 ms | The same left context at the larger chunk |
c24_l256 |
480 ms | The longest left context |
A session runs on the context your app's code names, else on the one chosen for the app on sdk.quranlab.ai, else on the model's default. Another context's files are small and are fetched on first use. Read the list of contexts from the loaded model, never from a fixed list.
Sharing
Learners can give the audio of their recitations to Quran Lab, to help the open recitation models listen better. There is nothing to switch on in your app: Quran Lab decides per app and platform whether learners are asked, the SDK asks them, nothing is recorded before a yes, and you never see the recordings. Recording sharing has the whole of it.
Downloads
An SDK downloads only the files its device uses. Every file of the model folder is tagged in the signed manifest with its platforms, chip, context and role, and a file outside the device's profile is never downloaded or opened. TajweedFormer V4 at the default context c16_l64, sizes over the network (on disk after unpacking in brackets):
| Device | Downloads | What |
|---|---|---|
| Android, any phone | 56.5 MB (73.5 MB), before the first session | The CPU set: tokens, calibration, the int8 weights that every context shares, the front end, the c16_l64 graph and its frame tensors |
| Android with an NPU | Exynos 2500 +61.5 MB, Exynos 2600 +61.7 MB; Tensor G3 +120.8, G4 +120.8, G5 +121.0 MB, later | Only that chip's NPU program for the default context, fetched lazily on Wi-Fi after the CPU path passed its self-test |
| Apple, iOS and macOS | 56.5 MB (73.5 MB), before the first session | The same CPU set as Android; the exact CPU engine runs every context |
| Web (WASM), browsers and Node | 56.5 MB (73.5 MB) | The same CPU set as Android |
| Native, Windows and Linux | 58.9 MB (77.2 MB); 61.2 MB with the ONNX Runtime graphs | The CPU set for all four contexts; the ONNX Runtime graphs (+0.59 MB per context) only for the server tier |
| Another context, later | c8_l64 +0.65 MB, c24_l72 +0.85 MB, c24_l256 +0.86 MB |
Its graph and frame tensors; the weights are shared |
Big files are stored gzip. Each file is downloaded with HTTP range requests into a partial file, so an interrupted download resumes where it stopped. Its size and SHA-256 are checked against the signed manifest, then it is unpacked and the unpacked file is checked again; only the unpacked file is kept. Any mismatch deletes both and the file is fetched again.
The CPU engine is always there. An accelerator program downloads only after the CPU path works on the device; if it fails to load or to pass its self-test, the SDK stays on the CPU, which gives the same result bit for bit.
The first run needs a connection. After one download every start works offline.
Analytics and privacy
The SDK sends daily sums and histograms, never audio, text or identifiers, and sdk.quranlab.ai hides any group under 10 installs. Privacy lists every field and what to declare in the App Store and Google Play forms.