Documentation
Complete technical documentation for the Laintas product suite. Installation, API reference, configuration guides, and best practices.
Pricing
Pay-as-you-go
- · Helpwo: $3.96/$7.91 per 1M tokens
- · Kline-de-pre: $1/call
- · Laintas CLI: Free
- · PPOS: $1/review · 5 MB
/mo · Single product
- · Helpwo: 10,000/mo
- · CLI: 12,000/mo
- · Laintas Search: 20,000/mo
- · Laintas Fin: 40 shared/mo
/mo · All products
- · Helpwo: 10,000/mo · CLI: 12,000/mo
- · Search: 10,000/mo · Fin: 30 shared/mo
- · PPOS: 2,000/mo · 50 MB
- · Includes future products
Kline-de-pre
AI-powered candlestick volatility & scenario tool. Built on a HAR-RV volatility + diffusion generator dual-model pipeline with screenshot-to-K-line recognition, a volatility uncertainty cone, and future scenario sampling (forecasts the volatility range, not direction). Open source with self-deployment; online service is pay-per-use ($1/call).
Visit ProductKline-de-pre is an AI-powered candlestick volatility & scenario tool. Upload a K-line screenshot from any trading platform — the system uses OpenCV computer vision to detect candlestick bodies, a HAR-RV model to estimate future volatility and draw a 50/80/95% uncertainty cone, and a diffusion generator to sample plausible future candle scenarios. It forecasts the future volatility range and scenarios, not up/down direction (raw candles carry no reliable directional signal at short horizons). The code is open source for self-deployment; the hosted version is available through the Laintas platform.
Core Capabilities
| Capability | Description |
|---|---|
| Image → OHLC | OpenCV.js screenshot recognition, reconstructing OHLC data from the image |
| Volatility (HAR-RV) | HAR-RV model estimates next-60-min volatility from three-scale realized volatility and draws the 50/80/95% uncertainty cone |
| Scenario Generator | Diffusion generator (built-in GAF-CNN encoder) samples future candle scenarios, scaled to the predicted volatility |
| MarketWatch | Backend service auto-fetches BTC data hourly and refreshes the global volatility cone & scenarios |
| Live Trading | Server-side shared trading account: an AI host checks TP/SL and makes trade decisions every 15 min based on predictions; all viewers see the same account and can chat (paid). |
Inference Pipeline (3 stages)
[1,12,60,60] fed to the generator's built-in CNN encoder. Conditioned on ŝ, the generator samples in shape space via DDIM reverse diffusion, reconstructed as ghost = last + ŝ·shape scenario candles. Sampling calibration: ~0.76 band coverage, ~1.0 total-variation ratio (realistic shapes, no mean-collapse).Dual Runtime Architecture
The browser only does what you can see: screenshot detection (OpenCV.js) and the GAF feature preview. All inference runs on the server — model weights are never shipped to the browser; the page gets the volatility cone and scenarios from /api/v1/infer (billed per call, login required). Server-side (MarketWatch.cjs): an Express + node-cron backend runs the same pipeline via ONNX Runtime Node and refreshes the global cone & scenarios on a schedule; the MarketWatch page fetches results from /api/latest-prediction.
Risk Disclaimer
Quick Start
Prerequisites
| Dependency | Requirement |
|---|---|
| Node.js | Version 18 or later (with npm) |
| Git | For cloning the repository |
| Browser | Chrome / Firefox / Edge with WebGL support |
Install & Run
1. Clone and install dependencies
2. Place the model files (server-side only)
Put kline_generator.onnx (generator) and har_coef.json (HAR volatility coefficients) under server-models/ — not under public/, which would publish them as static assets. Self-deployments must supply their own weights.
3. Start the frontend dev server
Runs at http://localhost:5173 by default. Open it in a browser to use AI prediction.
4. (Optional) Start the backend prediction service
Runs on port 5000, fetching BTC data and running AI inference at the top of every hour. Results are served at /api/latest-prediction for the MarketWatch page. Make sure the /api proxy in vite.config.js points to localhost:5000.
Usage Flow
API Reference
Backend Prediction Endpoint
Served by MarketWatch.cjs (Express 5 backend, port 5000). The full BTC inference pipeline runs at the top of each hour, updating the global prediction cache. The frontend can poll for the latest result at any time. No authentication required.
Success Response (200)
Response Fields
| Field | Type | Description |
|---|---|---|
| aiResult[type=ai_trend] | array | Cone midline points (≈ current price, center of the symmetric cone), each with time (Unix seconds) and value (price) |
| aiResult[type=vol_cone] | array | Volatility uncertainty cone: 3 nested bands (name=95/80/50), each with per-point upper/lower arrays that widen over time |
| aiResult[type=full] | array | One generator-sampled future OHLC scenario candlestick array |
| anchorTime | number | Prediction anchor time (timestamp of the last known candle, Unix seconds) |
| startPrice | number | Prediction start price (close price of the last known candle) |
| serverTime | number | Unix millisecond timestamp when the prediction was generated |
Error Responses
| Status | Meaning | How to Handle |
|---|---|---|
| 503 | Server initializing (model loading takes ~10–30 s on first startup) | Poll and retry from the frontend |
FAQ
What AI models does Kline-de-pre use?
Two models: (1) Model 1 HAR-RV — a pure linear volatility model (4 coefficients in a server-side har_coef.json) that predicts the next-60-min volatility scale ŝ from three-scale realized volatility, out-of-sample R²≈0.56; (2) Model 2 generator kline_generator.onnx — a built-in GAF-CNN encoder + conditional diffusion UNet that, conditioned on ŝ, samples future candle scenarios via DDIM. The generator is exported to ONNX and runs server-side only (ONNX Runtime Node, CPU) — the weights are not published and cannot be downloaded.
How accurate are the predictions? What does "for reference only" mean?
Financial markets are highly uncertain and stochastic. This system forecasts the future volatility range, NOT up/down direction — raw candles carry no reliable directional signal at short horizons, so the system honestly outputs a symmetric uncertainty cone and scenarios rather than buy/sell signals. The volatility part has an out-of-sample R²≈0.56 (genuine predictive power), but results remain a probabilistic extrapolation of historical patterns and do NOT constitute investment advice. Real trading decisions should incorporate fundamentals, market sentiment, and risk management.
What types of K-line screenshots are supported?
The system extracts green (up) and red (down) pixel regions via HSV color space, so any chart with green-up/red-down coloring works. Upload clear, unobstructed screenshots at 800×600+ resolution for best results. Transparent or non-black backgrounds are auto-filled with a black canvas.
How often does the backend prediction update?
MarketWatch.cjs uses node-cron to run the full BTC inference pipeline at the top of every hour (0 * * * *), and also runs initial inference on startup. The MarketWatch frontend refreshes market data every 5 seconds and fetches the latest AI prediction 10 seconds after each new hour.
Can I use it for other trading pairs?
MarketWatch.cjs is currently hardcoded for BTC/USD via the CryptoCompare API. To support other pairs, modify the API request URL in MarketWatch.cjs. The frontend screenshot detection works for any K-line chart regardless of the trading pair.
What is the GAF transform and why is it needed?
GAF (Gramian Angular Field) encodes 1D time series as 2D images. This system uses the GASF (Summation) variant, converting 60 candles × 12 channels of multi-timeframe data (1m/5m/15m, OHLC each) into [60,60] matrices, fed to the generator's built-in CNN encoder to provide morphological context of the current regime for scenario generation.
Can I download the model weights? Why does prediction need a connection?
No. The weights live only in a server-side directory, are not part of the frontend build, and every /models/ path on the site returns 404. So the AI prediction page always calls the cloud inference endpoint (billed per call, login required) — there is no local in-browser inference mode anymore, and everyone is served by the same up-to-date model.
How much does Kline-de-pre cost?
The live and market-watch pages are free to watch, with no time limit — that forecast is computed once on a schedule and shared by everyone. You only pay when the server runs something just for you, priced at $1 per call: one cloud inference (AI prediction page / MCP) or one live chat message. Laintas Fin Pro ($19.9/mo) includes 40 monthly financial calls shared across Kline-de-pre and Value-de-pre; Gen ($49.9/mo) includes 30 shared monthly calls. Neither has a 5-hour burst limit. Past the quota, billing falls back to $1 per call. The code is open source — self-deploy and use it for free.
Helpwo
AI-powered cloud IDE with a built-in custom Agent engine. Supports natural-language-driven code generation, intelligent refactoring, and context-aware completion. Paired with Laintas CLI for seamless browser-to-local programming. Open source with self-deployment; online version billed by token usage.
Visit ProductHelpwo is an AI-powered Web IDE that runs entirely in the browser — no client installation. It ships with a built-in code editor, a virtual file system, and an AI chat panel offering three working modes: Chat, Agent, and Engine. Paired with Laintas CLI, it enables seamless browser-to-local programming. The core is open source for self-deployment; the online version is billed by token usage.
Three Working Modes
| Mode | File Access | Best For |
|---|---|---|
| Chat | None | Code Q&A, concept explanations, technical discussion — AI replies in text only |
| Agent | Full autonomy | Complex coding tasks — AI plans and executes autonomously with all tools and sub-agent spawning, up to 10 loop iterations |
| Engine | None | Visual presentation — outputs natural language while rendering charts, tables, and cards in HTML |
UI Layout
Data Storage
Quick Start
Access
Helpwo is a pure web application — all data and computation happen locally in your browser. No download, installation, or configuration required.
Getting Started
1. Open the website
We recommend a modern browser such as Chrome, Firefox, or Edge.
2. Register / Sign in
Register a Laintas account on your first visit. Supports email registration, or quick sign-in with Google or GitHub. After login, your username and balance are displayed in the top-right corner.
3. Top up or subscribe
The online version is billed by actual token usage: $3.96/1M input and $7.91/1M output. Both Pro and Gen include 10,000 monthly AI calls for Helpwo. Visit the pricing page for details, or top up your balance in settings.
4. Start using
Create files or import local projects in the file area, write code in the editor, and interact with the AI via the Chat / Agent / Engine mode selector. Start with Chat mode to get familiar, then try Agent mode to let the AI autonomously complete coding tasks, and finally explore Engine mode for rich HTML-rendered output.
Recommended Workflow
API Reference
The Helpwo backend provides RESTful APIs consumed by the web frontend and the Laintas CLI. All APIs require authentication (Cookie or X-User-Id header).
AI Chat
SSE streaming AI chat. Supports OpenAI-compatible function calling (messages + tools) — the AI invokes frontend tools (file read/write, code search, etc.) via tool_calls. Each call checks balance before execution and deducts the actual token cost from the laintas.com account after the response; _billing info is returned at stream end.
| Body Field | Type | Description |
|---|---|---|
| message | string | The current user message |
| messages | array | Full conversation history (OpenAI format: role + content) |
| tools | array | Optional. OpenAI-format tool definitions for the AI to issue tool_calls |
| lang | string | Reply language, e.g. "CN" / "EN" |
| currentPath | string | Current working directory context |
| maxTokens | number | Max tokens for the reply |
Balance & Billing
| Endpoint | Description |
|---|---|
| GET /api/balance | Query balance. Returns {"balance": 1000, "balanceFormatted": "$10.00", "pricing": {...}}; balance is null when unauthenticated |
Remote Agent Management
These endpoints form the remote-control protocol between Helpwo and Laintas CLI: the CLI registers as a remote agent, the Web UI dispatches commands, and the CLI polls, executes, and streams events back.
| Endpoint | Description |
|---|---|
| POST /api/agents/register | Register a CLI instance; a unique agentId is assigned. Returns {"agentId": "remote-xxxxxxxx", "status": "registered"} |
| POST /api/agents/:id/send | Web UI sends a command to an agent. Supports chat / exec / delegate / abort / approval-response kinds. Returns {"ok": true, "messageId": "..."} |
| GET /api/agents/:id/updates | Web UI polls the agent event stream; incremental fetch via ?since=N cursor. Returns {"events": [...], "seq": 42, "state": {...}} |
| GET /api/agents/:id/poll | CLI polls for pending commands. Returns {"inputs": [{...}]} — empty array when none are pending |
FAQ
Does Helpwo require installation? Where is my data stored?
No installation needed. Helpwo is a pure web app that runs in your browser. All files are stored in your browser's IndexedDB database and are never automatically uploaded to any server. You can export files to your local machine at any time, or upload local files into Helpwo for editing. Switching browsers or clearing browser data will lose your files — export periodically as a backup.
What's the difference between Chat, Agent, and Engine modes? When should I use each?
Chat mode is pure conversation — the AI won't touch your files; perfect for questions, learning concepts, and discussing approaches. Agent mode gives the AI maximum freedom to autonomously plan multi-step tasks, search files, spawn sub-agents, and even remotely operate your local machine — best for complex tasks like large-scale refactoring. Engine mode outputs natural language while rendering rich content in HTML format (charts, tables, cards) — ideal for visual presentation of results.
How does AI billing work? What if I run out of balance?
AI conversations are billed by actual token usage: $3.96 per 1M input tokens and $7.91 per 1M output tokens. Both Pro ($19.9/mo) and Gen ($49.9/mo) include 10,000 monthly AI calls for Helpwo. Overage is deducted automatically after each AI response. Subscribe at /pricing or top up in settings. Helpwo is open source — self-deploy for free if you prefer.
What's the difference between Agent and Engine modes?
Agent mode is "AI completes your task autonomously" — you describe the goal, and the AI plans steps, searches files, modifies files, and decides execution order on its own, without asking for approval midway. It can also spawn sub-agents for parallel subtasks (e.g., refactoring three modules simultaneously). Engine mode focuses on output presentation — the AI generates natural language while simultaneously rendering rich content in HTML format (charts, tables, cards), ideal for structured visual output rather than plain text.
What are .cli.prop and .cli.js? How do I customize Helpwo?
.cli.prop is the system prompt template — it controls the system-level instructions sent to the AI (behavior rules, output format, etc.). .cli.js is the custom command registration file — write new CLI commands in JavaScript that can call built-in tools, access the database, and manipulate the editor. Both live in the system files area of the virtual filesystem and take effect immediately after editing.
How do I let the Agent operate on my local machine's files?
Install the Laintas CLI tool on your computer. Running laintas-cli registers it as a remote Agent for Helpwo. Your machine then appears in the Agent panel within Helpwo, and the AI in Agent mode can use remote_exec and remote_query tools to directly operate on your local file system and shell. Sensitive operations request your approval before execution.
Which programming languages are supported? What about syntax highlighting and code completion?
The editor is built on CodeMirror 6, supporting syntax highlighting and code folding for dozens of languages including JavaScript, TypeScript, HTML, CSS, JSON, Markdown, Python, Go, and Rust. The AST analysis tool (outline command) parses TypeScript/JavaScript code structure via tree-sitter. The AI itself is a general-purpose language model that can understand and generate code in virtually any programming language.
Laintas CLI
An autonomous AI agent for your terminal. Natural-language-driven command execution, multi-agent collaboration, persistent memory, and a security policy engine — plus remote-agent registration for seamless Helpwo browser-to-local integration. Free and open source; AI calls billed via your account.
Visit ProductLaintas CLI is an autonomous AI agent that lives in your terminal. Type a natural-language task at the prompt — the AI calls the backend API, generates shell commands, executes them in a pseudo-terminal (PTY), reads the output, and iterates until the task is done. System commands typed directly are executed via PTY passthrough with no AI involvement. Once installed, it can also register as a remote agent for Helpwo, letting the AI in your browser operate directly on your local machine.
Input Routing
The REPL classifies every input line in the following order:
/ — meta command (/help, /login, /term, …), handled locally; unrecognized / commands fall through to the user-extensible .laintas/commands.py.run_agent_loop).Core Capabilities
| Capability | Description |
|---|---|
| PTY Execution | Commands run in a pseudo-terminal; interactive programs (vim, REPLs) get real TTY semantics. Inside tmux, a new window is spawned for native passthrough |
| Named Terminals | /term creates persistent sub-terminals that survive across tasks; the AI sees a snapshot of each terminal's latest output every loop iteration |
| Multi-Agent | /hire creates multiple AI agents with tree hierarchies, sub-agent spawning, inbox messaging, and abort |
| Tools & Extensions | Built-in tool registry + user skills (~/.laintas/skills/) + MCP servers (~/.laintas/mcp.json) |
| Security Policy | A policy engine evaluates every command as allow / needs_approval / deny, with audit / enforce modes and a JSONL audit log |
| Persistent Memory | Cross-session memory system (user / feedback / project / reference types), stored as Markdown files in ~/.laintas/memory/ |
| Plan & Tasks | /plan structured planning (explore → write plan → approve → execute), /workflow multi-phase workflows, persistent task list |
| Remote Agent | Registers as a Helpwo remote agent: heartbeat + command polling (chat / exec / delegate / abort), streaming events back to the browser |
Relationship with Helpwo
/api/chat/stream) and the same Laintas account system as Helpwo. On startup, the CLI registers as a remote agent via the /api/agents/* protocol, so the AI in Helpwo’s Agent mode can operate your local files and shell through it.Installation
System Requirements
| Distribution | File | Requirements |
|---|---|---|
| Linux | laintas-cli_linux.tar.gz | x86-64 standalone binary, no Python required |
| Source | laintas-cli_source.zip | Any platform with Python 3.10+; best for auditing, debugging, and modification |
Download & Install
Visit https://cli.laintas.com to download the Linux build or source package, or fetch them directly with curl:
Linux Install
You can also run without installing: ./laintas-cli/laintas-cli.
Run from Source
Core dependencies: requests, certifi, rich, prompt_toolkit; optionally install mcp, playwright, websockets, and aiortc for MCP, browser automation, and WebRTC features.
First Run & Login
laintas-cli to enter the interactive REPL — the banner shows your account, working directory, and backend URL./login — the CLI opens accounts.laintas.com and authenticates with OAuth Authorization Code + PKCE; the resulting session is cached in ~/.laintas/session.json (chmod 600).Non-interactive Mode
Command Reference
All meta commands start with / and are handled locally in the REPL. Full command reference:
Session & Account
| Command | Description |
|---|---|
| /help | Show help |
| /login | Re-authenticate with accounts.laintas.com (opens browser) |
| /model [id|reset] | List available backend models, set the model, or reset to default |
| /name [name] | Set the current agent name |
| /cwd | Show current working directory |
| /clear | Clear screen |
| /exit | Log out and exit (clears cached session) |
| /quit, /q | Exit without logging out (/q detaches from a sub-terminal) |
Terminals & Agents
| Command | Description |
|---|---|
| /t, /term [name] | List sub-terminals, or create a new named one |
| /send <name> <cmd> | Send a command to a named terminal |
| /station [name] | Station the agent in a persistent shell (current or named terminal) |
| /terminate <name> | Close and destroy a terminal |
| /back | Detach from a sub-terminal without closing it |
| /hire | Create a new AI agent (AI-1, AI-2, …) |
| /agents [name] | List / switch agents; /agents name <n> renames |
Planning, Memory & Extensions
| Command | Description |
|---|---|
| /plan | Structured planning (enter / approve / exit / status / list) |
| /workflow | Multi-phase workflows (start / status / advance / end / list) |
| /memory | View project memory (.laintas/memory.json) |
| /prop | View the AI system prompt template (.laintas/cli.prop) |
| /skill | Skill management (list / reload / new <name> / dir) |
| /tools | List registered AI tools |
| /config | Runtime config (/config <key> <value>, /config reset) |
| /scan | Scan and list all available system commands on PATH |
| /debug | Browse debug entries (/debug <N> for detail, /debug clear to reset) |
Configuration
Environment Variables
| Variable | Description |
|---|---|
| LAINTAS_BACKEND | Backend URL, defaults to laintas.com; can point to a self-hosted Helpwo backend |
| LAINTAS_HOME | Config directory location, defaults to ~/.laintas/ |
| LAINTAS_WORKSPACE | Default working directory for the Linux launcher, defaults to ~/laintas_workspace |
Global Config Files (~/.laintas/)
All configuration lives in ~/.laintas/, auto-created with safe defaults on first access. Config files are mtime-cached — edits take effect immediately, no restart required.
| File | Purpose |
|---|---|
| policy.json | Command security policy: allow / needs_approval / deny regex rules |
| hooks.json / hooks.py | Event hooks: pre/post_command, pre/post_tool, session start/end, etc. |
| mcp.json | MCP server configuration (one subprocess per server, tools auto-registered) |
| memory/ | Cross-session persistent memory (Markdown + frontmatter, indexed by MEMORY.md) |
| plans/ | Execution plans saved by /plan |
| tasks.json | Structured task list (pending → in_progress → completed) |
| skills/ | User-installed skill directories (one skill.py each) |
| audit.log | JSONL audit trail of command decisions |
| session.json | Authentication session (chmod 600) |
| config.json | Global settings (agentName, backendUrl) |
Project-level Files (.laintas/)
On first run in any directory, the CLI creates a .laintas/ subdirectory (add it to .gitignore — never commit it):
| File | Purpose |
|---|---|
| cli.prop | AI system prompt template ({{var}} substitution) |
| memory.json | Persisted AI memory / project rules |
| commands.py | Custom / command extensions (handle_extra_command) |
| loop.py | Command-execution interception hook (return a string to inject synthetic output) |
Runtime Parameters (/config)
| Key | Default | Description |
|---|---|---|
| max_loops | 30 | Max AI loop iterations per task |
| max_tokens | 2000 | Max tokens per AI response |
| loop_delay | 1.5 | Seconds between loop iterations |
| output_truncate | 3000 | Char limit for the lastOutput tail |
| poll_timeout | 10.0 | Seconds to wait for first command output |
| terminal_tail_lines | 20 | Lines shown in sub-terminal snapshots |
| heartbeat_interval | 30 | Seconds between agent heartbeats |
| staleness_limit | 3 | Consecutive no-command steps before the loop auto-exits |
Security Recommendation
~/.laintas/policy.json and configure needs_approval rules for dangerous commands (rm -rf, curl | sh, …). Every command decision is written to ~/.laintas/audit.log for auditing.FAQ
How much does Laintas CLI cost?
The CLI tool itself is free and open source. AI calls are billed through your laintas.com account by token usage ($3.96/1M input and $7.91/1M output — same as Helpwo). Both Pro ($19.9/mo) and Gen ($49.9/mo) include 12,000 monthly AI calls for Laintas CLI. Direct system command execution (no AI) is completely free.
How does it integrate with Helpwo?
On startup the CLI registers as a remote agent via /api/agents/register and stays online with heartbeats. Open Helpwo (helpwo.laintas.com) and your machine appears in the Agent panel. The AI in Agent mode can then use remote_exec / remote_query to operate your local files and shell; sensitive operations request your approval on the CLI side first.
Is it safe to let the AI execute commands?
A built-in policy engine evaluates every command: allow (execute), needs_approval (ask first), or deny (reject). Rules are regex-based in ~/.laintas/policy.json with three modes — audit (log only), enforce, and disabled — and every decision is written to ~/.laintas/audit.log. You can interrupt a running task at any time with Ctrl+C.
Why does the download page only offer Linux and source packages?
The public download page currently ships the Linux x86-64 standalone binary and the source package. The Linux build is best for servers and daily terminal use with no Python required; the source package is best for macOS, ARM, auditing, debugging, and local modification, and requires Python 3.10+. If your platform does not have a standalone binary yet, run from source.
Does it support MCP (Model Context Protocol)?
Yes. Configure MCP servers in ~/.laintas/mcp.json — the CLI starts one subprocess per server and auto-registers their tools for the AI. The mcp Python package is required (pip install mcp); if missing, the /mcp command tells you how to install it.
Can I connect to a self-hosted backend?
Yes. Point the LAINTAS_BACKEND environment variable or the --backend flag at your self-hosted Helpwo backend. The backend protocol is POST /api/chat/stream (SSE streaming) with Cookie or Bearer token authentication.
How do I customize the AI's behavior?
Multiple layers are customizable: edit .laintas/cli.prop to change the system prompt template; register custom / commands in .laintas/commands.py; intercept command execution in .laintas/loop.py; install skill packages under ~/.laintas/skills/; and configure event hooks via ~/.laintas/hooks.json. All files take effect on save — no restart needed.
© 2026 Laintas — All rights reserved