--- install scripts ---
### postinstall
node --no-warnings bin/postinstall.js
--- package/package.json (excerpt) ---
{
"name": "@iola_adm/iola-cli",
"version": "0.2.67",
"description": "CLI и AI-агент городского округа Йошкар-Ола.",
"license": "MIT",
"homepage": "https://github.com/adm-iola/iola-cli#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/adm-iola/iola-cli.git"
},
"bugs": {
"url": "https://github.com/adm-iola/iola-cli/issues"
},
"type": "module",
"bin": {
"iola": "bin/iola.js"
},
"scripts": {
"postinstall": "node --no-warnings bin/postinstall.js",
"start": "node --no-warnings bin/iola.js",
"installer:windows": "powershell -NoProfile -ExecutionPolicy Bypass -File ./installer/windows/scripts/build-installer.ps1",
"installer:windows:premium": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./installer/windows/premium/build-premium-installer.ps1",
"test": "node --no-warnings --check bin/iola.js && node --no-warnings --check bin/postinstall.js && node --no-warnings --check src/cli.js && node --no-warnings test/smoke-test.js"
},
"files": [
"bin",
"src",
"test",
"skills",
"wiki",
"docs/assets/readme-header.png",
"docs/assets/iola-oauth-icon.png",
"README.md",
"SECURITY.md",
"LICENSE"
],
"publishConfig": {
"access": "public"
},
"keywords": [
"yoshkar-ola",
"open-data",
"mcp",
"cli"
],
"engines": {
"node": ">=22.5.0"
},
"dependencies": {
"qrcode": "^1.5.4"
}
}
--- package/src/cli.js (excerpt) ---
import { execFile, spawn } from "node:child_process";
import { createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync } from "node:fs";
import { createServer } from "node:http";
import { appendFile, copyFile, cp, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { createHash, randomUUID } from "node:crypto";
import { emitKeypressEvents } from "node:readline";
import readline from "node:readline/promises";
import { Readable } from "node:stream";
import { stdin as input, stdout as output } from "node:process";
import { DatabaseSync } from "node:sqlite";
import tls from "node:tls";
import { fileURLToPath } from "node:url";
import { inflateRawSync, inflateSync } from "node:zlib";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const API_BASE_URL = process.env.IOLA_API_BASE_URL || "https://apiiola.yasg.ru/api/v1";
const MCP_BASE_URL = process.env.IOLA_MCP_BASE_URL || "https://apiiola.yasg.ru";
const AI_RELAY_BASE_URL = process.env.IOLA_AI_RELAY_BASE_URL || `${API_BASE_URL}/ai/relay`;
const YAKUNIN_ROUTER_BASE_URL = process.env.IOLA_YAKUNIN_ROUTER_BASE_URL || `${API_BASE_URL}/pay/yakunin-router`;
const AI_NETWORK_MODE = process.env.IOLA_AI_NETWORK_MODE || "";
const MIN_NODE_VERSION = "22.5.0";
const CONFIG_DIR = getIolaHomeDir();
const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
const LAST_GOOD_CONFIG_FILE = path.join(CONFIG_DIR, "config.last-good.json");
const SECRETS
--- package/src/iola_hf_runner.py (excerpt) ---
import argparse
import json
import os
import sys
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8")
if hasattr(sys.stderr, "reconfigure"):
sys.stderr.reconfigure(encoding="utf-8")
def check_deps():
import torch # noqa: F401
import transformers # noqa: F401
import peft # noqa: F401
import huggingface_hub # noqa: F401
import hf_xet # noqa: F401
def load_payload():
raw = sys.stdin.buffer.read().decode("utf-8").strip()
if not raw:
return {}
return json.loads(raw)
def model_revision(repo, token):
from huggingface_hub import HfApi
try:
info = HfApi(token=token).model_info(repo)
return getattr(info, "sha", "") or ""
except Exception:
return ""
def load_model(repo, cache_dir, token):
import torch
from peft import PeftConfig, PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
peft_config = None
base_model = repo
try:
peft_config = PeftConfig.from_pretrained(repo, cache_dir=cache_dir, token=token)
base_model = peft_config.base_model_name_or_path
except Exception:
peft_config = None
tokenizer = AutoTokenizer.from_pretrained(base_model, cache_dir=cache_dir, token=token)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
dtype = torch.float16 if torch.cuda.is_available() else (torch.bfloat16 if peft_config is not None else torch.float32)
model
--- dynamic destinations ---
→ apiiola.yasg.ru (via hostname-var)
→ llm.api.cloud.yandex.net (via hostname-var)
→ gigachat.devices.sberbank.ru (via hostname-var){
"name": "@iola_adm/iola-cli",
"version": "0.2.67",
"description": "CLI и AI-агент городского округа Йошкар-Ола.",
"license": "MIT",
"homepage": "https://github.com/adm-iola/iola-cli#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/adm-iola/iola-cli.git"
},
"bugs": {
"url": "https://github.com/adm-iola/iola-cli/issues"
},
"type": "module",
"bin": {
"iola": "bin/iola.js"
},
"scripts": {
"postinstall": "node --no-warnings bin/postinstall.js",
"start": "node --no-warnings bin/iola.js",
"installer:windows": "powershell -NoProfile -ExecutionPolicy Bypass -File ./installer/windows/scripts/build-installer.ps1",
"installer:windows:premium": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./installer/windows/premium/build-premium-installer.ps1",
"test": "node --no-warnings --check bin/iola.js && node --no-warnings --check bin/postinstall.js && node --no-warnings --check src/cli.js && node --no-warnings test/smoke-test.js"
},
"files": [
"bin",
"src",
"test",
"skills",
"wiki",
"docs/assets/readme-header.png",
"docs/assets/iola-oauth-icon.png",
"README.md",
"SECURITY.md",
"LICENSE"
],
"publishConfig": {
"access": "public"
},
"keywords": [
"yoshkar-ola",
"open-data",
"mcp",
"cli"
],
"engines": {
"node": ">=22.5.0"
},
"dependencies": {
"qrcode": "^1.5.4"
}
}
import { execFile, spawn } from "node:child_process";
import { createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync } from "node:fs";
import { createServer } from "node:http";
import { appendFile, copyFile, cp, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { createHash, randomUUID } from "node:crypto";
import { emitKeypressEvents } from "node:readline";
import readline from "node:readline/promises";
import { Readable } from "node:stream";
import { stdin as input, stdout as output } from "node:process";
import { DatabaseSync } from "node:sqlite";
import tls from "node:tls";
import { fileURLToPath } from "node:url";
import { inflateRawSync, inflateSync } from "node:zlib";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const API_BASE_URL = process.env.IOLA_API_BASE_URL || "https://apiiola.yasg.ru/api/v1";
const MCP_BASE_URL = process.env.IOLA_MCP_BASE_URL || "https://apiiola.yasg.ru";
const AI_RELAY_BASE_URL = process.env.IOLA_AI_RELAY_BASE_URL || `${API_BASE_URL}/ai/relay`;
const YAKUNIN_ROUTER_BASE_URL = process.env.IOLA_YAKUNIN_ROUTER_BASE_URL || `${API_BASE_URL}/pay/yakunin-router`;
const AI_NETWORK_MODE = process.env.IOLA_AI_NETWORK_MODE || "";
const MIN_NODE_VERSION = "22.5.0";
const CONFIG_DIR = getIolaHomeDir();
const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
const LAST_GOOD_CONFIG_FILE = path.join(CONFIG_DIR, "config.last-good.json");
const SECRETS