#Clawbot says my context size is set to 4096 which is below 16000

1 messages · Page 1 of 1 (latest)

rustic basin
#

Idk why its saying this. It was doing it with ollama with llama3.2 for testing and even with deepseek api which I know for a fact has a bigger context size than 4096...

lilac coyoteBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

high lichenBOT
#

That warning is almost always OpenClaw reading your configured contextWindow, not the provider’s advertised max context.

Two common ways you end up with 4096 even when the model can do more:

  1. You added Ollama/DeepSeek via the “Custom / OpenAI-compatible endpoint” wizard
    In that flow OpenClaw currently writes a conservative placeholder model entry like:
    contextWindow: 4096 (and maxTokens: 4096).
    OpenClaw can’t reliably auto-detect context size from generic OpenAI-compatible endpoints, so it won’t magically know DeepSeek is bigger.

  2. You created an explicit models.providers.ollama (or custom provider) block
    That disables Ollama auto-discovery, so you’re stuck with whatever you hardcoded (often 4096).

What to do

  1. Check what OpenClaw thinks your model is:
openclaw --version
#
openclaw models list

Look for your active model and the ctx … column.

  1. Fix the model entry in config by setting contextWindow to the real context size for that model (and optionally maxTokens for output):
openclaw config get models.providers
# then:
openclaw config set models.providers.<provider>.models[<index>].contextWindow 32768 --json
openclaw config set models.providers.<provider>.models[<index>].maxTokens 8192 --json
openclaw gateway restart

If this is Ollama specifically (recommended path)

Use the built-in Ollama provider + auto-discovery instead of “custom”:

#

If you paste 2 things, I can tell you exactly where it’s coming from

  • openclaw models list (just the few lines showing the model you selected)
  • the relevant models.providers... block from your config (redact API keys)

Docs that explain the pieces:

rustic basin
#

How am I supposed to format my model id

high lichenBOT
#

Model “refs” in OpenClaw are always:

providerId/modelId (split on the first /)

So:

  • providerId = the provider name (e.g. ollama, openrouter, or whatever key you put under models.providers)
  • modelId = the exact string the upstream API expects (and it can contain : or even extra /)

Common cases

Ollama (auto-discovery):

  • Use exactly what ollama list shows as the model tag.
  • Example shape: ollama/<ollama-tag>
    • (<ollama-tag> might look like llama3.2 or llama3.2:latest)

OpenRouter-style (model id contains slashes):

#
  • Still provider/modelId, but modelId includes /:
  • Example shape: openrouter/moonshotai/kimi-k2 (provider is openrouter, modelId is moonshotai/kimi-k2)

Custom OpenAI-compatible endpoint (DeepSeek, proxies, etc.):

  • If you configured a custom provider key like deepseek under models.providers, then you’d use:
  • deepseek/<modelId>
  • Where <modelId> is whatever you would pass as "model": "..." to /v1/chat/completions on that endpoint.

Easiest way to confirm what OpenClaw expects on your setup

Run:

openclaw models list

…and paste the line(s) for the provider/model you’re trying to use. That output reflects the exact providerId/modelId OpenClaw currently knows about.

rustic basin
#

Does the fact that I used just llama3.2 instead of ollama/llama3.2 have to do with the context issue

high lichenBOT
#

It can, but only indirectly.

OpenClaw doesn’t infer context size from the string you type (llama3.2 vs ollama/llama3.2). The 4096 number is coming from whatever model entry OpenClaw ended up selecting (its contextWindow field).

What does change when you type just llama3.2:

  • If there’s no provider/ prefix, OpenClaw treats it as an alias or as a model under the default provider (per the docs).
  • That means you might accidentally be selecting a different model record than you think (often a “custom provider” entry created by the wizard, which defaults to contextWindow: 4096).

Quick way to confirm

In chat, run:

  • /model status

or on the host:

openclaw models list
#

Look at the actual selected ref. If it’s something like custom-.../llama3.2 (or any non-ollama/... provider), that explains the 4096 warning.

What to do

  • Prefer explicitly: ollama/llama3.2
  • If you want to type llama3.2 without the prefix, set an alias that points to ollama/llama3.2 (otherwise it’s ambiguous).

If you paste the output of /model status (or the line from openclaw models list for that model), I can tell you exactly which provider entry is giving you the 4096.

