Add OpenAI-compatible endpoint support#1
Open
Simsalaba wants to merge 1 commit into
Open
Conversation
Adds OpenAICompatibleClient as a drop-in alternative to OllamaClient.
Works with any provider implementing the OpenAI /v1/chat/completions API
(Together AI, Fireworks, Cerebras, LM Studio, llama.cpp server, etc.)
- Auto-detects endpoint type: probes /api/tags for Ollama, falls back to OpenAI-compatible
- Same interface as OllamaClient — zero pipeline changes required
- warmup() is a no-op for cloud APIs (no model preloading needed)
- API key via --api-key flag or LLM_WIKI_API_KEY / OPENAI_API_KEY env vars
- --api-key added to both `wiki check` and `wiki ingest chatgpt`
- Endpoint type shown in startup output (Ollama vs OpenAI-compatible)
Usage:
wiki ingest chatgpt --triage-mode none \
--extra-url https://api.together.xyz/v1 \
--api-key sk-...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenAICompatibleClientas a drop-in alternative toOllamaClient--api-keyflag towiki ingest chatgptandwiki checkLLM_WIKI_API_KEYorOPENAI_API_KEYenv varsUsage
Compatible providers
Tested API shape: Together AI, Fireworks, Cerebras, LM Studio, llama.cpp server.
Any provider implementing
/v1/chat/completions+/v1/modelsshould work.Test plan
wiki checkwith an OpenAI-compatible URL shows correct endpoint typewiki checkwith unreachable URL fails fast (5s timeout)wiki ingest chatgpt --extra-url <openai-url> --api-key sk-...uses both workers🤖 Generated with Claude Code