""" Project Norn V18: Quickstart Inference Demonstration Osakra Research — 9B Frontier Neuro-Symbolic Intelligence Powered by Qwen3.8-9B-Distill Backbone """ import os import sys import json import time import urllib.request OLLAMA_API = "http://localhost:11434/api/generate" MODEL_NAME = "norn-v18" def test_inference(query: str, title: str): print("\n" + "=" * 70) print(f" {title}") print("=" * 70) print(f"[Prompt]: {query}\n") payload = { "model": MODEL_NAME, "prompt": query, "stream": False, "options": { "num_ctx": 8192, "temperature": 0.2, "top_p": 0.95, "repeat_penalty": 1.15 } } t0 = time.time() req = urllib.request.Request( OLLAMA_API, data=json.dumps(payload).encode("utf-8"), headers={"Content-Type": "application/json"} ) with urllib.request.urlopen(req) as res: data = json.loads(res.read().decode("utf-8")) dt = time.time() - t0 resp = data.get("response", "").strip() print(f"[Norn V18 Response ({dt:.2f}s)]:\n{resp}\n") def run_demos(): print("=" * 80) print(" PROJECT NORN V18: INFERENCE DEMONSTRATION") print("=" * 80) # Demo 1: Formal Logic & Self-Awareness test_inference( "Introduce yourself, explain your 9B architecture, and describe your 1024-d Relational HRR memory.", "DEMO 1: Self-Identity & Architecture Verification" ) # Demo 2: Mathematical Deduction & Constraint Traps test_inference( "Tank A and Tank B start empty. Pump 1 fills Tank A at 4 L/min. Pump 2 fills Tank B at 6 L/min. " "Tank A has a hole that leaks 1 L/min once it reaches 20 L. Tank B has no leak. At time t = 0, " "both pumps are turned on. For what positive time t (in minutes, t > 0) is Tank B's volume exactly " "twice Tank A's volume? Explain clearly.", "DEMO 2: Mathematical Equation & Constraint Trap" ) # Demo 3: Negative Constraints & Discipline test_inference( "List exactly 5 European capital cities. Rule 1: Do NOT include any city whose English name " "contains the letters 'a' or 'e'. Rule 2: Provide the list as a numbered list with country name in parentheses. " "Rule 3: Output ONLY the list with no preamble or intro.", "DEMO 3: Strict Negative Constraint Following" ) print("=" * 80) print(" Demonstration completed successfully!") print("=" * 80) if __name__ == "__main__": run_demos()