rustic basin
#

custom-127-0-0-1-11434/llama3.2 - - - - default,configured,missing

high lichenBOT
#

Yep — that line is basically the smoking gun.

You’re not using the built-in ollama provider at all. You’re using a custom provider you created that points at Ollama:

custom-127-0-0-1-11434/llama3.2

When you set up a “custom OpenAI-compatible endpoint”, OpenClaw writes a placeholder model definition with a conservative default contextWindow: 4096 (so it can’t assume your real context size). That’s what triggers the “4096 below 16000” warning.

Also, the flags at the end include missing, which usually means “this provider/model isn’t actually usable right now” (often because no API key/env var was set for that provider entry).

Fix (recommended): use the real Ollama provider

  1. Make sure Ollama is enabled for OpenClaw by setting an env var (any value works):
  • OLLAMA_API_KEY=ollama-local
  1. Then pick the model explicitly with the provider prefix:
  • ollama/llama3.2
#
  1. Restart the gateway after changing env/config.

Docs: https://docs.openclaw.ai/providers/ollama

Alternative fix: keep the custom provider, but set contextWindow yourself

If you want to keep using custom-127-0-0-1-11434/llama3.2, you need to edit that provider’s model entry and set contextWindow to the real value.

If you run /model status and paste it, I can tell you exactly what OpenClaw is selecting and where to edit it.

rustic basin
#

Current: custom-127-0-0-1-11434/llama3.2
Default: custom-127-0-0-1-11434/llama3.2
Agent: main
Auth file: ~.openclaw\agents\main\agent\auth-profiles.json

[custom-127-0-0-1-11434] endpoint: http://127.0.0.1:11434/v1 api: openai-completions auth: missing
• custom-127-0-0-1-11434/llama3.2 (llama3.2)

high lichenBOT
#

That /model status output explains everything:

  • You’re currently using custom-127-0-0-1-11434/llama3.2 (a custom OpenAI-compatible provider pointing at Ollama)
  • And it says auth: missing → so OpenClaw considers that provider not usable right now
  • The “context size 4096” warning comes from the custom-provider wizard defaulting contextWindow to 4096 for that model entry.

Recommended fix: use the real Ollama provider (ollama/...)

  1. Enable Ollama provider discovery by setting an API key (any value works; it’s just an opt-in flag):
  • Bash:
export OLLAMA_API_KEY="ollama-local"
openclaw gateway restart
  • PowerShell (current shell only):
#
$env:OLLAMA_API_KEY="ollama-local"
openclaw gateway restart
  1. Then switch the model:
  • In chat: /model ollama/llama3.2
  • Or CLI:
openclaw models set ollama/llama3.2

(After restart, openclaw models list should show ollama/... entries.)

Docs: https://docs.openclaw.ai/providers/ollama

If you want to keep the custom provider

#

You must at least set:

  • an apiKey (any dummy string), and
  • contextWindow to the real value for that model.

Example:

openclaw config set 'models.providers["custom-127-0-0-1-11434"].apiKey' "ollama-local"
openclaw config set 'models.providers["custom-127-0-0-1-11434"].models[0].contextWindow' 131072 --json
openclaw gateway restart

If you paste your openclaw models list line(s) for the ollama/ provider after setting OLLAMA_API_KEY, I can sanity-check that it’s picking up the right context window.

rustic basin
#

Model "ollama/llama3.2" is not allowed. Use /models to list providers, or /models <provider> to list models.

high lichenBOT
#

That error is an allowlist issue, not a model-id-format issue.

If agents.defaults.models is set in your config, OpenClaw treats it as “these are the only models you’re allowed to select”. Right now your allowlist likely only includes your custom-127-0-0-1-11434/llama3.2, so ollama/llama3.2 gets blocked.

Fix options

Option A (recommended): add Ollama model to the allowlist

On the machine running the gateway:

PowerShell:

openclaw config set 'agents.defaults.models["ollama/llama3.2"]' "{}" --json
openclaw gateway restart

(You can also add an alias if you want, e.g. "{ alias: 'llama' }" as JSON5.)

#

Option B: remove the allowlist entirely (quickest for testing)

openclaw config unset agents.defaults.models
openclaw gateway restart

Also make sure the Ollama provider is enabled

After you fix the allowlist, if you see auth: missing for ollama too, enable it:

  • Set env var OLLAMA_API_KEY (any value works), or set it in config:
openclaw config set models.providers.ollama.apiKey "ollama-local"
openclaw gateway restart

Then try:

  • /models (or /model) and select ollama/llama3.2 again.
rustic basin
#

01:31:50 [diagnostic] lane task error: lane=main durationMs=20 error="Error: Unknown model: ollama/llama3.2"
01:31:50 [diagnostic] lane task error: lane=session:agent:main:main durationMs=24 error="Error: Unknown model: ollama/llama3.2"
17:31:50 Embedded agent failed before reply: Unknown model: ollama/llama3.2

high lichenBOT
#

That log means OpenClaw’s model registry doesn’t currently contain ollama/llama3.2 — i.e. the Ollama provider isn’t enabled / hasn’t discovered models, so when you try to switch to ollama/... it can’t find it.

Right now you only have the custom provider configured (custom-127-0-0-1-11434), and it’s auth: missing.

Fix: actually enable the built-in Ollama provider (so ollama/... exists)

Best on Windows (doesn’t depend on service env vars): add an auth profile

Run on the gateway machine:

openclaw models auth add

Then in the prompts:

  • provider: ollama
  • API key/token: put any string (e.g. ollama-local) — Ollama doesn’t require a real key, OpenClaw uses this as the “enable discovery” toggle.
#

Then:

openclaw gateway restart
openclaw models list

You should now see ollama/... models in the list, and /model ollama/<something> will work.

If ollama/llama3.2 still doesn’t show up

Auto-discovery filters out models that don’t report tool support, so llama3.2 might be getting skipped. In that case either:

  • pick an Ollama model that does show up under ollama/... (from openclaw models list), or
  • define Ollama explicitly with a manual models list (more work), or
  • keep using your custom provider and just bump its contextWindow (to fix the 4096 warning).

If you paste the openclaw models list output after adding the ollama auth profile, I’ll tell you which ollama/... entries you can select (and whether llama3.2 is being filtered).

rustic basin
#

ollama/llama3.2 - - - - default,configured,missing

high lichenBOT
#

That line means: OpenClaw sees you referencing ollama/llama3.2, but it still can’t actually use it because the Ollama provider is not enabled/available:

  • missing = the model isn’t currently present in the resolved provider catalog (so it can’t be selected)
  • for Ollama, that usually happens because no OLLAMA_API_KEY / ollama auth profile is configured, or Ollama isn’t reachable.

Do this on the machine running the Gateway (Windows-friendly)

  1. Add an auth profile for Ollama (any value works):
openclaw models auth add

Pick provider ollama, and for the key/token enter something like ollama-local.

  1. Restart the gateway:
openclaw gateway restart
#
  1. Verify Ollama models are discovered:
openclaw models list

You should now see ollama/... entries with a real ctx value (not -).

Important gotcha: llama3.2 might not be tool-capable

OpenClaw’s Ollama auto-discovery filters to models that report tool support. If llama3.2 doesn’t advertise tools, it will stay “missing/unknown” even if Ollama is enabled.

In that case, pull and use a tool-capable model (examples from the docs):

ollama pull gpt-oss:20b
# or qwen2.5-coder:32b, deepseek-r1:32b, llama3.3, etc.

Then select it as ollama/gpt-oss:20b (or whatever shows up in openclaw models list).

If you paste the openclaw models list lines that start with ollama/, I’ll tell you which ones are actually selectable on your setup.

rustic basin
#

I only have 12gb of vram... so I can't use those models

high lichenBOT
#

VRAM isn’t the blocker for the context warning — that warning is purely because your custom provider entry has contextWindow: 4096.

With 12GB VRAM, the practical issue is: many smaller local models either don’t support tool-calling (so OpenClaw won’t auto-discover them as “tool capable”), or they do but are pretty unreliable at it. That’s why the docs examples tend to use bigger locals.

What you can do (works with your current setup)

Since you’re already using:

custom-127-0-0-1-11434/llama3.2 (Ollama via OpenAI-compatible endpoint)

Just fix that provider’s config:

  1. Give the provider a dummy key so it stops showing auth: missing (Ollama doesn’t require it, OpenClaw just uses it as “enabled”):
openclaw config set 'models.providers["custom-127-0-0-1-11434"].apiKey' "ollama-local"
  1. Set the context window to what you want (pick a real number your model supports):
