v3.4.0 — Local Ollama support for extract_with_llm
Adds local-LLM support to extract_with_llm via Ollama. Cloud users see zero behavior change — the addition is strictly opt-in.
Highlights
- New Ollama provider for
extract_with_llm. Setprovider: "ollama"to extract using a local Ollama model — no API key, no API costs, no data leaving the machine. - Beginner-friendly defaults: base URL
http://localhost:11434, modelllama3.2. Both overridable viaOLLAMA_BASE_URL/OLLAMA_DEFAULT_MODELenv vars or per-callmodelparam. - Structured outputs: when the optional
schemaparam is provided, it is passed through as Ollama's structured-outputsformatobject — model output is constrained to the schema. - No new runtime deps — same raw-
fetch()pattern as the existing OpenAI/Anthropic branches. Calls Ollama's/api/chatwithstream: false,temperature: 0. - Friendly errors:
Ollama is not running at <url>. Start it with "ollama serve" and pull a model: "ollama pull llama3.2".on connection refused; install hint on 404 model-not-found. - Backwards-compatible auto-fallback:
provider: "auto"keeps the existing Anthropic → OpenAI order and only falls back to Ollama when no cloud key is set andOLLAMA_BASE_URLis exported.
Usage
// Local model, no API key needed
await tool.execute({
content: "The iPhone 16 Pro costs $999 and has a 6.3-inch display.",
prompt: "Extract product name, price, and screen size.",
provider: "ollama"
});
// Structured outputs with JSON schema
await tool.execute({
content: "Order #4421: 3x widgets at $5.50 each...",
prompt: "Extract the order information.",
schema: { type: "object", properties: { /* ... */ }, required: [/* ... */] },
provider: "ollama"
});Verification
node --test tests/unit/extractWithLlm.test.js: 22/22 pass (14 pre-existing + 8 new Ollama tests).npm testMCP protocol compliance: 10/10 tests completed, 0 errors — unchanged from baseline.- Live end-to-end against real Ollama 0.24.0 with
llama3.2:latest: 3/3 scenarios pass — plain JSON mode, structured-outputs schema, andprovider: "auto"fallback.
Install
npm i crawlforge-mcp-server@3.4.0
Full changelog: CHANGELOG.md