Skip to content

feat: improve macOS support and local LLM (GPT4All) compatibility#3

Open
lmntrixace wants to merge 1 commit into
rohansx:mainfrom
lmntrixace:fix/llm-url-resolution
Open

feat: improve macOS support and local LLM (GPT4All) compatibility#3
lmntrixace wants to merge 1 commit into
rohansx:mainfrom
lmntrixace:fix/llm-url-resolution

Conversation

@lmntrixace

Copy link
Copy Markdown

Issue

Two issues were affecting users on macOS running GPT4All:

  1. entities list returned no results even after downloading models. The CLI was searching for models in ~/.cache/ctxgraph/models (a Linux path), while the macOS downloader saves them to ~/Library/Caches/ctxgraph/models. This prevented the extraction pipeline from being loaded.

  2. LLM escalation failed: 404 Not Found when pointing CTXGRAPH_LLM_URL at a local server. The code used the provided URL literally (e.g. .../v1) without appending the required /chat/completions path. Additionally, when a local model like GPT4All correctly rejected the "Strict JSON Schema" request format it doesn't support, the fallback to simple prompt-based extraction was never triggered.

Environment

  • OS: macOS
  • Rust Version: rustc 1.96.0 (stable)
  • Local LLM: GPT4All (Reasoner v1 on http://localhost:4891)

Fix

  1. Updated find_models_dir in mod.rs to use ModelManager::default_cache_dir() — the same cross-platform path logic the downloader already uses — so the CLI and downloader always agree on where models live.

  2. Added ensure_chat_path in llm_extract.rs — a small private helper that appends /chat/completions to any URL missing it, applied across all three env-var loading paths.

  3. Changed the extract method from if let Ok to match so any error from the strict JSON attempt (including a 400/404 from an unsupported local model) correctly triggers the simpler fallback extraction method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant