Ministry of IT Launches 'Qalam-AI': Pakistan's Sovereign Urdu Large Language Model and Developer API Grid

Pakistan's Ministry of IT and Telecom, in partnership with IGNITE and premier research universities, launches Qalam-AI: a 70B parameter open-weights sovereign language model optimized for Urdu and regional dialects, supported by local datacenter clusters and low-latency enterprise APIs.

Ministry of IT Launches 'Qalam-AI': Pakistan's Sovereign Urdu Large Language Model and Developer API Grid

In a transformative milestone for national technological autonomy, the Ministry of Information Technology and Telecommunication (MoITT), in direct collaboration with the Ignite National Technology Fund and a consortium of premier research institutions including NUST, LUMS, FAST-NUCES, and ITU, has officially unveiled Qalam-AI.

Qalam-AI represents Pakistan’s first state-backed, open-weights sovereign foundation model—a 70-billion-parameter large language model (LLM) built from the ground up to excel in Nastaliq Urdu syntax, formal Pakistani legal jurisprudence, public sector civic records, vernacular fintech frameworks, and regional languages including Punjabi, Sindhi, Pashto, Balochi, and Saraiki.

Alongside the weights release, the Ministry announced the commissioning of the National AI Developer API Grid, an enterprise-grade inference network deployed entirely across domestic Tier-3 datacenter clusters in Islamabad and Lahore. The grid provides government agencies, regulated financial institutions, healthcare providers, and local software houses with compliant, low-latency, and cost-effective machine intelligence hosted entirely within national borders.

Ministry of IT Launches Qalam-AI: Pakistan’s Sovereign Urdu Large Language Model


1. The Strategic Imperative: Sovereign AI vs. Foreign Cloud Dependency

Over the past four years, Pakistani commercial enterprises and public sector institutions integrating generative artificial intelligence faced structural friction caused by reliance on foreign proprietary APIs such as OpenAI GPT-4, Anthropic Claude, and Google Gemini:

  1. Foreign Exchange Drain: Metered API usage denominated in US Dollars subjected domestic software companies and startups to volatile foreign exchange fluctuations and high import taxation, creating an ongoing drain on national foreign reserves.
  2. Subsea Cable Latency: API requests routed across transatlantic or Middle Eastern cloud regions incurred Round-Trip Times (RTT) averaging 140ms to 240ms, rendering real-time voice bots, conversational banking, and automated customer workflows sluggish.
  3. Severe Tokenization Inefficiency: Mainstream Western tokenizers allocate multiple byte tokens per Urdu character due to English-centric Byte-Pair Encoding (BPE) vocabularies. A standard 100-word sentence in Urdu frequently translates to 450 to 520 tokens on foreign models, effectively tripling or quadrupling inferencing invoices for local organizations.
  4. Data Residency and Statutory Non-Compliance: Regulated financial institutions under the State Bank of Pakistan (SBP) and listed corporations under the Securities and Exchange Commission of Pakistan (SECP) face stringent data localization mandates. Sending proprietary citizen databases, tax records, or banking histories to offshore hyperscalers violates Section 14 of the National Cyber Security Policy and SBP Cloud Framework guidelines.

Qalam-AI directly solves these systemic challenges by establishing a localized, self-reliant foundation model stack governed under national jurisdiction.


2. Technical Architecture and Tokenizer Engineering

Qalam-AI is engineered upon an optimized decoder-only dense transformer architecture, scaling to 70 billion parameters across 80 transformer layers, with an attention head dimension of 128 and 64 query heads paired with 8 key-value heads using Grouped Query Attention (GQA).

+-----------------------------------------------------------------------------------+
|                           QALAM-AI 70B CORE ARCHITECTURE                          |
+-----------------------------------------------------------------------------------+
|  Parameters: 70 Billion Dense Transformer        |  Layers: 80                    |
|  Hidden Dimension: 8,192                         |  GQA: 64 Query / 8 KV Heads    |
|  Rotary Position Embeddings (RoPE): 32,768 Context|  Activation: SwiGLU           |
+-----------------------------------------------------------------------------------+
                                         |
                                         v
+-----------------------------------------------------------------------------------+
|                    BILINGUAL URDU-CENTRIC BPE TOKENIZER                           |
+-----------------------------------------------------------------------------------+
|  Vocabulary Size: 128,000 Tokens                 |  Urdu Sub-word Merge Rules     |
|  Nastaliq Ligature Preservation                  |  Diacritic (Aerab) Normalizer  |
|  Urdu Compression Ratio: 1.18 Tokens/Word (vs 4.85 Tokens/Word on Foreign Models) |
+-----------------------------------------------------------------------------------+

Specialized Nastaliq Tokenizer

