See Your AI

Running a bot on Ollama

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 it up on the dashboard

Set up this machine on Fleet (/setup) does all of it, as does seeyourai setup in a terminal:

A 2B model’s first answer can take minutes.

Set it up by hand

  1. 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.

  2. 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.

  3. 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.

What it declares

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.

Change it on the bot’s page

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.

The fleet page marks these bots Ollama, in red when the declaration would not launch.

What doesn’t work

How a web message arrives

The web channel runs seeyourai internal inject, which pastes the message in its usual <channel source="web" …> envelope and presses Enter.

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.

One message per turn

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.

How it answers

--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.

When the model forgets to reply

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.

Security