Khy OS — AI platform operating system with an extensible default app runtime
Project description
Khy OS
Khy OS is an AI platform CLI and runtime. The default built-in app is khyquant.
Positioning
khyis the primary Khy OS command (platform shell + app runtime).khyquantis the default upper-layer app/plugin compatibility command.- AI lite mode is explicit: use
khy ai ...(orkhy --lite ...).
Release Notes (0.1.3)
This release focuses on vision/multimodal adapter compatibility and packaging consistency.
Highlights
- Unified image normalization for gateway adapters:
- added shared image compatibility layer for base64/data-url/url payloads
- mapped unified image input to adapter-specific formats (Codex/Claude/Ollama/OpenAI-compatible IDE adapters)
- Removed forced image routing to Claude by default:
- image requests now keep the selected adapter first
- gateway fallback remains enabled when a channel actually fails
- Improved local/IDE multimodal behavior:
- Codex direct mode accepts normalized images
- Ollama adapter accepts normalized image payloads for multimodal models
- Trae/Windsurf adapters accept OpenAI-compatible vision message blocks
- Packaging/release consistency:
- synchronized package version metadata for
khy-os==0.1.3 - fixed release path to avoid mixed/legacy install metadata
- synchronized package version metadata for
Upgrade
python3 -m pip install -U khy-os==0.1.3
khy --version
Release Notes (0.1.2)
This release focuses on production stability, multi-adapter robustness, and clearer operator experience.
Highlights
- Improved AI request stability for long-running tasks:
- task-scale-aware retry/timeout strategy
- transient error recovery across gateway and tool loop layers
- safer adapter failover behavior when preferred channels are unstable
- Better context-window safety:
- dynamic context budget handling
- stronger compaction path for oversized histories
- Better terminal UX:
- improved status signaling and de-duplication
- stronger recovery for interactive input states
- Packaging/version sync:
- synchronized version bump across Python + Node entry metadata
- release artifacts generated for
khy-os==0.1.2
Upgrade
python3 -m pip install -U khy-os==0.1.2
khy --version
Compatibility
- Python:
>=3.8 - Node.js:
>=18 - OS: Linux / macOS / Windows
Directory Structure
Khy-OS/
├─ platform/ # Platform layer (Python launcher + shared JS)
│ ├─ khy_platform/ # Python launcher package (PyPI entrypoint)
│ │ ├─ cli.py # Main Python CLI bridge
│ │ └─ _bootstrap.py # Runtime bootstrap checks/fixes
│ ├─ khy_os/ # Bundled runtime payload (pip distribution)
│ └─ packages/shared/ # Shared JS modules (backend/frontend)
│
├─ services/ # Backend services (Node.js)
│ ├─ backend/ # Node.js core runtime
│ │ ├─ bin/khy.js # Node CLI entrypoint
│ │ ├─ server.js # API server entrypoint
│ │ └─ src/
│ │ ├─ cli/ # REPL/router/handlers
│ │ ├─ routes/ # HTTP routes
│ │ ├─ services/ # Gateway, adapters, tools, orchestration
│ │ ├─ tools/ # Tool implementations
│ │ ├─ models/ # Data models
│ │ └─ middleware/ # Auth/rate-limit/error middleware
│ └─ ai-backend/ # AI management backend (API + gateway admin)
│
├─ apps/ # Upper-layer apps
│ └─ ai-frontend/ # Vue management UI (components/views/stores/api)
│
├─ quant/khyquant/ # Default built-in app
├─ kernel/ # OS build tree (alpine/boot/iso/moonbit/src)
├─ extensions/ # Optional extensions
├─ docs/ # 架构、指南、验证文档
├─ scripts/ # Build/install/release scripts
├─ tests/ # Test suites
├─ pyproject.toml # Python package metadata
└─ services/backend/package.json # Node backend metadata
Quick Start
python3 -m pip install -U khy-os
khy --help
khy doctor
khy app list
Development install:
python3 -m pip install -e .
Core Commands
khy app list
khy gateway status
khy linux status
khy server start
Explicit AI Lite Mode
khy ai "summarize this project status"
khy ai -p "only output JSON"
khy ai run qwen3.5:4b "hello"
# compatibility alias (kept for older scripts)
khy run qwen3.5:4b "hello"
OS Build Entry
bash scripts/build-khy-os.sh
Windows (Docker Desktop + PowerShell):
khy iso build --output dist/khy-os.iso
# equivalent source script:
# powershell -ExecutionPolicy Bypass -File scripts/alpine/build-iso-windows.ps1
VMware usage:
- On Windows, the recommended flow is
pip install khy-os->khy iso build-> attachdist/khy-os.isoin VMware. - If you need a VMware disk image (
.raw/.vmdk) instead of an ISO, use the Linux source-tree workflow withscripts/khytogo/make-khytogo.sh --mode vmware-plan|vmware-create. - Full guide:
docs/指南/windows-vmware-清单.md
Component mode:
bash scripts/build-khy-os.sh --component core --component vmware-plan
bash scripts/build-khy-os.sh --component moonbit --strict
WASM App Runtime
khy app register math --runtime wasm --wasm /abs/path/math.wasm --abi numeric-v1 --export add
khy app run math add 1 2
khy app register echo --runtime wasm --wasm /abs/path/echo.wasm --abi string-v2 --export run
khy app exports echo
khy app run echo hello khy os
khy app register score --runtime wasm --wasm /abs/path/score.wasm --abi json-v2 --export run
khy app run score --json '{"symbol":"AAPL","price":192.3,"rsi":63.2}'
# M1 IPC simulation (loopback netd/fsd/wmd)
khy app register weather --runtime wasm --wasm /abs/path/weather.wasm --abi json-v2 --export run --caps ipc,net
khy app ipc weather net http_get --json '{"city":"shanghai"}'
Required Environment
- Python >= 3.8
- Node.js >= 18
- Linux/macOS/Windows
Pip Distribution Boundary
- Prebuilt ISO/model artifacts are intentionally excluded from pip packages.
- You can build ISO locally after installation (
khy iso build ...). - You can download and register models on demand:
khy models pull qwen3.5:4b
khy models list
khy gateway model
See:
docs/架构/核心架构.mddocs/指南/环境要求.mddocs/修复记录/特性访问与代理解耦-2026-06-01.mddocs/维护者/特性访问-维护速查-2026-06-01.mddocs/模板/特性访问-提示词胶囊-2026-06-01.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file khy_os-0.1.90.tar.gz.
File metadata
- Download URL: khy_os-0.1.90.tar.gz
- Upload date:
- Size: 36.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c233b119bbc69b53e62f5285c92c4ca19821256bd72e3aedf97b670274081e3
|
|
| MD5 |
db1dbffc6a4630773db32de61388d6ce
|
|
| BLAKE2b-256 |
165339578174b9a45659d951d21d94e6555e76fea6886bbda3bbe4df57670e0c
|
File details
Details for the file khy_os-0.1.90-py3-none-any.whl.
File metadata
- Download URL: khy_os-0.1.90-py3-none-any.whl
- Upload date:
- Size: 10.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e64e2c576f0ea71c2fc501dd82523ec0b3f337057c987bc4225eea1b38cc3555
|
|
| MD5 |
e159052d1f8899e43009bec39156a04a
|
|
| BLAKE2b-256 |
8910c1051f23feddcdfee78285a933c3a02da62789d922b7cd021801c40b5c72
|