Foreign models exhibit severe token fragmentation when processing Nastaliq scripts and Perso-Arabic unicode blocks. The MoITT research team constructed a custom 128,000-vocabulary BPE tokenizer specifically trained on raw Pakistani corpora.

  • Token Compression Ratio: Reduced from 4.85 tokens per Urdu word on standard GPT tokenizers down to 1.18 tokens per word on Qalam-AI.
  • Diacritic and Zero-Width Non-Joiner Handling: Native preprocessing rules normalize diacritics (Aerab) and script formatting variants without generating redundant token artifacts.
  • Cross-Lingual Dialect Mapping: Integrated token representations for regional languages written in modified Shahmukhi, Nastaliq, and Perso-Arabic scripts, capturing phonetic nuances in Punjabi, Sindhi, and Pashto.

Model Hyperparameters

Metric Specification Engineering Purpose
Total Parameters 70.4 Billion Optimal balance between reasoning capacity and inferencing cost
Context Window 32,768 Tokens (Extended via RoPE) Multi-page legal judgment analysis, parliamentary records, and code
Attention Mechanism Grouped Query Attention (GQA) Reduces KV-cache memory footprint by 75% during high-concurrency serving
Feed-Forward Network SwiGLU (Intermediate Dim: 28,672) Enhanced parameter efficiency and factual representation retention
Normalization RMSNorm with Epsilon 1e-5 Numerical stability during multi-node FP8 and BF16 pre-training phases

3. Training Corpora, Curation, and Alignment Pipeline

Pre-training Qalam-AI involved ingesting over 2.4 trillion high-quality tokens spanning academic, cultural, legal, and institutional repositories collected over a two-year data-gathering campaign supported by Ignite and provincial education departments.

+-----------------------------------------------------------------------------+
|                     PRE-TRAINING DATA COMPOSITION (2.4T TOKENS)             |
+-----------------------------------------------------------------------------+
|  Urdu Literature, News, and Historical Corpora     : 38% (912 Billion Tokens)|
|  English Science, Technology, and Code             : 32% (768 Billion Tokens)|
|  Pakistan Legal, Regulatory, and Tax Archives      : 14% (336 Billion Tokens)|
|  Regional Languages (Punjabi, Sindhi, Pashto)      : 10% (240 Billion Tokens)|
|  Fintech, Banking, and Civic Government Records    :  6% (144 Billion Tokens)|
+-----------------------------------------------------------------------------+

Domain-Specific Corpora Ingestion

  • Pakistan Code & Case Law: Ingested verified judgments from the Supreme Court of Pakistan, provincial High Courts, and federal statutory acts from 1947 to 2026, creating native fluency in Pakistani constitutional and civil law.
  • Fintech & Banking Terminology: Curated datasets spanning State Bank of Pakistan (SBP) prudential regulations, Raast instant payment technical specs, 1Link settlement protocols, and localized microfinance terminology.
  • Civic Records & e-Governance: Administrative manuals, National Database and Registration Authority (NADRA) public documentation structures, and land revenue management taxonomies.

Alignment, SFT, and DPO

Following pre-training, the model underwent extensive Supervised Fine-Tuning (SFT) on 450,000 multi-turn instruction pairs formulated by university linguists and legal scholars.

To ensure safety and cultural resonance, the consortium implemented Direct Preference Optimization (DPO) using a regionally curated human-feedback dataset. This alignment ensures Qalam-AI respects national ethical frameworks, avoids sectarian bias, rejects financial fraud vectors, and provides helpful, objective civic assistance.


4. Hardware Infrastructure and Domestic Compute Cluster

Pre-training and continuous checkpoint validation were executed at the National AI GPU Computing facility hosted in Tier-3 datacenter facilities in Islamabad and Lahore.

For enterprises requiring private AI model hosting, deep learning fine-tuning pipelines, and sovereign data repositories with raw physical hardware isolation, bare-metal infrastructure can be provisioned on high-throughput Dedicated Servers and localized Dedicated Servers in Pakistan.

Compute Specifications

  • GPU Acceleration: High-density pods of NVIDIA H100 and H200 SXM5 accelerators equipped with 80GB and 141GB HBM3e memory.
  • Interconnect Topology: 800Gbps NVIDIA Quantum-2 InfiniBand non-blocking fat-tree network topology, enabling sub-microsecond synchronization during Megatron-LM tensor and pipeline parallelism.
  • Storage Subsystem: High-speed NVMe-over-Fabrics (NVMe-oF) storage tier providing over 2.5 Petabytes of scratch space with sustained 150 GB/s sequential read performance for checkpointing.
  • Energy and Cooling: Tier-3 certified facility with dual uninterrupted power supply (UPS) trains, N+1 diesel generator redundancy, and precision liquid-to-air cooling loops.

5. Developer Inference API Grid and Integration Protocols

