Skip to content

Conversation

olegshulyakov
Copy link
Owner

No description provided.

…vider interfaces

- Extracted message normalization, SSE handling, and response utilities into `src/api/utils.ts`.
- Created `BaseOpenAIProvider.ts` with `LLMProvider`, `ModelProvider`, and `ChatCompletionProvider` implementations.
- Added `types/provider.ts` to expose provider interfaces and updated `types/index.ts`.
- Updated `src/context/chat.tsx` and `src/api/inference.ts` to use the new utilities.
- Added `filterThoughtFromMsgs` helper to `src/utils/index.ts`.
- Updated imports across the codebase and removed legacy functions.
…pport

- Move BaseOpenAIProvider into `src/api/providers` and update imports
- Introduce `LlamaCppProvider` with its own `jsonToModels` implementation
- Create provider index to expose `getInferenceProvider`
- Make `BaseOpenAIProvider` constructor accept optional `baseUrl` and throw error when omitted
- Replace legacy InferenceApi with BaseOpenAIProvider and LlamaCppProvider
- Introduce provider caching, dynamic model retrieval, and cache expiration logic
- Update InferenceContext to expose `provider` and `selectedModel` instead of `api` and `serverProps`
- Add Modality type and extend InferenceApiModel with modalities and output_modalities
- Add parseLlamaCppModelName helper and serverProps interface updates
- Update hooks and components to use new provider API and configToCustomOptions
- Introduce OpenRouterProvider extending BaseOpenAIProvider
- Implement 15‑minute cache expiration check
- Convert OpenRouter model data to InferenceApiModel
- Update BaseOpenAIProvider lastUpdated to protected for subclass use
- Register open-router in getInferenceProvider
- Introduced `updateSelectedModel` callback to set the selected model when config changes
- Invoked it in `syncServer` and the initialization effect to replace duplicated logic
- Updated dependency arrays to include `updateSelectedModel` for correct memoization
@olegshulyakov olegshulyakov merged commit 783f39c into main Sep 27, 2025
10 checks passed
@olegshulyakov olegshulyakov deleted the refactor/api-provider branch September 27, 2025 19:57
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.

1 participant