#
openclaw config set 'models.providers["custom-127-0-0-1-11434"].models[0].contextWindow' 8192 --json
openclaw config set 'models.providers["custom-127-0-0-1-11434"].models[0].maxTokens' 4096 --json
openclaw gateway restart

If you’re not sure what llama3.2 supports in your Ollama build, run:

ollama show llama3.2

(or ollama show llama3.2 --modelfile) and look for the context length, then set that number.

If your goal is “use local on 12GB VRAM”

Totally doable, but you’ll want to pick a small model that actually supports tools/function calling in Ollama. The best “what works on 12GB” info changes fast, so it’s worth asking in the server’s #models channel with your GPU + VRAM + whether you’re on Ollama or LM Studio.

If you paste your models.providers["custom-127-0-0-1-11434"] block (redacting keys), I can point to the exact array index to edit (in case models[0] isn’t the right one).

rustic basin
#

C:\Users\hhunh>openclaw config set 'models.providers["custom-127-0-0-1-11434"].apiKey' "ollama-local"

🦞 OpenClaw 2026.2.12 (f9e444d) — End-to-end encrypted, drama-to-drama excluded.

Error: Config validation failed: <root>: Unrecognized key: "'models"

high lichenBOT
#

That’s just Windows cmd.exe quoting biting you.

In Command Prompt (C:\Users\...>), single quotes aren’t treated as quotes, so OpenClaw literally receives the key path starting with "'models → hence:

Unrecognized key: "'models"

Easiest fix: run the command in PowerShell

Open PowerShell (powershell or pwsh) and run:

openclaw config set 'models.providers["custom-127-0-0-1-11434"].apiKey' 'ollama-local'
openclaw config set 'models.providers["custom-127-0-0-1-11434"].models[0].contextWindow' 8192 --json
openclaw config set 'models.providers["custom-127-0-0-1-11434"].models[0].maxTokens' 4096 --json
openclaw gateway restart

If you want to stay in cmd.exe

#

You need to use double-quotes and escape the inner quotes:

openclaw config set "models.providers[\"custom-127-0-0-1-11434\"].apiKey" "ollama-local"

(and similarly for the other paths)

One more quick sanity check

If your custom provider has more than one model entry, models[0] might not be the llama3.2 one. If you paste the output of:

openclaw config get 'models.providers["custom-127-0-0-1-11434"]' --json

…I’ll tell you the correct index to edit.

rustic basin
#

can I use deepseek

high lichenBOT
#

Yes — if you mean DeepSeek’s hosted API, you can use it in OpenClaw. Your 12GB VRAM doesn’t matter for that (it’s remote).

DeepSeek is OpenAI-compatible, so you add it as a custom provider in models.providers:

  • baseUrl: https://api.deepseek.com/v1 (DeepSeek also documents https://api.deepseek.com as base; /v1 is the “OpenAI-compatible base URL”)
  • api: openai-completions
  • apiKey: your DeepSeek API key
  • models[].id: whatever model id DeepSeek tells you to use (copy/paste from their docs)
  • and set contextWindow to the real value for that model (otherwise you’ll keep getting the “4096” warning)

If you want, paste your current models.providers block (redact keys) and I’ll point out exactly what to add/change.

DeepSeek docs (for base URL + model IDs): https://api-docs.deepseek.com/

rustic basin
#

how to pair my discord account

high lichenBOT
#

Pairing on Discord means: you DM your OpenClaw Discord bot once, it generates a pairing code, and then you (as the gateway operator) approve that code on the machine running the Gateway.

1) Make sure Discord is enabled + the bot token is configured

In openclaw.json (JSON5):

{
  channels: {
    discord: {
      enabled: true,
      token: "YOUR_BOT_TOKEN",
    },
  },
}

(Env fallback also works for the default account: DISCORD_BOT_TOKEN=...)

#

Docs: https://docs.openclaw.ai/channels/discord

2) Invite the bot to your server, then start/restart the Gateway

openclaw gateway restart

3) DM the bot from your Discord account

Just send “hi” in a DM to the bot. With the default DM policy (pairing), that will create a pending pairing request + a code.

4) Approve the pairing code (run this on the Gateway machine)

openclaw pairing list discord
openclaw pairing approve discord <CODE>

Pairing codes expire after ~1 hour.