To ensure rapid industrial and startup adoption, the MoITT launched the National Developer API Grid. The grid provides OpenAI-compatible REST endpoints, enabling developers to replace proprietary foreign endpoints by simply altering their base_url configuration.

# Example cURL request against Pakistan's Sovereign Developer API Grid
curl https://api.qalam.gov.pk/v1/chat/completions \
  -H "Authorization: Bearer $QALAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qalam-70b-instruct",
    "messages": [
      {
        "role": "system",
        "content": "آپ قانونی اور مالیاتی معاملات کے ماہر معاون ہیں۔"
      },
      {
        "role": "user",
        "content": "اسٹیٹ بینک آف پاکستان کے ڈیجیٹل بینکنگ فریم ورک کے بنیادی تقاضے کیا ہیں؟"
      }
    ],
    "temperature": 0.2,
    "max_tokens": 1024
  }'

Python SDK Integration

from openai import OpenAI

# Connect directly to Pakistan's domestic inference cluster
client = OpenAI(
    api_key="YOUR_DOMESTIC_API_KEY",
    base_url="https://api.qalam.gov.pk/v1"
)

response = client.chat.completions.create(
    model="qalam-70b-instruct",
    messages=[
        {"role": "system", "content": "You are a specialized legal assistant for Pakistani commercial contracts."},
        {"role": "user", "content": "SECP کے تحت ایک پرائیویٹ لمیٹڈ کمپنی کے سالانہ آڈٹ کے لازمی قوانین کا خلاصہ بیان کریں۔"}
    ],
    temperature=0.3,
    max_tokens=800
)

print(response.choices[0].message.content)

Performance Benchmarks and Latency Comparison

Domestic inference serving relies on vLLM and TensorRT-LLM engines utilizing PagedAttention and continuous batching. Peered directly at the Pakistan Internet Exchange (PKIX) with low-latency links across PTCL, Transworld, Nayatel, and cellular core backbones, Qalam-AI delivers remarkable responsiveness compared to offshore alternatives:

Metric Foreign Proprietary LLMs (US/EU) Regional Hosted LLMs (Gulf/SG) Qalam-AI (Domestic PKIX Grid)
Network Ping (RTT) 160ms - 240ms 65ms - 95ms 8ms - 22ms
Time to First Token (TTFT) 850ms - 1,400ms 420ms - 680ms 110ms - 190ms
Tokens Per Word (Urdu) 4.85 Tokens/Word 4.20 Tokens/Word 1.18 Tokens/Word
Inference Cost (Normalized PKR) 100% (High FX Exposure) 70% 18% (Subsidized via PKR Billing)
Data Residency Compliance Non-Compliant (SECP/SBP Risk) Non-Compliant 100% Fully Sovereign & Compliant

6. Enterprise Regulatory Compliance: SECP and SBP Alignment

For commercial banks, microfinance institutions, telecommunications carriers, and fintech startups, adopting generative AI previously posed insurmountable compliance roadblocks.

Qalam-AI’s deployment architecture satisfies all key regulatory frameworks:

  • State Bank of Pakistan (SBP) BPRD Circulars: Conforms to domestic storage mandates for Customer Personally Identifiable Information (PII) and core transactional records.
  • SECP Data Protection Directives: Satisfies stringent governance controls requiring audit trails, cryptographic key custody within Pakistan, and uncompromised regulatory inspection access.
  • Air-Gapped Deployment Packages: In addition to the public cloud API grid, MoITT provides Docker containers, Helm charts, and quantized GGUF/AWQ model weights for on-premises bare-metal installation in private institutional datacenters.

7. Open-Weights Availability and the Roadmap Ahead

To stimulate grassroots deep-tech development across Pakistan’s vibrant software ecosystem, MoITT confirmed that base model checkpoints and instruction-tuned variants will be released under an open permissive license for non-commercial research, with tiered commercial licenses for corporate enterprises.

Planned developments over the next twelve months include:

  1. Multimodal Vision Extensions (Qalam-Vision): Real-time optical character recognition (OCR) for complex Urdu calligraphic scripts, handwritten land titles, and CNIC identification cards.
  2. Edge Quantized Models (Qalam-Small): 3B and 8B parameter distilled checkpoints optimized for edge IoT devices, smart agriculture sensor gateways, and offline smartphones.
  3. Voice Translation Gateways: End-to-end speech-to-speech models facilitating conversational civic interfaces across all four provincial languages.

Organizations scaling distributed computational workloads and mission-critical cloud backbones can explore our technical engineering publications:


SOVEREIGN AI & COMPUTE INFRASTRUCTURE

Deploy Dedicated AI & Enterprise Infrastructure with Nextgen

Accelerate your deep learning models and enterprise applications with bare-metal dedicated servers, high-speed NVMe storage, and sub-10ms domestic latency across Pakistan.