openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Local-only privacy mode blocks a custom provider that runs on localhost because it judges by slug, not endpoint

Open senamakel opened this issue 3 weeks ago • 2 comments

Milestone: Nov 9 - Nov 13 · Parent: tinyhumansai/team#46

Sentry issues covered

3 Sentry issue(s), 3 events in total, up to 1 users on a single issue. Releases seen: 0.64.15.

Sentry Project Events Users Releases Last seen
TAURI-RUST-16AY tauri-rust 1 1 0.64.15 2026-10-29
TAURI-RUST-162R tauri-rust 1 1 0.64.15 2026-10-27
TAURI-RUST-162K tauri-rust 1 1 0.64.15 2026-10-27

What happens

TAURI-RUST-16AY (needs external provider llama-cpp) and 162R / 162K (needs external provider lemonade-2), 0.64.15, one user each. Both slugs are user-configured cloud_providers entries for local OpenAI-compatible servers (llama.cpp server, AMD Lemonade). With Local-only privacy mode on, chat refuses them as external, so the user cannot use a local model through a custom provider entry, which is exactly the setup the refusal message recommends.

local_only_violation treats a provider as local only if tinyinference_local::profile::is_local_provider_string recognises the slug: ollama, lmstudio, llamacpp, llama.cpp, vllm, etc. The hyphenated llama-cpp is not in the list, and any custom slug (lemonade-2) is external by definition. The configured entry's endpoint (loopback or not) is never consulted on this path, although enforce_local_only_endpoint already implements the loopback check for local-runtime endpoints.

Likely code path

  • crates/openhuman-core/src/inference/provider/factory/access_gates.rs:52 local_only_violation (slug check via is_local_provider_string), :213 enforce_local_only_inference
  • crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs:519-527: a configured cloud_providers slug is gated by enforce_local_only_inference(role, &p) before the entry (and its endpoint) is resolved
  • crates/openhuman-core/src/inference/provider/factory/access_gates.rs:197 enforce_local_only_endpoint / :85 is_loopback_endpoint (existing loopback logic)
  • Slug list: tinyinference crates/tinyinference-local/src/profile.rs LocalProviderKind::from_str_loose / kind_from_provider_string (vendored via vendor/tinyagents/vendor/tinyinference)

Suggested fix

  • For a configured cloud_providers entry, decide local vs external from its endpoint: resolve the entry first and allow it under LocalOnly when is_loopback_endpoint(entry.endpoint) is true (keep refusing LAN/remote hosts).
  • Add llama-cpp (and llama_cpp) as aliases in tinyinference's from_str_loose.
  • Tests: LocalOnly + custom slug at http://127.0.0.1:8080/v1 is permitted; same slug at a public host is refused; llama-cpp:model is recognised as local.

Done when

  • [ ] A regression test reproduces the failure (or the misreport) and passes with the fix
  • [ ] The fix is merged to main
  • [ ] The Sentry issues above are resolved in the next release, and stay quiet on builds that carry the fix

senamakel avatar Nov 09 '26 13:11 senamakel

Local-only privacy mode rejects user-configured cloud_providers entries that point at loopback endpoints, because local vs external is decided by slug (is_local_provider_string) rather than by the entry's endpoint; hyphenated slugs like llama-cpp and custom slugs like lemonade-2 are treated as external. Fix: resolve the configured entry first and allow it under LocalOnly when is_loopback_endpoint(entry.endpoint) is true, plus add llama-cpp/llama_cpp aliases in tinyinference from_str_loose, with regression tests for loopback allowed, public host refused, and llama-cpp recognized local. Low user impact (1 user per Sentry issue, workaround exists by adding a recognized slug), so p2. No candidate issue covers this same problem.

Labelled priority: p2.

tinysweeper avatar Nov 09 '26 13:11 tinysweeper