feat: add OpenAI-compatible provider for local LLMs and custom APIs#73
Open
d33pstatetech-stack wants to merge 2 commits intoviperrcrypto:mainfrom
Open
Conversation
Add a new 'Custom (OpenAI-Compatible)' provider option that supports any service implementing the OpenAI chat completions API: - Local LLMs: Ollama, llama.cpp, vLLM, LM Studio, LocalAI - Cloud APIs: Together AI, Groq, Fireworks, Deepseek, Mistral, etc. Changes: - lib/openai-compatible-auth.ts: New auth module (flexible base URL, optional API key) - lib/ai-client.ts: OpenAICompatibleClient class, updated AIProviderType - lib/settings.ts: New provider type, free-form model getter - app/api/settings/route.ts: CRUD for base URL, model name, API key - app/api/settings/test/route.ts: Connection test with friendly errors - app/settings/page.tsx: New provider tab with config UI and test button - .env.example: Documented new env vars with common endpoint examples
…ble input types Address Codex review feedback: - Render the 'Custom' button in ProviderToggle so users can actually switch to the openai_compatible provider from the UI - Add typeof string checks on openaiCompatibleModel, openaiCompatibleBaseUrl, and openaiCompatibleApiKey before calling .trim(), matching the pattern used by the existing key handlers to return 400 instead of 500 on malformed payloads
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.
Add a new 'Custom (OpenAI-Compatible)' provider option that supports any service implementing the OpenAI chat completions API:
Changes:
Summary
Changes
Related Issues
Checklist
npx tsc --noEmitpasses