feat: Add custom OpenAI-compatible AI provider#196
Open
Conversation
Add support for custom OpenAI-compatible endpoints including LiteLLM, vLLM, and other on-premise deployments. Key features: - New CustomProvider class using OpenAI SDK - Optional API key support (some endpoints don't require auth) - Required base_url validation for custom endpoints - UI wizard integration with custom provider option - Comprehensive test coverage (18 tests, 446 lines) Changes: - Add CustomProvider to provider registry - Update AIClient to handle optional API keys for custom provider - Add custom provider constants and defaults - Enhance AI config wizard with custom provider flow - Add examples for LiteLLM, vLLM, and custom deployments Supported use cases: - LiteLLM proxy servers (http://localhost:4000) - vLLM inference servers - Custom on-premise OpenAI-compatible APIs - Any OpenAI SDK-compatible endpoint Co-Authored-By: Claude Opus 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.
Pull Request
📝 Summary
Adds support for custom OpenAI-compatible AI providers, enabling integration with self-hosted LLM servers (e.g., vLLM, Ollama, LM Studio) or alternative OpenAI-compatible APIs. The new
CustomProviderclass extends the AI provider ecosystem with configurable base URLs, flexible authentication, and comprehensive error handling.🔧 Changes Made
CustomProviderclass intitan_cli/ai/providers/custom.pysupporting OpenAI-compatible endpointsopenai>=1.0.0,<2.0.0) as a new dependencytests/ai/providers/test_custom_provider.py) with 247 lines covering initialization, generation, error handling, and streaming scenarios🧪 Testing
poetry run pytest)make test)titan-devComprehensive unit test coverage includes:
📊 Logs
✅ Checklist