← Back to Pak-LLM Coder
•Sovereign SDK v1.2.0Sovereign CodeAct & Multi-Turn Agent Loops

Pak-LLM Sovereign Coder SDK

Programmatically lease autonomous AI coding agents, stream AST-safe code, and integrate sovereign pair-programming intelligence into your TypeScript, Node.js, and Python microservices.

npminstall https://coder.pak-llm.com/downloads/packages/pak-llm-sdk-1.2.0.tgz
pipinstall https://coder.pak-llm.com/downloads/packages/pakllm_coder-1.2.0-py3-none-any.whl
SDK Account Quota & Rate LimitsFreelancer Pro Plan
Tokens Remaining
14,750,000
2% consumed
Monthly Capacity
15,000,000
Next cycle refill
Emergency Daily Tranche
+500,000
Formula: Quota ÷ 30
Limits & Fleet
60 req/min
4 parallel agents
💡
How to Run: Save the snippet below into a file named agent.ts and execute with npx tsx agent.ts.
⚠️ PowerShell Prompt Notice: Do not paste raw multi-line import { Agent } statements directly into your PowerShell terminal prompt (causes ParserError).
Direct terminal 1-liner test:
node -e "const s=require('@pak-llm/sdk');console.log('SDK Ready!')"
// 1. Install via terminal:
// npm install https://coder.pak-llm.com/downloads/packages/pak-llm-sdk-1.2.0.tgz
//
// 2. Save this file as 'agent.ts' and run:
// npx tsx agent.ts (or compile with tsc && node agent.js)
// Note: Do not paste raw import code directly into PowerShell prompt.

import { Agent, LocalAgentConfig, CapabilitiesConfig, extractMultilingualOcr } from '@pak-llm/sdk';

async function main() {
  const config: LocalAgentConfig = {
    system_instructions: 'You are an autonomous senior software engineer.',
    capabilities: {
      allowBashExecution: true,
      allowFileWrite: true,
      sandboxMode: 'isolated',
      humanApprovalRequired: true,
    },
  };

  // Sovereign autonomous agent lifecycle with multi-lingual OCR
  await Agent.run(config, async (agent) => {
    // Optional: Extract multi-lingual OCR from an image / wireframe (Urdu, English, Arabic)
    // const ocr = await extractMultilingualOcr('./design_mockup.png');
    // console.log("[OCR Extracted]: " + ocr.text + " (Lang: " + ocr.detectedLanguage + ")");

    const stream = await agent.chat('Refactor auth middleware to verify HMAC tokens.');

    // Stream reasoning thoughts
    for await (const thought of stream.thoughts()) {
      console.log("[Thinking] " + thought);
    }

    // Stream generated code tokens
    for await (const token of stream) {
      process.stdout.write(token);
    }

    // ── Antigravity Autonomous Workflow ─────────────────────────────
    // 1. Research requirements & generate 5-10 clarification questions
    const { questions } = await agent.clarify('Build responsive full-stack analytics dashboard');
    console.log("[Antigravity Research]: " + questions.length + " questions generated");

    // 2. Synthesize structured implementation plan
    const plan = await agent.plan({ answers: { q1_arch: 'Next.js 15 App Router', q2_ui: 'Tailwind CSS (White Canvas #FFFFFF)' } });

    // 3. Enforce Human-in-the-Loop approval gate before execution
    if (plan.requiresApproval) {
      const execution = await agent.executePlan(plan.id);
      console.log("[Executed]: " + execution.filesCreated.length + " files synthesized");
    }

    // ── Workspace Diagnostics & Autonomous Error Resolution ─────────
    // Scan workspace files for AST syntax errors, broken imports, and secret leaks
    const problems = await agent.workspace.diagnose();
    console.log("[Diagnostics]: Found " + problems.length + " workspace problems");

    if (problems.length > 0) {
      // Formulate context-relevant clarifying questions before touching files
      const { questions: fixQuestions } = await agent.clarifyFix(problems);
      console.log("[Diagnostic Questions]: Formulated " + fixQuestions.length + " clarifying questions");

      // Synthesize repair plan with non-bypassable human approval gate
      const fixPlan = await agent.planFix(problems, { strategy: 'synthesize_stubs' });
      if (fixPlan.requiresApproval) {
        const repairResult = await agent.executePlan(fixPlan.id);
        console.log("[Repairs Executed]: " + repairResult.filesPatched + " files fixed, 0 errors remaining.");
      }
    }
  });
}

main();

Live In-Browser SDK Playground

Test SDK methods against the sovereign runtime directly in your browser. Tokens are metered in real-time.

Default White Canvas (#FFFFFF)
SDK Sovereign Web Preview • Default White Canvas (#FFFFFF)
Default White Canvas (#FFFFFF)
SDK Terminal Output
// Live execution trace and SDK stream will output here. Type terminal commands below (e.g. npm i axios, pip install fastapi, pak-coder doctor).
$
0% Riba Domestic Rails • Swich Payment Gateway

SDK Pricing Packages & Boost Top-Ups

Identical sovereign pricing tiers apply to the SDK. Metered with automated 50%, 75%, 90%, and 100% exhaustion alerts.

View Full Packages Matrix

Awam / Free

Community
PKR 0 / month
250,000 SDK monthly tokens
  • 1 Active SDK API Key
  • 15 Requests / min rate limit
  • 1 Concurrent autonomous loop
  • Emergency Tranche: +8,333 tokens
Most Popular

Freelancer Pro

Production
PKR 1,850 / month
15,000,000 SDK monthly tokens
  • 5 Active SDK API Keys
  • 60 Requests / min rate limit
  • 4 Concurrent autonomous loops
  • Emergency Tranche: +500,000 tokens

Agency Enterprise

Enterprise
PKR 6,500 / month
60,000,000 SDK monthly tokens
  • 25 Active SDK API Keys
  • 240 Requests / min rate limit
  • 16 Concurrent autonomous loops
  • Emergency Tranche: +2,000,000 tokens
Instant SDK Token Boost Packs (Never Expire)
Direct Swich checkout in PKR with 0% Riba
Sprint Boost (5M Tokens)
Rs. 700
+5M Tokens
Pro Scale (15M Tokens)
Rs. 1,950
+15M Tokens
Studio Fortress (50M Tokens)
Rs. 5,800
+50M Tokens

Sovereign Autonomous Agent Pattern

Programmatic leasing through async context managers with real-time thought streams, tool execution dispatchers, and stateful CodeAct iteration loops.

Islamic Shariah Compliance

Prohibits Riba, gambling, fraud, and obscenity by design. Every prompt is verified by the Sovereign Security Sentinel with automated incident segregation.

Zero Remote Code Retention

In-flight AST secret redaction strips API tokens and passwords. User proprietary code is strictly never retained or utilized for upstream model training.

SEO • AEO • GEO Answer Engine Knowledge Base

Pak-LLM Coder SDK — Frequently Asked Questions

Essential information on programmatic integration, Islamic ethics, and telemetry.

The Pak-LLM Coder SDK (@pak-llm/sdk for Node.js/TypeScript and pakllm-coder for Python) is a sovereign developer toolkit built on advanced autonomous agent loops. It enables programmatic leasing of autonomous software engineering agents, real-time thought/token streaming, AST safety validation, and automated CodeAct tool execution within your pipelines.

Category: Architecture
Sovereign SDK — Autonomous Agent APIs & Live Playground | Pak-LLM Coder