openclaw/docs/concepts
Abhay 51e3d16be9
feat: Add Ollama provider with automatic model discovery (#1606)
* feat: Add Ollama provider with automatic model discovery

- Add Ollama provider builder with automatic model detection
- Discover available models from local Ollama instance via /api/tags API
- Make resolveImplicitProviders async to support dynamic model discovery
- Add comprehensive Ollama documentation with setup and usage guide
- Add tests for Ollama provider integration
- Update provider index and model providers documentation

Closes #1531

* fix: Correct Ollama provider type definitions and error handling

- Fix input property type to match ModelDefinitionConfig
- Import ModelDefinitionConfig type properly
- Fix error template literal to use String() for type safety
- Simplify return type signature of discoverOllamaModels

* fix: Suppress unhandled promise warnings from ensureClawdbotModelsJson in tests

- Cast unused promise returns to 'unknown' to suppress TypeScript warnings
- Tests that don't await the promise are intentionally not awaiting it
- This fixes the failing test suite caused by unawaited async calls

* fix: Skip Ollama model discovery during tests

- Check for VITEST or NODE_ENV=test before making HTTP requests
- Prevents test timeouts and hangs from network calls
- Ollama discovery will still work in production/normal usage

* fix: Set VITEST environment variable in test setup

- Ensures Ollama discovery is skipped in all test runs
- Prevents network calls during tests that could cause timeouts

* test: Temporarily skip Ollama provider tests to diagnose CI failures

* fix: Make Ollama provider opt-in to avoid breaking existing tests

**Root Cause:**
The Ollama provider was being added to ALL configurations by default
(with a fallback API key of 'ollama-local'), which broke tests that
expected NO providers when no API keys were configured.

**Solution:**
- Removed the default fallback API key for Ollama
- Ollama provider now requires explicit configuration via:
  - OLLAMA_API_KEY environment variable, OR
  - Ollama profile in auth store
- Updated documentation to reflect the explicit configuration requirement
- Added a test to verify Ollama is not added by default

This fixes all 4 failing test suites:
- checks (node, test, pnpm test)
- checks (bun, test, bunx vitest run)
- checks-windows (node, test, pnpm test)
- checks-macos (test, pnpm test)

Closes #1531
2026-01-24 22:38:52 +00:00
..
agent-loop.md feat: add tool_result_persist hook 2026-01-19 13:11:31 +01:00
agent-workspace.md style: format agent workspace and prompts 2026-01-22 08:05:55 +00:00
agent.md docs: clarify model refs and runtime notes 2026-01-17 18:03:40 +00:00
architecture.md docs: refresh nodes + pairing docs 2026-01-22 22:02:06 +00:00
channel-routing.md refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
compaction.md fix: unblock control commands during active runs 2026-01-15 07:08:48 +00:00
context.md feat(slash-commands): usage footer modes 2026-01-18 05:35:35 +00:00
group-messages.md fix: scope history injection to pending-only 2026-01-16 23:52:42 +00:00
groups.md rewrite(matrix): use matrix-bot-sdk as base to enable e2ee encryption, strictly follow location + typing + group concepts, fix room bugs 2026-01-20 11:59:11 +00:00
markdown-formatting.md fix: add per-channel markdown table conversion (#1495) (thanks @odysseus0) 2026-01-23 18:39:25 +00:00
memory.md fix: make session memory indexing async 2026-01-21 10:39:00 +00:00
messages.md fix: unify inbound sender labels 2026-01-17 05:21:09 +00:00
model-failover.md fix(auth): preserve auto-pin preference 2026-01-18 08:22:55 +00:00
model-providers.md feat: Add Ollama provider with automatic model discovery (#1606) 2026-01-24 22:38:52 +00:00
models.md docs: clarify model refs and runtime notes 2026-01-17 18:03:40 +00:00
multi-agent.md docs: add WhatsApp family binding example 2026-01-20 15:00:25 +00:00
oauth.md docs: document provider auth plugins 2026-01-16 00:42:48 +00:00
presence.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
queue.md chore: raise default agent concurrency 2026-01-20 10:08:26 +00:00
retry.md refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
session-pruning.md feat: add auth-aware cache defaults 2026-01-21 20:23:39 +00:00
session-tool.md fix: resolve session ids in session tools 2026-01-24 11:09:11 +00:00
session.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
sessions.md Docs: fix internal links 2026-01-10 14:51:33 -06:00
streaming.md docs: complete channels rename sweep 2026-01-13 08:40:39 +00:00
system-prompt.md perf: stabilize system prompt time 2026-01-24 06:24:04 +00:00
timezone.md fix: default envelope timestamps to local 2026-01-22 04:10:06 +00:00
typebox.md docs: align node transport with gateway ws 2026-01-22 23:10:09 +00:00
typing-indicators.md docs: complete channels rename sweep 2026-01-13 08:40:39 +00:00
usage-tracking.md Usage: add cost summaries to /usage + mac menu 2026-01-19 00:05:06 +00:00