One bot can run Claude Code on a local model served by
Ollama (which speaks the Anthropic API) instead of on your
Claude login. It is a declaration in that bot’s .env; every other bot is
unaffected.
Experimental. Small models often fail at tools: they forget them, call them wrongly, or call them over and over. Try a bot on harmless work first.
Checked with Claude Code 2.1.333, Ollama 0.40.19, 2026-12-01.
Set up this machine on Fleet (/setup) does all of it, as does seeyourai setup
in a terminal:
http://127.0.0.1:11434.qwen3.5:2b (2.7 GB download). Another name
can be typed. The download goes through Ollama, shows its progress, and can be stopped;
Ollama keeps what arrived. It is refused when the disk has too little room.
Cloud models (they run on Ollama’s servers) are not offered.num_ctx is under 32768 (or unset), a copy with 32768 is made under a
free name, such as qwen3.5-2b-32k. The copy shares the files. No model is changed or
replaced, and a copy made before is used again.fallback. Both can be changed under Advanced. Remote Control is off.A 2B model’s first answer can take minutes.
Get a model that can use tools, with a big enough context. If you have no idea where to start on a small machine, try Qwen3.5 2B with text replies (below); whether it can read pictures is unproven. Ollama’s default context is 4096 tokens, and Claude Code’s own prompt is larger than that, so the model would silently see only a piece of it.
FROM <model>
PARAMETER num_ctx 32768
ollama pull <model>
ollama create my-model-32k -f Modelfile
Context costs memory on top of the weights, and the model stays loaded between
turns. Check ollama ps after the first message, and leave room for the bots
already running on the machine. 32768 is a practical minimum.
Create the bot:
seeyourai bot add mybot --dir ~/bots/mybot --provider ollama
It lists the models Ollama has and asks which, takes the context from the model’s
num_ctx, and asks how the bot should answer (below). Without a terminal, say it
all: --model NAME [--context N] [--ollama-url URL] [--replies tool|fallback|text]
(without --replies: tool). It writes the .env and adds the web channel to the
bot’s .mcp.json, so the bot is ready to run. With --repo it clones first. It checks what a launch checks, and if the
bot would not work it says why and creates nothing.
seeyourai bot run mybot, then talk to it from the dashboard’s Talk tab.
seeyourai bot new --provider ollama does the same and starts the bot, --no-thinking
included. To switch one that exists: its page (below), or seeyourai bot provider mybot ollama
--model NAME [--context N] [--fix-cmd] and seeyourai bot provider mybot claude, then a restart.
seeyourai bot provider mybot models lists what it could use.
Claude Code loads MCP tools on demand. If the model never finds reply, start
BOT_CMD with ENABLE_TOOL_SEARCH=false claude … to put every tool in the prompt
(a longer prompt), and trim the built-in ones with --tools.
Thinking off (optional). A small model can spend minutes thinking about one
message. Setup, New bot and new --no-thinking can turn it off. By hand, start BOT_CMD like this:
BOT_CMD='CLAUDE_CODE_EXTRA_BODY={\"thinking\":{\"type\":\"disabled\"}} claude --strict-mcp-config …'
Keep the backslashes: without them the shell drops the quotes, and it silently does nothing. A 2B model then wrote no thinking at all and answered in 1 to 6 seconds.
In ~/.seeyourai/bots/<name>.env:
BOT_DIR=/path/to/the/bot
BOT_PROVIDER=ollama
BOT_PROVIDER_MODEL=my-model-32k
BOT_PROVIDER_CONTEXT=32768
BOT_CMD='claude --strict-mcp-config --mcp-config .mcp.json --allowedTools mcp__web__reply,mcp__web__react "Read(//<SEEYOURAI_HOME without its first slash>/channels/<name>/web/attachments/**)"'
| key | |
|---|---|
BOT_PROVIDER |
ollama. Absent: an ordinary bot. |
BOT_PROVIDER_MODEL |
Required. Used for every model tier. |
BOT_PROVIDER_CONTEXT |
The model’s num_ctx. Without it Claude Code assumes 1M and never compacts in time. |
BOT_PROVIDER_URL |
Default http://127.0.0.1:11434. |
BOT_CLAUDE_CONFIG_DIR |
Default <SEEYOURAI_HOME>/providers/<name>/claude. Never your own ~/.claude. |
BOT_PROVIDER_ALLOW_BYPASS |
1 allows --dangerously-skip-permissions and auto mode in BOT_CMD. |
BOT_PROVIDER_REPLY_FALLBACK |
1 posts a turn’s final text when the model answered without reply (below). Default off. |
BOT_TURN_LOOKS_RUNNING_MS |
How long a turn that only looks running is watched before it counts as over (below), in ms. Default 1800000 (30 min); 300000 (5 min) to 86400000 (24 h). Read at launch. |
In the bot folder’s .mcp.json:
{ "mcpServers": { "web": { "command": "bun", "args": ["<harness>/channels/web/server.ts"] } } }
--strict-mcp-config --mcp-config .mcp.json skips the “New MCP server found”
dialog a fresh config dir would stop at. --allowedTools lets it reply without
a permission prompt per message, and read the pictures and files sent in chat, which
lie outside its folder (add and the bot’s page write that rule for you, unless the
path has a space or quote in it; --add-dir instead stops at a trust dialog). Leave out --channels and
--dangerously-load-development-channels: they do nothing here.
Config → Runs on switches a bot between Claude and Ollama. For Ollama it lists
the models installed at BOT_PROVIDER_URL (or the default address; nothing else is
ever asked), fills in the context from the model’s num_ctx, warns when that is
missing or under 32768, and asks how the bot should answer.
seeyourai bot restart <name>. A restart the bot does itself, or a relaunch after a
crash, keeps what it was started with. Until then the harness goes on typing only
at its input box, also after a switch to Claude..mcp.json. BOT_CMD changes only if you tick the box that
shows the new command. The page lists what else is needed, and what does nothing
on Ollama.BOT_CMD for a small model. Channel flags taken out of
BOT_CMD do not come back by themselves, and the bot’s Ollama conversations stay
in its own config dir.BOT_CMD still takes
its reply tool away. The page warns, and a tick takes exactly those two tools off the
list. It allows nothing: without bypass, add --allowedTools mcp__web__reply or every
reply waits for a permission prompt.The fleet page marks these bots Ollama, in red when the declaration would not launch.
incoming_mail, for example from a schedule that says so. Until then mail
waits in its inbox, and mesh doctor reports that nothing drains it.TALK_JOURNAL) still uses your Claude login. Leave
it off if this bot’s conversations should stay local.The web channel runs seeyourai internal inject, which pastes the message in
its usual <channel source="web" …> envelope and presses Enter.
reply tool alone:
Claude Code queues it. With fallback or text a message waits for its turn (next
section).<SEEYOURAI_HOME>/providers/<name>/, reset at each launch).BOT_PASTE_LATE_MS); then it counts as lost and is pasted again. One that
shows up later still would leave two copies in the box.<, >, &, word-initial @ and paths to images are escaped and control
characters dropped, so a message can’t close the envelope, forge another, press
keys, or attach a file with @path or an image’s path. It always starts with <channel, so it can’t be a /command or a
! shell line.A message counts as delivered only once submitted. Otherwise it is retried every
few seconds, and after a minute the thread says it has not arrived and why (the
full reason is in the MCP server’s log). It also waits while Ollama does not answer;
one that fails after that is an API error in the session, which the thread hears of
only with fallback or text. At least once: a crash at the wrong moment can deliver one twice.
<pasted_content id="…">.
Any message of two or more lines, or longer than about 700 characters, arrives
wrapped like that.The usual reason for a wait is a permission prompt: seeyourai bot peek <name>,
seeyourai bot answer <name> <choice>. This bot’s schedules pass the same check, but
are skipped (and logged) rather than retried. A schedule’s path to an image that exists
is typed in backticks at the end of a line, since Claude Code would attach the picture.
Claude Code folds what is typed during a turn into one next turn, with one final
text. With fallback and text that text is the answer, so the harness types a
message only when the turn before it has ended and its answer is posted.
UserPromptSubmit opens a turn, Stop and StopFailure close it
(turn.json in <SEEYOURAI_HOME>/providers/<name>/). The harness adds them to
the bot’s own settings at launch, so a running bot gets this with its next restart.BOT_TURN_LOOKS_RUNNING_MS) in which neither the session’s transcript nor a
sub-agent’s was written, while something waited to be typed all along (a machine that
slept starts the count again). Each turn ended so adds a line to
<SEEYOURAI_HOME>/providers/<name>/turns.log: when, how long it was watched, and how
long without a sign of life.--continue and --resume: after a crash the first answer may be withheld.claude the bot starts itself runs the same
hooks and is ignored by its transcript, except one that resumes the bot’s conversation,
or whose whole prompt is a web message’s envelope. A turn ended by Esc, after which
the bot goes on in a new session (/clear), ends at the first Stop of that session.--replies |
|
|---|---|
tool |
The reply tool, as on Claude. Small models forget it, or repeat it: a 2B model posted 7 or more answers to one message. |
fallback |
The same, and the turn’s final text is posted when the model forgot. |
text |
Text replies. No reply or react tool; the turn’s final text is posted. With the same 2B model, 10 of 10 messages got exactly one answer. |
Text replies are --disallowedTools mcp__web__reply,mcp__web__react in BOT_CMD
(in place of --allowedTools) together with BOT_PROVIDER_REPLY_FALLBACK=1. The web
channel then offers no tools and tells the model to answer in plain text. What that
costs: no pictures or reactions from the bot, one answer per turn, and everything the
next section says about the fallback.
Only the reply tool reaches the thread, and small models often just answer in
their session. With BOT_PROVIDER_REPLY_FALLBACK=1 a Stop hook in the bot’s own
CLAUDE_CONFIG_DIR (settings.json; the harness adds and removes it at launch)
posts the turn’s final text to the thread of the web message the turn left unanswered.
[See Your AI] I couldn't match an answer to this. Please send it
again. (A later answer to that message is not posted, only logged.) An API error gets one too, and with text replies so does an empty answer.
Reactions and subagents post nothing. All of it is logged.out line with "unmatched": ["<message id>"], once per message. If
the hook fails, its turn’s messages get one with "unsure" instead: an answer can
still follow. If even that cannot be written, the turn counts as interrupted, and they
get it then.reply into that message’s own thread, after the
message arrived. One to another thread doesn’t count, and stays where it went.out line plus "fallback_for": ["<message id>"], cut
at 8000 characters. Posts and failures are in the bot’s .watchdog/harness.log.disableAllHooks stops the launch, and
flags in BOT_CMD that skip user settings turn it off unnoticed.ANTHROPIC_*/CLAUDE* variable and it has its own CLAUDE_CONFIG_DIR. An
unknown provider, a missing model, a bad URL, a config dir that is yours, or a
BOT_CMD/project setting that would re-point it stops the launch with a reason.auto, has the model
judge its own tool calls, which is no check with a small local model. The harness
appends --permission-mode default unless BOT_CMD picks a mode, and refuses
auto mode and skipping permissions without BOT_PROVIDER_ALLOW_BYPASS=1. Small
models follow instructions hidden in what they read more readily than large ones;
allow bypass only for a bot whose account has nothing to lose. (Its first launch
then stops at Claude Code’s own warning; attach once and accept it.)BOT_CMD is one plain VAR=value … claude flags, so that what is checked is
what runs: no shell, redirection, variable other than $HOME, or --settings.reply sends files only from the bot’s own folder, nothing under a dot-name,
since it is usually allowed without a prompt. BOT_PROVIDER_ALLOW_BYPASS=1 lifts it.http URL to
another machine sends every prompt in the clear.