AI assistant
plain text in, a draft out, nothing executed.
The assistant turns a sentence such as "Long ETH with 3 take-profits at +2, +4 and +6 %, stop 3 % below, 200 USDT" into a Smart Trade or bot draft, and explains trades, bots and backtests. It uses the operator's own language model and never places an order.
01Set it up (operator)
- Get an API key from Anthropic, or from any OpenAI-compatible provider (OpenAI, OpenRouter and others). Or run a local model with Ollama or vLLM.
- In the console, AI assistant: choose the provider, enter the model name, and a base URL only if it is not the provider's own (Ollama:
http://<host>:11434/v1). Set the requests per user and hour (default 20). - In the console, Integrations: paste the LLM API key and press Test. It makes one small live call.
Or use the KESTREL_AI_* variables (Configuration). The assistant is on only when provider, model and key are all set; otherwise its routes answer 501 and the app hides it.
A hosted model is paid per use (per token) to your provider, on your account. The per-user hourly limit and the per-plan AI limit cap how many requests each user can make. A local model has no per-use fee.
02Draft a trade or a bot
- Open AI assistant. Optionally choose the account and the symbol.
- Describe the trade or bot in plain text (up to 4 KB).
- Review the draft. It shows the strategy, market, side, size, entry, stop and any warnings. It is marked "Not submitted".
- Open in builder. The Smart Trade builder or the bot wizard opens filled in, marked "Drafted by the AI assistant — review every field. Nothing was submitted." You check it and send it yourself.
03What the server checks
- The draft is validated with the same rules as a Smart Trade or bot typed in the app: sizes add up to 100 %, spot is long only, targets are on the right side of the entry, short bots need futures, indicator rules within the rule builder's limits.
- The account comes only from the user's own choice, never from the model.
- Leverage above the market's maximum is clamped, with a warning.
- The model sees the account's exchange and mode and the symbol's type, maximum leverage, minimum amount and last price. Never balances or keys.
- The user's text is sent to the model as data, separate from the fixed instructions, and the model must answer in a fixed format. A draft that fails the checks is refused.
04Explain
Explain on a Smart Trade, a bot or a backtest result returns a plain-language summary, key points and risks, built only from the user's own stored record (Smart Trades with their last 30 events, bots with their last 30 log lines). A backtest explanation is labelled simulated.
05Privacy and limits
The API key is read only on the server, never logged and never returned by any endpoint. Text the user types is sent to the provider you chose, so name that provider in your privacy policy. Each user may make 20 requests an hour by default (429 beyond it). Provider errors are shown with a fixed message, never the provider's raw text.
The assistant can misread a request. That is why it only drafts: every field is checked by the user before anything is sent.