feat: LiteLLM model settings, dynamic discovery, and UI selectors - #20
Merged
Conversation
added 7 commits
September 7, 2026 23:07
…n and resilient fallbacks
…, and custom selectors
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
This pull request brings full dynamic LiteLLM model discovery, configuration, and classification to the ContextCortex UI, allowing operators to dynamically query upstream LiteLLM endpoints, inspect available models by capability, and persist dense embedding, sparse embedding, Vision AI OCR, and general chat model selections without restarting containers.
Key Changes
Dynamic Model Discovery Service (
app/services/litellm_service.py):discover_models()to query upstream LiteLLM/v1/models.embedding_models), Vision OCR fallback models (vision_models), and Chat models (chat_models).Model Persistence & Hot-Reloading (
app/services/database/connection.py,app/services/embeddings.py):vision_ocr_modelandchat_modelalongsidelitellm_url,litellm_api_key, and embedding models in SQLite/Postgressystem_metadata.app/services/pdf_extractor.pyto use dynamic vision model for PDF OCR fallbacks.REST API Endpoints (
app/api/routers/settings.py):GET /admin/api/models/discoveraccepting optionalurlandapi_keyquery parameters.POST /admin/api/settings/embeddingto accept and savevision_ocr_modelandchat_model.GET /admin/api/statsto return full model configurations.Frontend UI (
frontend/src/components/settings/EmbeddingSettings.tsx,Settings.tsx):-- Custom / Enter manually --) allowing manual model override when needed.Test Coverage & Verification:
npm run build.