QuantCraft AI
QuantCraft includes a built-in AI assistant in the right sidebar of the IDE (Workspace layout) — a chat panel that helps you write and edit trading-strategy Python with awareness of your workspace. It can see the file open in the editor, any files you @-mention, and outlines of your other open files, so its answers and edits are in context. It works like an in-IDE coding agent: it can create new files or edit existing ones for you in one chat turn.
To use it, open the right sidebar and switch to the QuantCraft AI tab. The model you connect is app-wide — the same connection powers this chat and the AI Prompt nodes in Agents. Use the Python editor and Running code to validate any suggested strategy changes in Test / Run.
There is also a Documentation panel in the same sidebar — a static reference for the strategy API (lifecycle, OHLCV, indicators, fundamentals, factors, inputs, account). See Reference.
Assistant modes
| Mode | What it does |
|---|---|
| Chat | Advice and explanations only — no file edits. |
| Plan | Produces a structured implementation plan — no edits. |
| Agent | Creates and edits workspace files. Proposed edits go through an Accept / Undo review and changed lines are highlighted in the editor. An optional Auto-continue agent turns setting keeps the assistant going after each file-changing reply until it finishes or you press Stop. |
Connecting a model
QuantCraft AI works with several providers. Some are bring-your-own-key (billed to your own provider account); QuantCraft Premium and the hosted options run on managed access instead. Open Connect model at the bottom of the chat (or AI → Connect Model in the top menu), pick a provider, then fill its fields.
| Provider | What you set |
|---|---|
| Anthropic (Claude) | API key, Claude model, optional "Extended thinking". The most fully supported path. Get a key from console.anthropic.com. |
| QuantCraft Premium | No key — access is assigned to your account; shows provider, status, balance, and expiry (Claude or DeepSeek grant). |
| DeepSeek | API key, DeepSeek model, optional "Extended thinking". |
| DeepSeek (hosted) | No key stored (uses the server's key); requires sign-in. |
| Custom LLM | Endpoint URL, Model name, and an optional API key (bearer token). |
GitHub Copilot and Cursor may appear in the Connect Model list, but chat turns are not wired yet (UI stubs). Use Anthropic, DeepSeek (BYOK or hosted), QuantCraft Premium, or Custom LLM.
Paste the key (where required), choose the model, and click Save.
Custom LLM
Use Custom LLM to connect your own or a self-hosted, OpenAI-compatible model.
| Field | Notes |
|---|---|
| Endpoint URL | The OpenAI-compatible base URL — e.g. Ollama, llama.cpp, or vLLM (http://localhost:11434/v1). |
| Model name | The model id served by that endpoint (e.g. qwen2.5-coder:7b-instruct). |
| API key | Optional bearer token — leave blank for a local server that needs none. |
The connection counts as ready once the URL is set. In the desktop app, HTTP to providers goes through Tauri’s HTTP plugin; localhost / 127.0.0.1 endpoints are in scope. Arbitrary remote Custom LLM hosts are not user-configurable via an allow-list UI — prefer a local OpenAI-compatible server or a provider already supported above.
Where keys live: bring-your-own-key values are stored only on your machine (in the desktop app's local config, or this browser's local storage). They are never uploaded to QuantCraft and are only sent to the provider you selected. If you wipe your browser data or move to another computer, you will need to re-enter the key.
Where requests go: for a bring-your-own-key provider, QuantCraft AI calls the provider directly from your machine using your key. The desktop (Tauri) app uses an HTTP bridge so requests aren't blocked by browser CORS — running QuantCraft AI in the browser version may show a CORS-related "Request failed" message; use the desktop build for the best experience.
Picking a model
Each provider has a model dropdown next to the key field. The connection badge at the bottom of the chat shows the active provider and short model name (for example Anthropic (Claude) · Claude Sonnet 4.6). Multiple providers can be saved — the badge shows the most recently used one with a +N suffix when more than one key is present.
For Anthropic, the dropdown lists Claude Sonnet 4.6, Claude Opus 4.8, Claude Opus 4.7, Claude Haiku 4.5, and other current Opus / Sonnet variants. Choose the one your account has access to. If you try to send a message on the Anthropic path without a saved key, the assistant replies with a reminder to add one.
Using the chat
- Type in the composer and press Enter to send, Shift+Enter for a newline.
- Type
@to open a file-mention menu and pull another workspace file into context. - Replies render as markdown with code blocks.
- Stop aborts an in-progress reply.
Composer and attachments
- Attach files button — opens a file picker. You can also drag and drop files onto the input area, or paste a file/image from the clipboard.
- A row of attachment chips above the textarea shows every file you've queued. Each chip has its name (and a thumbnail for images) and an × to remove it.
- Any file type is accepted. Image files show a small inline thumbnail in the message stream after sending.
- Attachments belong to the message you send them with — they're shown alongside that message in the chat history.
While the assistant is generating a reply, the composer is disabled with a "Please wait…" placeholder and a small status row appears in the message list (e.g. Building API messages…, Streaming reply… 1,234 characters, Syncing to workspace folder on disk…).
Chat sessions
QuantCraft AI keeps a history of chat sessions. Each session is its own conversation, with its own messages and attachments. The bar at the top of the chat panel has:
- New chat — starts a fresh, empty session. Disabled while the assistant is working, while you have a pending file edit, or if your current chat is already empty.
- Chats — a dropdown listing every saved session, newest first. Each entry shows its title (auto-derived from the first user message) and the last update time. Click a row to switch, or press the trash icon to delete it.
Sessions are persisted automatically (in the desktop app to its local config, otherwise to browser local storage) and survive reloads and restarts. Switching chats and creating new ones is blocked while a reply is streaming or while you have an unresolved Accept/Undo bar — finish or undo the change first.
What the assistant can see
Each time you send a message, QuantCraft AI builds the request from:
- The bundled QuantCraft developer docs (so it knows the lifecycle, account API, OHLCV / fundamentals modules, indicator series, and so on).
- A fresh workspace snapshot — the linked workspace folder path, the file currently open in the editor, and the list of open tabs and folders.
- The prior turns of the active chat session (your messages and its replies).
- Your new message plus any attachments.
This is why picking a workspace folder in the Files sidebar matters — without one, the assistant can still answer questions, but it cannot write files to disk and will tell you so.
File edits from the assistant
In Agent mode the assistant can return one or more file actions in a single reply: create a new file, edit the file currently in the editor, or edit a specific named file in the workspace. When that happens:
- New files appear as a new tab in the linked folder; existing files are updated in place in their tab.
- The editor jumps to the changed location and highlights the changed lines so you can review what the assistant did.
- A pending bar appears at the bottom of the chat with a short summary, plus two buttons:
- Accept — keep the change. The highlight is removed and you can carry on chatting.
- Undo — revert the change. For an edit, the previous file content is restored. For a new file, the new tab is removed.
- Until you Accept or Undo, the chat is frozen — you can't switch sessions or send another message. This is intentional: it makes sure you actively review every change.
- For multi-file replies, the bar tells you how many changes were applied. The Undo button reverts only the last step, so review highlights tab-by-tab if needed.
Files are also synced to the linked workspace folder on disk (in the desktop app). When you're running the browser version, files are still updated in the editor and tabs, but they are not mirrored to disk — the reply notes this so you know to use the desktop build for full file integration.
Tools
Tools are external data services the chat model can call while answering. Add them from AI → Add Tool.
- The available tool is LLMQuant Data — enable it with the Enable for chat checkbox and paste an API key (there's a "Get a key" link).
- Once enabled, the assistant can fetch live data mid-conversation across categories such as wiki and research papers, equity and crypto prices, ETF lookups and holdings, macro indicators, SEC filings and 13F holdings, and prediction-market data.
Tools attach only on working chat providers (Anthropic, DeepSeek, Premium, Custom LLM). Copilot / Cursor are not implemented for chat, so tools never run on those selections.
MCP servers
MCP (Model Context Protocol) servers expose their own tools to the assistant. Add and manage them from AI → Add MCP. Each saved server has an Enabled for chat toggle plus Edit / Remove, and tools from enabled servers become available to the chat.
To add one, choose a Transport:
| Transport | Fields |
|---|---|
| Stdio (command) | Command (e.g. npx, node, python), Args (one per line or space-separated), and Env (KEY=VALUE lines). |
| HTTP (Streamable) | URL and optional Headers (KEY=VALUE lines, e.g. Authorization=Bearer …). |
Give the server a Name, use Test connection to check it (it reports how many tools the server exposes), then Apply to add it to the list and Save to persist.
AI Prompt nodes in Agents
Inside an Agent you can add an AI Prompt node — the AI counterpart of a Strategy node.
- You write a single free-text prompt asking a yes/no question, e.g. "Given the recent price action and fundamentals, is this a bullish setup?" There are no structured rules.
- A Data sent to the AI section shows chips for the upstream data the model receives (OHLCV window, fundamentals, etc.). Link a Data parent, or the node warns that the AI has no inputs.
- The AI's answer is forced to true / false, and that result gates the node's children through the upstream gate — exactly like a Strategy result.
Which model runs it depends on your active connection:
- QuantCraft Premium — the call runs on the backend using your assigned access.
- Bring-your-own-key (Anthropic, DeepSeek, or Custom LLM) — the call runs from the app using your own key, which is never sent to the backend.
During an Agent Test, AI Prompt token usage is tracked per agent and shown as a monthly badge in the editor header (it resets each calendar month).
Tips
- Link a workspace folder first. In the Files sidebar, choose your project folder. Without one, the assistant can answer questions but cannot create or edit files on disk.
- Be explicit about file paths. When asking for an edit, mention the tab title or a path like
utils/foo.py. The assistant matches both. - Use Undo freely. It's safer to let the assistant try a multi-file change and undo than to micro-manage each step — undo restores the editor buffer instantly.
- Switch models per task. Use a faster Claude model for routine edits, a stronger one (Opus) for big refactors or strategy design.
- Keep keys safe. Bring-your-own-key values live only on this machine. Treat them like passwords — don't paste them anywhere outside the Connect model dialog.
