Skip to content

v3.4.0 — Local Ollama support for extract_with_llm

Choose a tag to compare

@mysleekdesigns mysleekdesigns released this 18 May 01:19
· 72 commits to main since this release

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. Set provider: "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, model llama3.2. Both overridable via OLLAMA_BASE_URL / OLLAMA_DEFAULT_MODEL env vars or per-call model param.
  • Structured outputs: when the optional schema param is provided, it is passed through as Ollama's structured-outputs format object — 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/chat with stream: 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 and OLLAMA_BASE_URL is 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 test MCP 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, and provider: "auto" fallback.

Install

npm i crawlforge-mcp-server@3.4.0

Full changelog: CHANGELOG.md