* feat: add SiliconFlow.cn endpoint support and embedding vectors
Chat completion:
- Add endpoint selection dropdown (Global/.com vs China/.cn) to existing
SiliconFlow provider, following the Z.AI endpoint pattern
- Backend switches API URL based on selected endpoint
- Add /api-url slash command support for endpoint switching
Embeddings:
- Add SiliconFlow as a vector/embedding source (OpenAI-compatible)
- Support both .com and .cn endpoints via siliconflow_endpoint setting
borrowed from the main connection panel (Vertex AI pattern)
- Superset model list with platform attribution (.cn) markers
- Models: Qwen3-Embedding (0.6B/4B/8B) + BGE/BCE models (.cn only)
* Add filter by models type
* Load embedding models from endpoint
* Improve api-url command declaration
* Support endpoint override in custom-request service
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
The addOpenRouterSignatures function was previously converting and appending message.signature to reasoning_details unconditionally, ignoring the `enableThoughtSignatures` setting.
This change adds a check for `enableThoughtSignatures` before converting message.signature, while still ensuring the original signature property is deleted to prevent API schema validation errors (HTTP 400).
* Fix AICC direct link import parsing
Update parseAICC in src/endpoints/content-manager.js to dynamically extract the author and character name from the end of the URL path. This resolves a 404 import error caused by AICC adding category subfolders and changing their base URL structure from /character-cards/ to /charactercards/.
* Clean up whitespace in content-manager.js
Remove unnecessary whitespace in URL path processing.
* Use isValidUrl for URL validation
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Add gpt-5.3-chat-latest model support
- Add to OpenAI model dropdown (index.html)
- Add to captioning multimodal model list (caption/settings.html)
- Add to OPENAI_REASONING_EFFORT_MODELS (constants.js)
- Add OPENAI_FIXED_REASONING_EFFORT map to clamp effort to 'medium' (the only value this model accepts)
- Apply fixed effort override in both Azure and general OpenAI request paths (chat-completions.js)
- Update frontend gpt-5.x regex for parameter handling (openai.js)
* Update public/scripts/openai.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
System messages in the OpenRouter messages array were being counted
toward depth and could receive cache_control breakpoints. Since
OpenRouter hoists system messages into Claude's separate system
parameter, this misplaced breakpoints and could prevent caching
entirely if the hoisted content fell below minimum cache size.
Closes#5227
* Use Ollama /api/embed endpoint for vector embeddings
The deprecated /api/embeddings endpoint does not properly support the
truncate parameter, causing "input length exceeds context length" errors
when vectorizing files. Migrate to /api/embed which correctly handles
truncation and supports native batch input.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Wrap single Ollama vector calculation into batch
Fixes https://github.com/SillyTavern/SillyTavern/pull/5221/changes#r2850052729
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* backend, frontend, bugfixes
* Mobile button and sizing
* lint
* clear folder thumbnailFile on delete, rename thumbnailFile on rename
* use filteredImages when changing sort option
* Address all the review comments
* Fix friendly title generation to handle empty strings
* Move add folder button to the header
* instead of search filtering the backgrounds in a folder and showing the folder if the results > 0, search the folder names.
* Trade button places
* Adjust button text
* feat: restrict folder creation to the Global tab
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat(openrouter): disable reasoning if "Request model reasoning" is disabled
* feat(openrouter): map minimum reasoning to none if request reasoning is off
* Add hint how to disable reasoning
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* build llama.cpp embedding url path by appending instead of overwriting
When using a llama-swap frontend, this allows choosing the embedding model
by path; for instance, with the secondary embedding endpoint URL configured
to http://127.0.0.1:5001/upstream/emb-model to pick the "emb-model" model.
With this approach, the same llama-swap instance can be used to serve both
the main LLM and the embedding model from local llama-server commands.
* Trim trailing v1 from URL
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* check png for apng headers
* isAnimated flag
* refactor: centralize background animation extension checks
* refactor: scope animated extension dedupe to backgrounds
* remove precompute from startup
* Fix animation preference not being loaded, fix type-check of customInputs
* Fix eslint
* Fix sort on removal type
* Update metadata before returning from endpoint on CRUD operations
* Remove race condition in metadata load
* Load metadata after loading the list
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Fix: HTTP Basic Auth fails when password contains colons
The credentials in HTTP Basic Auth are formatted as base64(username:password).
Per RFC 7617, the username must not contain a colon, but the password can.
The previous code used `.split(':')` which splits on all colons, truncating
passwords that contain ':' characters. Fix by splitting only on the first colon.
* Use spread syntax for credential parsing
* feat(server): make CORS middleware configurable
Add detailed configuration options for CORS in config.yaml, including
origin, methods, headers, credentials, and max age. Update server
initialization to apply these settings dynamically instead of using
hardcoded values.
* fix(server): Fix default value and conditional logic issues in CORS configuration
- Changed the default value of `cors.maxAge` from `null` to `0`.
- Simplified the conditional check logic for `allowedHeaders`, removing duplicate checks for `corsAllowedHeaders` being `null`.
* fix(server): Fix CORS exposed headers configuration logic
- Removed redundant conditional checks. now directly validates array length when `corsExposedHeaders` has a truthy value
* Improve types + simplify checks
* fix(cors): align maxAge default with original behavior
* Adjust default array values
* Remove debug log
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Startup and on-demand check
* Update comments, add color preload
* remove redundant metadata generation
* changed image-metadata/all from GET to POST
* move initializeAllUserMetadata to image-metadata.js, make blocking (?)
* Add type annotations
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* git push --force
Implement background management in json
lint
upload multer weirdness, fix for timestamp
* remove duplicated logic to generate backgrounds.json
* remove duplicate logic to create backgrounds.js
* remove excessive enodent eror handling
* simplify shared extension constants
* move backgrounds.json to backgrounds/index.json
* use plimit
* move user directory iteration to syncBackgroundsMetadata insetad of server main
* create and move getBackgroundThumbnailResolution
* nitpick
* typdef
* simplify checks
* use read method
* error -> regenerate
* use fileExists
* type error fix (maybe)
* add object to jsdoc returns
* typo
* use getUniqueName from util.js
* remove duplicated multer something or other
* make skipped_extensions a set
* remove strict comparison
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* create isAnimatedWebP and use it
* use file creation date instead of server date
* actually type BackgroundImageMetadata
* use fileExists instead of try catch
* response.sendStatus(500);
* sync json to allow adding images to the folder without restart
* lint
* Generic image metadata endpoint. Remove tags and starred. No startup sync.
* lint
* Descriptive json and move to util.js
* remove folders routes
* It's a POST
* Revert file name to index.json
* Type errors fixing
* Remove p-limit
* Why?
* apply codex suggestions
* see comment
* remove unused functions
* remove path normalization for da path, not needed
* Fix dimensions shadowing issue, circular imports, and apply bg res to only bg
* move thumbnailsEnabled to the top level
* Metadata now stored at {userDataRoot}/image-metadata.json instead of per-folder index.json
Uses relative paths as keys (e.g., backgrounds/sunset.png) for easy file existence checking
Added cleanupOrphanedMetadata() function and /api/image-metadata/cleanup endpoint for data-maid integration
Simplified the API endpoint by removing folder-grouping logic
* lint
* update backgrounds.js imports
* security check, .replaceAll
* Remove useless function, pass type to cache invalidate and seperate file types
* fix: normalize file paths to use POSIX separators in metadata functions
* serve original
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Refactor /search to use per-line async parsing
Supersedes #5047
* Use named type
* Cache query fragments, add file name match
* Skip invalid chat files in search
* Remove extensions from /search results
* Use file_id when appropriate
* Revert "Use file_id when appropriate"
This reverts commit aaa0274b53.
* Clean-up file extension handling
* Move extension append down for non-group