* Add model selection support for llama.cpp router mode
- Add llamacpp_model setting to textgen-settings.js
- Implement loadLlamaCppModels() function to fetch and populate models
- Add onLlamaCppModelSelect() handler for model selection
- Update status check to load llama.cpp models when connecting
- Update getTextGenModel() to return selected llama.cpp model
- Add model dropdown to HTML UI in llama.cpp section
- Initialize event handlers and Select2 for better UX
- Add llamacpp_model to preset manager for save/load support
- Add llamacpp_model to slash commands support
This implements model selection for llama.cpp router mode, allowing
users to select from multiple models without restarting the server.
Follows the same pattern as Ollama, Tabby, and vLLM implementations.
* Correct spelling
* Fix clear selection position
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Separate prompt-building functionality from request-sending functionality
* removing logs and clarifying comments
* separating parameter construction functionality to allow ConnectionManagerRequestService to use all other preset parameters
* fixing chat completion issues, adding documentation to new functions.
* Improving ConnectionManagerRequestService errors. Adding parseReasoningFromString option to override reasoning template.
* Adjusting TextCompletionService prompt formatting
* linting
* Use settingsToUpdate to convert from OAI preset to OAI settings.
* lint
* throw errors when profile ID not found
* Fix missed instances of global completion settings being used (CC and TC), replaced with optional argument. Specified typing for ChatCompletionSettings and TextCompletionSettings.
* Adjusting parameters of parseReasoningFromString and adding getReasoningTemplateByName
* using messages.role as a fallback for custom requests, fixing newline removal.
* parameters => settings
I like how it sounds better
* ditto
* You know I had to do it to 'em
* Update getCustomTokenBans
* Fix calculateLogitBias
* Fix param attributes
* Fix type checks
* Less strict role type on ChatCompletionMessage
* Add missing space
* fixing getChatCompletionModel to use an arbitrary chat completion settings object
* Fixing issues with preset overriding custom data passed.
* Pass model to createGenerationParameters externally
* Unify seed param handling for CHUTES
* Fix non-existing CC source
* Use strict comparison
* Use global settings as a base for generation parameters creation
* removing unnecessary handling of preset fields
* don't pass preset prompts, use the passed payload override messages
* refactoring text generation prompt building of last line
* Pass model to getReasoningEffort
* Pass model name to canPerformToolCalls
* Pass model to createTextGenGenerationData
---------
Co-authored-by: qvink <qvink@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Update - Revert connection profile change TC commands load order
This change was made to prevent preset tied samplers from breaking, such thing doesn't exist anymore.
* Update - Unlink preset renaming logic from sampler selection lock
* Update - Link TC sampler selection lock to API Type
* Fix - Clean comments
* Update - Use localforage selectedSamplers and data selectsampler as main sampler selection storage
* Fix - ESLint errors
* Update - Change lock tooltip with correct description
* Fix - Move and await sampler select localforage initializer to finish
Tried to move it to the most reasonable place possible that allowed to make an await.
* Fix - Make loadTextGenSettings async to load API selected samplers
* Feat - Save and load manually selected samplers per preset
* Fix - Sync sampler popup with selected sampler state settings
* Fix - Prevent breaking visualization after disabling keep selected samplers
* Fix - ESLint errors in samplerSelect.js
* Fix - ESLint errors in textgen-settings.js
* Docs - Write JSDocs for new methods in textgen-settings.js
* Update - Make the reset button work individually per preset
* Fix - Trailing whitespace at the end of class selector
* Fix - Update tooltip information for force samplers toggle
* Fix - Prevent calling isSamplerManualPriorityEnabled a bajillion times
* Fix - Unbrick switch from manually-forced to non-manually-forced preset
This prevents samplers non controlled by [data-tg-type] from being sent to the shadow realm if they were previously hidden by [data-tg-samplers]. is_preset_switch is just to prevent breaking muscle memmory of users not using force manually selected samplers.
* Fix - Load manually selected samplers on connection profile switch
Changing preset does not update samplers ONLY IF force manually selection is disabled. Changing API before preset would update the samplers, but using the settings of the previous preset, due to preset being changed AFTER the API.
* Fix - Switch API Type controls in the API Connections panel
* Fix - ESLint errors in textgen-settings.js
* Fix - Update sampler selection only with textgenerationwebui as main API selected
* Styles - Change the sampler selection lock button icon to an actual lock.
* Fix - Await for sampler selection reset to finish
* Update - Normalize function name
* Update - Preserve manual sampler selections on preset renaming
* Fix - Properly reset sampler manual selections
* Update - Ensure selection reset displays API specific samplers
* Fix - ESLint errors
* Fix - Avoid modifying non-existent data
* Update - Move manual sampler control methods to samplerSelect.js
* Fix - Break circular file dependency between textgen-settings.js and samplerSelect.js
setting_names was unavailable during page load, throwing an error and preventing ST from loading.
* Update menu layout
* Remove pointless await
* Update param naming to camelCase
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* TC: Allow setting empty JSON schema
* Fix check for llamacpp schema
* Handle grammar/schema for Aphrodite
* Conditional include for guided_json
* Update default presets with null value
* Conditional include into payload for grammar/schema
* bug-fix: adhere to chat template hash bound settings when a new model appears using the same hash as a bound one
* chore: Improve readability
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Move app events to separate module
* Add event emission for preset changes and deletions
* Remove unnecessary blank line at the beginning of events.js
* Add await to selectPreset call in initTextGenSettings
* Emit events for preset deletion and change in initPresetManager
* Move event emit out of PRESET_CHANGED
* Add min_keep, a llama.cpp-exclusive setting for constraining the effect of truncation samplers
* Enable nsigma for llama.cpp, and add llama.cpp alias top_n_sigma, add nsigma to the llama.cpp sampler order block
* Allow a negative value of nsigma as this represents 'disabled' in llama.cpp (while 0 is deterministic)
* Remove tfs and top_a as these are not supported by llama.cpp (tfs was removed, and top_a was never supported)
* Correct the identification string for typical_p in the llama.cpp sampler order block
* Add penalties to the llama.cpp sampler order block
* sendOpenAIRequest/getTextGenGenerationData methods are improved, now it can use custom API, instead of active ones
* Added missing model param
* Removed unnecessary variable
* active_oai_settings -> settings
* settings -> textgenerationwebui_settings
* Better presetToSettings names, simpler settings name in getTextGenGenerationData,
* Removed unused jailbreak_system
* Reverted most core changes, new custom-request.js file
* Forced stream to false, removed duplicate method, exported settingsToUpdate
* Rewrite typedefs to define props one by one
* Added extractData param for simplicity
* Fixed typehints
* Fixed typehints (again)
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>