[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70J9MH8YXRZDHC7NHGCR6X1":3,"skill-same:01M70J9MH8YXRZDHC7NHGCR6X1":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":6,"ownerHtmlUrl":64,"ownerBlogUrl":6,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M70J9MH8YXRZDHC7NHGCR6X1","laya-remote-api",null,"Comprehensive guide and operational reference for connecting to and querying the remote Laya System 1 Decision Engine API over Tailscale or local network.","mdnaimul22\u002Fhuman-skills","mdnaimul22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F64520358?v=4","01M70FH95MH2H796Q01TYSFZ03","Naimul","01M70FH96798CQR4YHA13F17GA",3,"MIT","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fmy_skills\u002Flaya-system-one\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"api","laya remote api","remote","curl","remote-inference","laya","system-one","tailscale","network","decision","inference","reference","golang","engine","python","system","for","guide","team","local","2026-11-10 10:12:30",false,"---\nname: \"laya-remote-api\"\ndescription: \"Comprehensive guide and operational reference for connecting to and querying the remote Laya System 1 Decision Engine API over Tailscale or local network.\"\nversion: \"1.0.0\"\nauthor: \"Laya Engine Team\"\ntags: [\"laya\", \"api\", \"system-one\", \"decision-engine\", \"tailscale\", \"remote-inference\", \"curl\", \"python\", \"nodejs\", \"golang\"]\n---\n\n# Laya Decision Engine — Remote API Integration Guide\n\nThis skill document defines the configuration, network endpoints, authentication, payload schemas, and client implementations for querying the remote **Laya System 1 Decision Engine** from external servers, microservices, and scripts.\n\n---\n\n## 1. Connection & Authentication Credentials\n\n| Parameter | Configuration \u002F Value | Description |\n| :--- | :--- | :--- |\n| **Public HTTPS URL (Tailscale Funnel)** | `https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020` | Accessible from any external server on the internet via SSL\u002FTLS |\n| **Private Tailnet URL** | `http:\u002F\u002F100.80.50.87:8020` | Direct encrypted access within the Tailscale mesh network |\n| **Local Host** | `http:\u002F\u002F127.0.0.1:8020` | In-process \u002F loopback host on the GPU machine |\n| **Default API Key** | `example-api-key` | Permanent secret configured in `examples\u002Fserver.py` and `laya.service` |\n| **Auth Header Format** | `Authorization: Bearer \u003CAPI_KEY>` | Primary authentication header |\n| **Alternative Header** | `X-API-Key: \u003CAPI_KEY>` | Supported alternative header |\n| **Query Parameter** | `?api_key=\u003CAPI_KEY>` | Useful for web browsers and quick testing |\n\n> **Security Note:** All endpoints except `\u002Fhealth` enforce constant-time HMAC bearer authentication. Requests lacking valid credentials immediately return `HTTP 401 Unauthorized`.\n\n---\n\n## 2. Model Selection Guide (`model` field)\n\nLaya provides three distinct fine-tuned checkpoints. Specify the `\"model\"` parameter in your request body to select the optimal neural checkpoint, or omit it for intelligent auto-routing:\n\n| Model ID | Base Architecture | Context Window | Best Suited For | Typical Latency | Recommended Use |\n| :--- | :--- | :--- | :--- | :--- | :--- |\n| **`\"typed-decisions\"`** | ModernBERT-large (421M) | 1,024 tokens | **Coding tasks, bug triage, architectural decisions, DSA, concurrency data race analysis** | ~63 ms (GPU) | ⭐️ **Primary Choice for Technical \u002F Agent Decisions** |\n| **`\"multilingual\"`** | mmBERT-base (322M) | Up to 8,192 tokens | **Bengali and 100+ languages**, customer support triage, sentiment, ticket classification | ~55 ms (GPU) | 🌐 **Primary Choice for Bengali \u002F Multilingual Triage** |\n| **`\"english\"`** | ModernBERT-large (421M) | 512 tokens | Fast standard English text classification and routing | ~64 ms (GPU) | Standard English NLP |\n\n### Why We Recommend `\"model\": \"typed-decisions\"` for Code & Engineering Tasks:\nIn empirical problem-solving benchmarks (covering DSA algorithmic optimization, Go concurrency data races, Python RCE AppSec, distributed Redis caching, and Linux file descriptor leaks), **`typed-decisions` achieved the highest score (68.6\u002F100, 75% accuracy)**. It is specifically trained on typed decision heads (`choice`, `score`, `noul`) with strict logical reasoning. \n\n> [!TIP]\n> **Best Practice:** When integrating with AI agents, IDE assistants, code review bots, or backend microservices, **always explicitly pass `\"model\": \"typed-decisions\"`** in the JSON request body.\n\n### Default Auto-Routing Behavior (When `model` is omitted):\nIf the caller does not specify `\"model\"`:\n- **Bengali \u002F Non-Latin text:** Automatically routed to **`\"multilingual\"`** via character script heuristic.\n- **English Latin text:** Automatically routed to **`\"english\"`**.\n- **Indeterminate \u002F Numbers \u002F Code snippets without letters:** Routed to **`LAYA_DEFAULT_MODEL`** (configured as `\"english\"`).\n\n### Understanding the Response Schema (`\"model\"` vs `\"routing\"`):\nIn the API response JSON:\n- The top-level `\"model\": \"laya-rl-agent\"` is the **engine runtime identifier** (Laya RL Agent framework).\n- The actual neural checkpoint that executed the inference is always recorded in **`routing.model`**:\n```json\n{\n  \"model\": \"laya-rl-agent\",\n  \"answers\": { ... },\n  \"routing\": {\n    \"model\": \"typed-decisions\",\n    \"repo\": \"convaiinnovations\u002Flaya\u002Ftyped-decisions\",\n    \"reason\": \"explicit model='typed-decisions'\"\n  }\n}\n```\n\n---\n\n## 3. Supported API Endpoints\n\n### `POST \u002Fpredict`\nThe primary decision endpoint. Evaluates typed questions (`choice`, `score`, `noul`) over any state document in a single forward pass.\n\n### `POST \u002Fpredict\u002Fbatch`\nBatch inference for multiple records in parallel (supports up to 64 records per batch).\n\n### `POST \u002Fv1\u002Fsystemone`\nTypeSafe Jev wire protocol compatible endpoint (for `git-jev`, `hs-jev`, or Jev client SDKs).\n\n### `GET \u002Fhealth`\nReturns runtime status, loaded checkpoints, and hardware accelerator status (Public, no auth required).\n\n### `GET \u002F`\nVisual interactive Web GUI (presents an unlock screen requiring the API Key, setting a persistent browser cookie).\n\n---\n\n## 4. Question Types Schema Reference\n\nLaya executes decisions through three strongly-typed question primitives:\n\n### 1. `choice`\nSelects the winning option from a discrete set with calibrated probabilities.\n```json\n\"department\": {\n  \"type\": \"choice\",\n  \"instructions\": \"Which department should handle this ticket?\",\n  \"criteria\": {\n    \"billing\": \"invoices, payment refunds, duplicate charges\",\n    \"technical\": \"crashes, bugs, database failures, errors\",\n    \"sales\": \"upgrades, new contracts\"\n  }\n}\n```\n\n### 2. `score`\nEvaluates an ordered or numerical assessment across calibrated thresholds.\n```json\n\"urgency\": {\n  \"type\": \"score\",\n  \"instructions\": \"Assess the urgency and operational severity\",\n  \"criteria\": [\n    \"low (routine inquiry)\",\n    \"medium (degraded service)\",\n    \"critical (production outage, data loss)\"\n  ]\n}\n```\n\n### 3. `noul`\nBinary decision yielding an exact, calibrated probability (0.0 to 1.0) whether the statement is true.\n```json\n\"is_outage\": {\n  \"type\": \"noul\",\n  \"instructions\": \"Is there an ongoing production outage or service interruption?\"\n}\n```\n\n---\n\n## 5. Client Implementations (Ready to Copy-Paste)\n\n### Python (using `requests` or `httpx`)\n\n```python\nimport requests\n\nAPI_URL = \"https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict\"\nAPI_KEY = \"example-api-key\"\n\nheaders = {\n    \"Authorization\": f\"Bearer {API_KEY}\",\n    \"Content-Type\": \"application\u002Fjson\"\n}\n\npayload = {\n    \"model\": \"typed-decisions\",\n    \"state\": \"Panic in goroutine: runtime error: nil pointer dereference at payment.go:142. Consul token expired.\",\n    \"questions\": {\n        \"root_cause\": {\n            \"type\": \"choice\",\n            \"instructions\": \"What caused this crash?\",\n            \"criteria\": {\n                \"token_expiry\": \"expired token in secrets\u002Fvault manager\",\n                \"network_drop\": \"external connectivity loss\",\n                \"disk_full\": \"filesystem full\"\n            }\n        },\n        \"severity\": {\n            \"type\": \"score\",\n            \"instructions\": \"Rate incident severity\",\n            \"criteria\": [\"low\", \"medium\", \"critical outage\"]\n        },\n        \"is_blocking\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Are payment transactions currently failing?\"\n        }\n    }\n}\n\nresponse = requests.post(API_URL, json=payload, headers=headers, timeout=10)\ndata = response.json()\n\nprint(\"Selected Choice :\", data[\"answers\"][\"root_cause\"][\"choice\"])\nprint(\"Choice Conf     :\", data[\"answers\"][\"root_cause\"][\"confidence\"])\nprint(\"Calculated Score:\", data[\"answers\"][\"severity\"][\"score\"])\nprint(\"Binary Prob     :\", data[\"answers\"][\"is_blocking\"][\"noul\"])\n```\n\n---\n\n### cURL \u002F Bash\n\n```bash\ncurl -X POST https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict \\\n  -H \"Authorization: Bearer example-api-key\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"multilingual\",\n    \"state\": \"আমার অ্যাকাউন্টে পেমেন্ট ফেইল হয়েছে কিন্তু ব্যাংক থেকে টাকা কেটে নিয়েছে। দয়া করে রিফান্ড দিন।\",\n    \"questions\": {\n      \"department\": {\n        \"type\": \"choice\",\n        \"instructions\": \"কোন ডিপার্টমেন্ট এই সমস্যার সমাধান করবে?\",\n        \"criteria\": {\n          \"billing\": \"পেমেন্ট, ইনভয়েস, রিফান্ড\",\n          \"technical\": \"সফটওয়্যার ক্র্যাশ, বাগ\"\n        }\n      },\n      \"refund_needed\": {\n        \"type\": \"noul\",\n        \"instructions\": \"গ্রাহক কি টাকা ফেরত বা রিফান্ড চাচ্ছেন?\"\n      }\n    }\n  }'\n```\n\n---\n\n### Node.js \u002F TypeScript (Native `fetch`)\n\n```typescript\nconst API_URL = \"https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict\";\nconst API_KEY = \"example-api-key\";\n\nasync function queryLayaDecision(stateText: string) {\n  const response = await fetch(API_URL, {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${API_KEY}`,\n      \"Content-Type\": \"application\u002Fjson\",\n    },\n    body: JSON.stringify({\n      model: \"typed-decisions\",\n      state: stateText,\n      questions: {\n        classification: {\n          type: \"choice\",\n          instructions: \"Classify incoming user message\",\n          criteria: {\n            bug_report: \"software defects and stack traces\",\n            feature_request: \"proposals for new capabilities\",\n            billing: \"account, payment, plans\"\n          }\n        },\n        risk_score: {\n          type: \"score\",\n          instructions: \"Rate account churn risk\",\n          criteria: [\"negligible\", \"moderate\", \"severe risk of leaving\"]\n        },\n        urgent_flag: {\n          type: \"noul\",\n          instructions: \"Does this require immediate human intervention?\"\n        }\n      }\n    })\n  });\n\n  if (!response.ok) {\n    throw new Error(`Laya API error: ${response.status} ${await response.text()}`);\n  }\n\n  const result = await response.json();\n  return result.answers;\n}\n```\n\n---\n\n### Go (`net\u002Fhttp`)\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding\u002Fjson\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\u002Fhttp\"\n\t\"time\"\n)\n\nconst (\n\tapiURL = \"https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict\"\n\tapiKey = \"example-api-key\"\n)\n\nfunc main() {\n\tpayload := map[string]interface{}{\n\t\t\"model\": \"typed-decisions\",\n\t\t\"state\": \"PostgreSQL database CPU at 98% during 20k req\u002Fsec peak read traffic.\",\n\t\t\"questions\": map[string]interface{}{\n\t\t\t\"architecture_fix\": map[string]interface{}{\n\t\t\t\t\"type\":         \"choice\",\n\t\t\t\t\"instructions\": \"Recommended remedy\",\n\t\t\t\t\"criteria\": map[string]string{\n\t\t\t\t\t\"redis_cache\":   \"deploy Redis cache-aside cluster\",\n\t\t\t\t\t\"reboot_server\": \"restart database blindly\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"is_read_heavy\": map[string]interface{}{\n\t\t\t\t\"type\":         \"noul\",\n\t\t\t\t\"instructions\": \"Is the bottleneck read-heavy?\",\n\t\t\t},\n\t\t},\n\t}\n\n\tbodyBytes, _ := json.Marshal(payload)\n\treq, _ := http.NewRequest(\"POST\", apiURL, bytes.NewBuffer(bodyBytes))\n\treq.Header.Set(\"Authorization\", \"Bearer \"+apiKey)\n\treq.Header.Set(\"Content-Type\", \"application\u002Fjson\")\n\n\tclient := &http.Client{Timeout: 10 * time.Second}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, _ := io.ReadAll(resp.Body)\n\tfmt.Printf(\"HTTP Status: %d\\nResponse: %s\\n\", resp.StatusCode, string(body))\n}\n```\n\n---\n\n## 6. Server Infrastructure & Management\n\nThe server runs locally as a persistent, supervised systemd unit on the host machine.\n\n### Service Commands:\n```bash\n# Check service status\nsudo systemctl status laya.service\n\n# View live stream logs\nsudo journalctl -u laya.service -f\n\n# Restart service\nsudo systemctl restart laya.service\n\n# Verify Tailscale Funnel status\ntailscale funnel status\n```\n\n### Server Configuration File:\nUnit file location: `\u002Fetc\u002Fsystemd\u002Fsystem\u002Flaya.service`  \nSource server code: `examples\u002Fserver.py`\n\n```ini\n[Unit]\nDescription=Laya Decision Engine Service (Port 8020)\nAfter=network.target tailscaled.service\nWants=tailscaled.service\n\n[Service]\nType=simple\nUser=naimul\nGroup=naimul\nWorkingDirectory=\u002Fhome\u002Fnaimul\u002Flaya\nEnvironment=\"PATH=\u002Fhome\u002Fnaimul\u002Fminiconda3\u002Fbin:\u002Fusr\u002Flocal\u002Fcuda\u002Fbin:\u002Fusr\u002Flocal\u002Fsbin:\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fsbin:\u002Fusr\u002Fbin\"\nEnvironment=\"LD_LIBRARY_PATH=\u002Fusr\u002Flocal\u002Fcuda\u002Flib64:\"\nEnvironment=\"PYTHONUNBUFFERED=1\"\nEnvironment=\"LAYA_HOST=127.0.0.1\"\nEnvironment=\"LAYA_PORT=8020\"\nEnvironment=\"LAYA_API_KEY=example-api-key\"\nEnvironment=\"LAYA_DEVICE=cuda\"\nEnvironment=\"LAYA_PRELOAD=1\"\nExecStart=\u002Fhome\u002Fnaimul\u002Fminiconda3\u002Fbin\u002Fpython \u002Fhome\u002Fnaimul\u002Flaya\u002Fexamples\u002Fserver.py --host 127.0.0.1 --port 8020\nRestart=always\nRestartSec=5s\nLimitNOFILE=65535\n\n[Install]\nWantedBy=multi-user.target\n```\n\n---\n\n## 7. Error Codes & Diagnostics\n\n| Status Code | Meaning | Cause & Recommended Fix |\n| :--- | :--- | :--- |\n| **`401 Unauthorized`** | Missing or Invalid Token | Ensure header `Authorization: Bearer example-api-key` is set. |\n| **`400 Bad Request`** | Malformed JSON | The request payload is not valid JSON or lacks the `questions` mapping. |\n| **`413 Payload Too Large`** | Limit Exceeded | Request body exceeds 2MB, state exceeds 50,000 characters, or questions exceed 64 items. |\n| **`422 Validation Error`** | Invalid Question Schema | `choice` or `score` questions submitted without required `criteria` block. |\n| **`500 Internal Error`** | Model Failure | CUDA memory exhaustion or uncaught runtime exception; check `journalctl -u laya.service`. |\n","# Laya Decision Engine — Remote API Integration Guide\n\nThis skill document defines the configuration, network endpoints, authentication, payload schemas, and client implementations for querying the remote **Laya System 1 Decision Engine** from external servers, microservices, and scripts.\n\n---\n\n## 1. Connection & Authentication Credentials\n\n| Parameter | Configuration \u002F Value | Description |\n| :--- | :--- | :--- |\n| **Public HTTPS URL (Tailscale Funnel)** | `https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020` | Accessible from any external server on the internet via SSL\u002FTLS |\n| **Private Tailnet URL** | `http:\u002F\u002F100.80.50.87:8020` | Direct encrypted access within the Tailscale mesh network |\n| **Local Host** | `http:\u002F\u002F127.0.0.1:8020` | In-process \u002F loopback host on the GPU machine |\n| **Default API Key** | `example-api-key` | Permanent secret configured in `examples\u002Fserver.py` and `laya.service` |\n| **Auth Header Format** | `Authorization: Bearer \u003CAPI_KEY>` | Primary authentication header |\n| **Alternative Header** | `X-API-Key: \u003CAPI_KEY>` | Supported alternative header |\n| **Query Parameter** | `?api_key=\u003CAPI_KEY>` | Useful for web browsers and quick testing |\n\n> **Security Note:** All endpoints except `\u002Fhealth` enforce constant-time HMAC bearer authentication. Requests lacking valid credentials immediately return `HTTP 401 Unauthorized`.\n\n---\n\n## 2. Model Selection Guide (`model` field)\n\nLaya provides three distinct fine-tuned checkpoints. Specify the `\"model\"` parameter in your request body to select the optimal neural checkpoint, or omit it for intelligent auto-routing:\n\n| Model ID | Base Architecture | Context Window | Best Suited For | Typical Latency | Recommended Use |\n| :--- | :--- | :--- | :--- | :--- | :--- |\n| **`\"typed-decisions\"`** | ModernBERT-large (421M) | 1,024 tokens | **Coding tasks, bug triage, architectural decisions, DSA, concurrency data race analysis** | ~63 ms (GPU) | ⭐️ **Primary Choice for Technical \u002F Agent Decisions** |\n| **`\"multilingual\"`** | mmBERT-base (322M) | Up to 8,192 tokens | **Bengali and 100+ languages**, customer support triage, sentiment, ticket classification | ~55 ms (GPU) | 🌐 **Primary Choice for Bengali \u002F Multilingual Triage** |\n| **`\"english\"`** | ModernBERT-large (421M) | 512 tokens | Fast standard English text classification and routing | ~64 ms (GPU) | Standard English NLP |\n\n### Why We Recommend `\"model\": \"typed-decisions\"` for Code & Engineering Tasks:\nIn empirical problem-solving benchmarks (covering DSA algorithmic optimization, Go concurrency data races, Python RCE AppSec, distributed Redis caching, and Linux file descriptor leaks), **`typed-decisions` achieved the highest score (68.6\u002F100, 75% accuracy)**. It is specifically trained on typed decision heads (`choice`, `score`, `noul`) with strict logical reasoning. \n\n> [!TIP]\n> **Best Practice:** When integrating with AI agents, IDE assistants, code review bots, or backend microservices, **always explicitly pass `\"model\": \"typed-decisions\"`** in the JSON request body.\n\n### Default Auto-Routing Behavior (When `model` is omitted):\nIf the caller does not specify `\"model\"`:\n- **Bengali \u002F Non-Latin text:** Automatically routed to **`\"multilingual\"`** via character script heuristic.\n- **English Latin text:** Automatically routed to **`\"english\"`**.\n- **Indeterminate \u002F Numbers \u002F Code snippets without letters:** Routed to **`LAYA_DEFAULT_MODEL`** (configured as `\"english\"`).\n\n### Understanding the Response Schema (`\"model\"` vs `\"routing\"`):\nIn the API response JSON:\n- The top-level `\"model\": \"laya-rl-agent\"` is the **engine runtime identifier** (Laya RL Agent framework).\n- The actual neural checkpoint that executed the inference is always recorded in **`routing.model`**:\n```json\n{\n  \"model\": \"laya-rl-agent\",\n  \"answers\": { ... },\n  \"routing\": {\n    \"model\": \"typed-decisions\",\n    \"repo\": \"convaiinnovations\u002Flaya\u002Ftyped-decisions\",\n    \"reason\": \"explicit model='typed-decisions'\"\n  }\n}\n```\n\n---\n\n## 3. Supported API Endpoints\n\n### `POST \u002Fpredict`\nThe primary decision endpoint. Evaluates typed questions (`choice`, `score`, `noul`) over any state document in a single forward pass.\n\n### `POST \u002Fpredict\u002Fbatch`\nBatch inference for multiple records in parallel (supports up to 64 records per batch).\n\n### `POST \u002Fv1\u002Fsystemone`\nTypeSafe Jev wire protocol compatible endpoint (for `git-jev`, `hs-jev`, or Jev client SDKs).\n\n### `GET \u002Fhealth`\nReturns runtime status, loaded checkpoints, and hardware accelerator status (Public, no auth required).\n\n### `GET \u002F`\nVisual interactive Web GUI (presents an unlock screen requiring the API Key, setting a persistent browser cookie).\n\n---\n\n## 4. Question Types Schema Reference\n\nLaya executes decisions through three strongly-typed question primitives:\n\n### 1. `choice`\nSelects the winning option from a discrete set with calibrated probabilities.\n```json\n\"department\": {\n  \"type\": \"choice\",\n  \"instructions\": \"Which department should handle this ticket?\",\n  \"criteria\": {\n    \"billing\": \"invoices, payment refunds, duplicate charges\",\n    \"technical\": \"crashes, bugs, database failures, errors\",\n    \"sales\": \"upgrades, new contracts\"\n  }\n}\n```\n\n### 2. `score`\nEvaluates an ordered or numerical assessment across calibrated thresholds.\n```json\n\"urgency\": {\n  \"type\": \"score\",\n  \"instructions\": \"Assess the urgency and operational severity\",\n  \"criteria\": [\n    \"low (routine inquiry)\",\n    \"medium (degraded service)\",\n    \"critical (production outage, data loss)\"\n  ]\n}\n```\n\n### 3. `noul`\nBinary decision yielding an exact, calibrated probability (0.0 to 1.0) whether the statement is true.\n```json\n\"is_outage\": {\n  \"type\": \"noul\",\n  \"instructions\": \"Is there an ongoing production outage or service interruption?\"\n}\n```\n\n---\n\n## 5. Client Implementations (Ready to Copy-Paste)\n\n### Python (using `requests` or `httpx`)\n\n```python\nimport requests\n\nAPI_URL = \"https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict\"\nAPI_KEY = \"example-api-key\"\n\nheaders = {\n    \"Authorization\": f\"Bearer {API_KEY}\",\n    \"Content-Type\": \"application\u002Fjson\"\n}\n\npayload = {\n    \"model\": \"typed-decisions\",\n    \"state\": \"Panic in goroutine: runtime error: nil pointer dereference at payment.go:142. Consul token expired.\",\n    \"questions\": {\n        \"root_cause\": {\n            \"type\": \"choice\",\n            \"instructions\": \"What caused this crash?\",\n            \"criteria\": {\n                \"token_expiry\": \"expired token in secrets\u002Fvault manager\",\n                \"network_drop\": \"external connectivity loss\",\n                \"disk_full\": \"filesystem full\"\n            }\n        },\n        \"severity\": {\n            \"type\": \"score\",\n            \"instructions\": \"Rate incident severity\",\n            \"criteria\": [\"low\", \"medium\", \"critical outage\"]\n        },\n        \"is_blocking\": {\n            \"type\": \"noul\",\n            \"instructions\": \"Are payment transactions currently failing?\"\n        }\n    }\n}\n\nresponse = requests.post(API_URL, json=payload, headers=headers, timeout=10)\ndata = response.json()\n\nprint(\"Selected Choice :\", data[\"answers\"][\"root_cause\"][\"choice\"])\nprint(\"Choice Conf     :\", data[\"answers\"][\"root_cause\"][\"confidence\"])\nprint(\"Calculated Score:\", data[\"answers\"][\"severity\"][\"score\"])\nprint(\"Binary Prob     :\", data[\"answers\"][\"is_blocking\"][\"noul\"])\n```\n\n---\n\n### cURL \u002F Bash\n\n```bash\ncurl -X POST https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict \\\n  -H \"Authorization: Bearer example-api-key\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"multilingual\",\n    \"state\": \"আমার অ্যাকাউন্টে পেমেন্ট ফেইল হয়েছে কিন্তু ব্যাংক থেকে টাকা কেটে নিয়েছে। দয়া করে রিফান্ড দিন।\",\n    \"questions\": {\n      \"department\": {\n        \"type\": \"choice\",\n        \"instructions\": \"কোন ডিপার্টমেন্ট এই সমস্যার সমাধান করবে?\",\n        \"criteria\": {\n          \"billing\": \"পেমেন্ট, ইনভয়েস, রিফান্ড\",\n          \"technical\": \"সফটওয়্যার ক্র্যাশ, বাগ\"\n        }\n      },\n      \"refund_needed\": {\n        \"type\": \"noul\",\n        \"instructions\": \"গ্রাহক কি টাকা ফেরত বা রিফান্ড চাচ্ছেন?\"\n      }\n    }\n  }'\n```\n\n---\n\n### Node.js \u002F TypeScript (Native `fetch`)\n\n```typescript\nconst API_URL = \"https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict\";\nconst API_KEY = \"example-api-key\";\n\nasync function queryLayaDecision(stateText: string) {\n  const response = await fetch(API_URL, {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${API_KEY}`,\n      \"Content-Type\": \"application\u002Fjson\",\n    },\n    body: JSON.stringify({\n      model: \"typed-decisions\",\n      state: stateText,\n      questions: {\n        classification: {\n          type: \"choice\",\n          instructions: \"Classify incoming user message\",\n          criteria: {\n            bug_report: \"software defects and stack traces\",\n            feature_request: \"proposals for new capabilities\",\n            billing: \"account, payment, plans\"\n          }\n        },\n        risk_score: {\n          type: \"score\",\n          instructions: \"Rate account churn risk\",\n          criteria: [\"negligible\", \"moderate\", \"severe risk of leaving\"]\n        },\n        urgent_flag: {\n          type: \"noul\",\n          instructions: \"Does this require immediate human intervention?\"\n        }\n      }\n    })\n  });\n\n  if (!response.ok) {\n    throw new Error(`Laya API error: ${response.status} ${await response.text()}`);\n  }\n\n  const result = await response.json();\n  return result.answers;\n}\n```\n\n---\n\n### Go (`net\u002Fhttp`)\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding\u002Fjson\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\u002Fhttp\"\n\t\"time\"\n)\n\nconst (\n\tapiURL = \"https:\u002F\u002Fmomen-gpu.tail374b2b.ts.net:8020\u002Fpredict\"\n\tapiKey = \"example-api-key\"\n)\n\nfunc main() {\n\tpayload := map[string]interface{}{\n\t\t\"model\": \"typed-decisions\",\n\t\t\"state\": \"PostgreSQL database CPU at 98% during 20k req\u002Fsec peak read traffic.\",\n\t\t\"questions\": map[string]interface{}{\n\t\t\t\"architecture_fix\": map[string]interface{}{\n\t\t\t\t\"type\":         \"choice\",\n\t\t\t\t\"instructions\": \"Recommended remedy\",\n\t\t\t\t\"criteria\": map[string]string{\n\t\t\t\t\t\"redis_cache\":   \"deploy Redis cache-aside cluster\",\n\t\t\t\t\t\"reboot_server\": \"restart database blindly\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"is_read_heavy\": map[string]interface{}{\n\t\t\t\t\"type\":         \"noul\",\n\t\t\t\t\"instructions\": \"Is the bottleneck read-heavy?\",\n\t\t\t},\n\t\t},\n\t}\n\n\tbodyBytes, _ := json.Marshal(payload)\n\treq, _ := http.NewRequest(\"POST\", apiURL, bytes.NewBuffer(bodyBytes))\n\treq.Header.Set(\"Authorization\", \"Bearer \"+apiKey)\n\treq.Header.Set(\"Content-Type\", \"application\u002Fjson\")\n\n\tclient := &http.Client{Timeout: 10 * time.Second}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, _ := io.ReadAll(resp.Body)\n\tfmt.Printf(\"HTTP Status: %d\\nResponse: %s\\n\", resp.StatusCode, string(body))\n}\n```\n\n---\n\n## 6. Server Infrastructure & Management\n\nThe server runs locally as a persistent, supervised systemd unit on the host machine.\n\n### Service Commands:\n```bash\n# Check service status\nsudo systemctl status laya.service\n\n# View live stream logs\nsudo journalctl -u laya.service -f\n\n# Restart service\nsudo systemctl restart laya.service\n\n# Verify Tailscale Funnel status\ntailscale funnel status\n```\n\n### Server Configuration File:\nUnit file location: `\u002Fetc\u002Fsystemd\u002Fsystem\u002Flaya.service`  \nSource server code: `examples\u002Fserver.py`\n\n```ini\n[Unit]\nDescription=Laya Decision Engine Service (Port 8020)\nAfter=network.target tailscaled.service\nWants=tailscaled.service\n\n[Service]\nType=simple\nUser=naimul\nGroup=naimul\nWorkingDirectory=\u002Fhome\u002Fnaimul\u002Flaya\nEnvironment=\"PATH=\u002Fhome\u002Fnaimul\u002Fminiconda3\u002Fbin:\u002Fusr\u002Flocal\u002Fcuda\u002Fbin:\u002Fusr\u002Flocal\u002Fsbin:\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fsbin:\u002Fusr\u002Fbin\"\nEnvironment=\"LD_LIBRARY_PATH=\u002Fusr\u002Flocal\u002Fcuda\u002Flib64:\"\nEnvironment=\"PYTHONUNBUFFERED=1\"\nEnvironment=\"LAYA_HOST=127.0.0.1\"\nEnvironment=\"LAYA_PORT=8020\"\nEnvironment=\"LAYA_API_KEY=example-api-key\"\nEnvironment=\"LAYA_DEVICE=cuda\"\nEnvironment=\"LAYA_PRELOAD=1\"\nExecStart=\u002Fhome\u002Fnaimul\u002Fminiconda3\u002Fbin\u002Fpython \u002Fhome\u002Fnaimul\u002Flaya\u002Fexamples\u002Fserver.py --host 127.0.0.1 --port 8020\nRestart=always\nRestartSec=5s\nLimitNOFILE=65535\n\n[Install]\nWantedBy=multi-user.target\n```\n\n---\n\n## 7. Error Codes & Diagnostics\n\n| Status Code | Meaning | Cause & Recommended Fix |\n| :--- | :--- | :--- |\n| **`401 Unauthorized`** | Missing or Invalid Token | Ensure header `Authorization: Bearer example-api-key` is set. |\n| **`400 Bad Request`** | Malformed JSON | The request payload is not valid JSON or lacks the `questions` mapping. |\n| **`413 Payload Too Large`** | Limit Exceeded | Request body exceeds 2MB, state exceeds 50,000 characters, or questions exceed 64 items. |\n| **`422 Validation Error`** | Invalid Question Schema | `choice` or `score` questions submitted without required `criteria` block. |\n| **`500 Internal Error`** | Model Failure | CUDA memory exhaustion or uncaught runtime exception; check `journalctl -u laya.service`. |\n",{"name":5,"tags":54,"author":57,"version":58,"description":7},[34,29,35,55,36,33,32,43,56,41],"decision-engine","nodejs","Laya Engine Team","1.0.0","main","74715deacdc69119d739f38916f8ee4f0f979ebf","skills\u002Fstorage\u002Fmy_skills\u002Flaya-system-one",0,"https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills","https:\u002F\u002Fgithub.com\u002Fmdnaimul22","AI Agents Workflows Automation | Specializing in Python, FastAPI, MCP Agents & Custom ERP.","2026-11-11 21:16:57",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add mdnaimul22\u002Fhuman-skills --skill laya-remote-api",{"tool":73,"command":74},"bunx","bunx skills add mdnaimul22\u002Fhuman-skills --skill laya-remote-api",{"tool":76,"command":77},"pnpm","pnpm dlx skills add mdnaimul22\u002Fhuman-skills --skill laya-remote-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fmy_skills\u002Flaya-system-one\u002FSKILL.md",true,[],[82,90,98,105,112,119],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":89},"01M767791C1KRP2ZRW2Z73VZ5Q","system-lifecycle-designer","Universal architectural methodology for designing granular, atomic, and sub-atomic lifecycles and end-to-end workflows for single functionality integrations across any domain (daemons, batch jobs, request transactions, resource pools). Provides patterns for deterministic identity, pre-commit validation, differential reconciliation, sticky leasing, state machines, transactional persistence, and closed-loop feedback.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fmy_skills\u002Fsystem-lifecycle-designer\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":97},"01M748ABPN5F1FANHH6HKZQMXT","style-sampling","Make a new episode in a proven video style - Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime - on the person's topic. Use for \"an episode of\", \"in the style of\", \"sample this style\", 「用这个风格做一集」. One video to copy is reverse-any-video.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fheygen-com_hyperframes\u002Fstyle-sampling\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":97},"01M748A59V04PKW4HA0XQ81FGP","reverse-any-video","Rebuild any video file as an editable HyperFrames project - motion graphics, talking heads, live action or AI-generated footage - checked against the original frame by frame. Use to reverse, recreate, remake, replicate or copy a video, or 「复刻这个视频」「照着这个视频做一个」.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fheygen-com_hyperframes\u002Freverse-any-video\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":97},"01M7487T50P55CSXMWXZ0G9KRG","typescript-patterns","TypeScript patterns for strict, type-safe, maintainable code in modern TypeScript and JavaScript applications. Covers strict compiler configuration, type design, narrowing, discriminated unions, generics, async and error handling, module boundaries, dependency hygiene, and type-level testing. Use when writing or reviewing TypeScript or JavaScript code.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Ftypescript-patterns\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":97},"01M7487ERZRGPC5NJ75077Y238","test-collaboration","Inventory and govern a project's test assets. Connect requirements, business rules, risks, bugs, and cross-boundary contracts to stable TEST-IDs and executable evidence in the repository's existing test registry or TESTS.md. Use for test inventory, test gap analysis, unit\u002Fintegration\u002Fcontract\u002FE2E\u002Fsmoke classification, bug-to-test regression protection, consumer\u002Fprovider contract testing, test-necessity review, and pre-delivery evidence review.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Ftest-collaboration\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":97},"01M748721J3GKR2WS6K0QWFC35","story-lifecycle","Manage a file-based epic → story → sprint development loop without requiring an external project management tool. Creates and tracks epics, breaks them into user stories, assigns them to sprints, and drives implementation story by story. Use when starting a new feature initiative or when the team has no Jira\u002FLinear\u002FTaiga but needs structured delivery tracking.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Fstory-lifecycle\u002FSKILL.md",[],[]]