Skip to content

feat: support OpenAI-compatible local providers#17

Merged
benmaster82 merged 1 commit into
benmaster82:mainfrom
aladin7:writher-16-openai-compatible
Jul 19, 2026
Merged

feat: support OpenAI-compatible local providers#17
benmaster82 merged 1 commit into
benmaster82:mainfrom
aladin7:writher-16-openai-compatible

Conversation

@aladin7

@aladin7 aladin7 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Adds an opt-in OpenAI-compatible local LLM provider while preserving Ollama as the default.

Fixes #16.

What changed

  • Adds an assistant-provider selector for Ollama and OpenAI-compatible local servers.
  • Adds /v1/models discovery, /v1/chat/completions requests, optional bearer-token support, and OpenAI tool-call argument normalization.
  • Keeps separate persisted URL/model values for each provider so switching does not overwrite the other configuration.
  • Generalizes health-check errors and settings labels in English, Italian, and German.
  • Documents llama.cpp setup and the provider-specific configuration.
  • Adds provider adapter, model discovery, settings persistence, and backward-compatibility tests.

Validation

  • python -m py_compile assistant.py config.py main.py settings_window.py locales.py test_assistant.py test_settings_provider.py
  • python -m unittest discover -v — 54 tests pass
  • ruff check test_assistant.py test_settings_provider.py
  • Real loopback HTTP contract test verified GET /v1/models, POST /v1/chat/completions, tool schema submission, and returned tool-call normalization.
  • Real llama.cpp b9982 inference with Qwen3-1.7B Q4_K_M correctly selected and populated WritHer's list_notes, save_note, and create_appointment tools; the full assistant.process() path also passed.
  • Tk settings-window smoke test verified the provider, model, and URL controls render and synchronize correctly.

An end-to-end manual run was also completed successfully: WritHer captured microphone input, transcribed it, sent the command to the local llama.cpp server, parsed the returned tool call, and executed the requested action.

AI assistance: OpenAI Codex was used for specification research, implementation, and local validation.

@benmaster82
benmaster82 merged commit b1979c3 into benmaster82:main Jul 19, 2026
benmaster82 added a commit that referenced this pull request Jul 19, 2026
- injector: when the full multi-format clipboard snapshot fails (e.g.
  an app with delayed rendering holds a format), fall back to the
  historical text-only save/restore instead of aborting the paste.
  The text-only restore also skips if the clipboard changed during
  the paste. Adds fallback tests.
- README: restore a strong privacy tagline ("No cloud required, no
  account, no telemetry") and warn that pointing the OpenAI-compatible
  URL at a remote endpoint forfeits the offline/privacy guarantees.

Verified: 68 tests green, plus a real Win32 smoke test (bitmap on the
clipboard survives swap-to-text and restore with correct pixels).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Please add OpenAI compatible support

2 participants