Model orchestration
Build your own mode out of several models, let a Main model route every message to the one that fits, and keep chosen topics on a model you pick - including a local one that never sends them to the cloud.
Most AI tools give you one model per chat. Ghostli lets you build a mode: a small board of steps, each with its own model, instructions and skills. You pick the mode in the composer exactly like a model, and from then on every message goes through it. One model can plan, another can write code, a third can check the answer, and a local model on your own machine can take everything you do not want to leave it.
This page describes how that works in the current desktop app, including the limits. Nothing here is a roadmap item: if a sentence describes behaviour, the app does it today.
01 The models you can combine
Every step of a mode can use any model the app knows about. You can mix them freely in one mode.
| Source | How the request travels |
|---|---|
| Ghostli models | G-Basic and G-Max, served through Ghostli's API and counted against your plan's daily limit. |
| Your subscription | Claude (through Claude Code), ChatGPT (through Codex) and Gemini (through Google's Antigravity CLI). Ghostli runs the official command-line tool you have already signed in to as a local process, so the request goes from your machine to that provider under your own subscription. It does not pass through Ghostli's servers, and Ghostli does not store your provider login. |
| Your own API | Any OpenAI-compatible endpoint with your own key. The call is made by the desktop app straight to the URL you entered; it is never routed through Ghostli's backend. The URL and key are kept in the app's local encrypted store. |
| Local models | The same as your own API, pointed at a server on your machine - for example Ollama, LM Studio or llama.cpp on localhost. Ghostli treats a model as local when its address is localhost, 127.x.x.x, [::1] or 0.0.0.0. A request to it never leaves your computer. |
02 Modes and steps
Modes are built in the Orchestration view of the desktop app. A mode is a board: you add steps, give each one a model, and save. Saved modes appear in the composer's model menu next to the Ghostli models, under the name you gave them. You can keep up to 30 modes, each with up to 16 steps, and start from a blank board or a template: Research and verify, Code and review or Security.
| Step | What it is for |
|---|---|
| Main | Required, one per mode. Reads every message first and decides which step handles it, or plans several steps in a row. Answers anything no other step fits. |
| Coding | Live Code tasks on your project. Offered to Main only while Live Code is on. |
| Research | Web research. /research-mode, /rag and the web toggle always go here; it can also be set to research by default. |
| Pentesting | Authorised security work. Available when the Pentester integration is installed. You can list topics that help Main recognise security tasks. |
| Heavy tasks | Planning and complex work. /plan and /init always go here. |
| Verification | Checks answers with a second model, either on every answer or only when you use /verifyloop, with 1 to 3 rounds of check and fix. |
| Custom route | Your own topic, such as translation or a specific client, with a name and keywords. A mode can have several. |
Every step can also have:
- A fallback model, used when the step's model is not available (for example a subscription that is signed out).
- Instructions in your own words. Main's instructions apply to the whole mode and take priority when it decides where a message goes.
- A Tune AI mode, so one step can answer as a security architect and another as a frontend engineer.
- Skills - up to 8 skill folders, read when a request needs them. Main's skills apply to the whole mode, a step's skills only to that step.
- An exclusive rule, described in section 04.
03 What happens to one message
Inside a mode, every message goes through the same stages, in this order. Only the privacy gate can stop the rest: a message it holds skips everything after it.
- The privacy gate. If any step has an exclusive rule, the message is checked against it before anything else happens - before Main, before research, before naming the chat. If a step holds it, the message goes only to that step's model and the rest of this list is skipped. Details in section 04.
-
Commands go straight to their step.
/research-mode,/ragand the web toggle go to Research;/planand/initgo to Heavy tasks. Main is not asked. - Main decides. Main receives a short brief of each available step - what it is for, its topics, your notes - plus your instructions for Main and the last few turns of the chat, and replies with a plan: usually one step, sometimes several. Main does not answer the message in this call.
- The plan runs. A plan has at most 4 steps, each used once. Each step does only its part and hands its result to the next; the last step answers you and is told to check the earlier results rather than repeat them blindly. A typical plan is research first, then coding.
- Verification. If the mode has a Verification step set to check every answer, the answer is checked and corrected by the verification model before you see it.
- You see the route. Under each answer a small label shows the steps it took, for example Research → Coding.
When something does not answer
Orchestration is built so that a failure degrades to a normal answer, not to a stuck chat. If Main does not decide within 20 seconds or replies with something that is not a valid plan, Main answers the message itself. If a step of a plan does not finish within 3 minutes, the next step continues without its result and is told so. If a step's model is unavailable, the app tries the step's fallback, then Main's model, then Main's fallback, then G-Basic. Stop cancels every stage at once.
The one exception is a message held by an exclusive step: it never falls through to another model. See below.
04 Exclusive steps: topics that stay with one model
Any step except Main and Verification can be made exclusive. You describe in plain words what only this step's model may handle - client data, contracts, patient records, or penetration testing, targets, scan results - and optionally switch on Include messages with credentials. A message that matches is handled by that model and by nothing else.
How a message is matched
| Check | How it works |
|---|---|
| Credentials | On your device. Runs in the app before the message is sent anywhere. It looks for private keys, common API key formats (OpenAI, Anthropic, GitHub, GitLab, Slack, AWS, Google, Stripe), JWT access tokens, password=... style assignments, credentials inside URLs, card numbers that pass the Luhn check, IBANs that pass the mod-97 check, and PESEL numbers that pass their checksum. The message text and attached files are both scanned. |
| Your written rule | The step's own model. The exclusive step's model is asked a single question: does this message fall under the rule? It is instructed to answer YES when unsure. The message is shown to that model only - not to Main or any other step - so when the step uses a local model, the check itself also stays on your machine. |
| No answer | Held. If the model cannot be reached, gives no clear YES or NO, or does not answer within 30 seconds, the message is treated as matching. Slow or broken must never mean leaked. |
What a held message does not reach
- Main and the other steps. Main never reads it, so it cannot be routed or planned elsewhere.
- Other models as fallbacks. Only the step's own model and the step's own fallback are tried. If neither is available, the request fails with an error instead of moving to Main's model or G-Basic.
- Verification by another model. Automatic checking is off for that message;
/verifyloopis skipped with a notice. - Web research. No search runs for it, because a search engine would read the query too.
- The server code sandbox. Ghostli's server-side sandbox is switched off for that request.
- Chat naming. If the first message of a chat is held, the chat is named on your device from the message's first words, instead of asking a model.
- Later requests. The message and its answer are saved as private. When a later message in the same chat goes to a model that is neither the holding step nor local, the private turns are replaced by a placeholder in its history, in the context summary and in the attached-file memory. Continuing a private answer only continues it on the model that wrote it.
Private answers are marked in the chat with a Private label and the name of the model that handled them.
Example: security work that never leaves your machine
Say you want normal questions answered by a strong cloud model, but anything about penetration testing to stay on a model running on your own computer.
- Run a local model server, for example Ollama, and add it in Ghostli as a custom model with an address such as
http://localhost:11434/v1. - Create a mode from the Security template, or add a Pentesting step (or a Custom route) to an existing mode.
- Set that step's model to the local model. If you set a fallback, make it local as well.
- In Exclusive to this model, write the rule, for example: penetration testing, exploits, targets, IP ranges, scan output, client findings. Switch on Include messages with credentials if found keys and passwords should be held too.
- Give Main any cloud model you like and select the mode in the composer.
From then on a message about a pentest is checked by the local model, held by it, answered by it, and saved as private. Main, the cloud model, web search and the server sandbox never receive it. Everything else in the same chat still goes through Main as usual.
The honest limits
- The written rule is judged by a model. Credential matching is deterministic, but deciding whether a message is "about pentesting" is a language-model judgement. It is set to lean towards YES, but a model can still say NO to a message you would have held. For material that must never leave the device, put the whole chat on a local model instead of relying on the rule.
- Long inputs are judged by their beginning. The rule check reads the first 6,000 characters of the message and the first 4,000 characters of attached files. The credential scan reads all of it.
- Every exclusive step checks every message. With several exclusive steps, each one's model reads the message to decide. If one of them is a cloud model, that provider sees the messages it checks. Use local models for all exclusive steps when that matters.
- The gate exists only inside a mode. With a plain model selected in the composer, messages go to that model as usual.
- Local means local to Ghostli's knowledge. The app recognises a model as local by its address. A
localhostaddress that forwards to a remote server is still remote; that is outside what the app can see. - Settings are not content. When you are signed in, the app may still ask Ghostli's API for your Tune AI profile text before calling a custom model. That request contains your chosen Tune AI settings, not the message.
05 Ways people use it
| Mode | Setup |
|---|---|
| Code and review | Coding on your Claude subscription, Verification on ChatGPT. One model writes, a different one checks. |
| Research and verify | Research by default with a second model verifying each answer before you see it. |
| Private client work | A Custom route with a local model, exclusive for one client's name and data, with credentials held. Everything else on G-Max. |
| Cost control | G-Basic as Main for everyday questions, a stronger model only on Heavy tasks for /plan and large changes. |
For how Ghostli handles your token, local data and workspace in general, see the Security page and About Ghostli. Questions or a claim on this page that does not match what the app does? Tell us on Discord.