* refactor: remove isPro from database schema
- Remove isPro field from User type
- Remove isPro parsing from OAuth login
- Remove isPro from user API response
- isPro is now fetched purely client-side from HuggingFace public API
* fix: keep isPro as null on fetch error to avoid showing wrong badge
feat: add PRO badge and credits modal for HuggingChat (#2048)
* feat: add PRO badge and credits modal for HuggingChat
- Add isPro field to User type and persist from OAuth login
- Fetch fresh isPro status from HuggingFace public API on page load
- Display "Get PRO" button for non-PRO users in sidebar
- Display "PRO" badge for PRO users in sidebar
- Update SubscribeModal to show "Purchase Credits" for PRO users
- Add IconPro component for gradient sparkle icon
* feat: improve SubscribeModal UI for PRO users
- Use IconDazzled with yellow-orange-red gradient for "Out of Credits"
- Use IconPro with pink-green-yellow gradient for "Upgrade Required"
- Update credits message to mention HF services and Inference Providers
feat(markdown): allow video and audio tags (#2037)
* feat(markdown): allow video and audio tags in markdown
- Add custom image renderer to convert video/audio URLs to media tags
- Use DOMPurify to sanitize raw HTML, allowing only video/audio/source
- Add comprehensive tests for media rendering and XSS prevention
* feat(mcp): increase tool timeout from 30s to 60s
* feat(mcp): update tool prompt to mention video/audio support
* test: update markdown test for DOMPurify behavior
fix(mcp): communicate tool errors to LLM to prevent hallucinated success (#2036)
When MCP tool calls fail (e.g., timeout), the error was shown in the UI
but not sent to the LLM. This caused the LLM to hallucinate success
because it never received feedback about the failure.
Now error messages are included in toolMessages so the LLM can
acknowledge failures and respond appropriately.
MCP Tool Progress Notifications and MCP SDK bump. (#2030)
Use highlights instead of full page text to minimize context size.
The previous implementation requested `text: true` which returned
entire page contents (5-20K+ chars per result), overwhelming LLM context.
Now uses:
- highlights: 3 sentences, 2 per URL (concise, query-relevant)
- text fallback: max 500 chars (only if highlights empty)
This matches what the MCP server at mcp.exa.ai likely returns.
feat(mcp): add direct Exa API integration to bypass slow mcp.exa.ai (#2021)
* feat(mcp): add direct Exa API integration to bypass slow mcp.exa.ai
Intercepts calls to mcp.exa.ai and routes them directly to api.exa.ai,
eliminating the slow hosted MCP server (~3-12s latency) while keeping
the same user configuration.
- Add exaDirect.ts module with direct API client
- Intercept tool listing in tools.ts to return hardcoded definitions
- Intercept tool calls in httpClient.ts to use direct API
- Add EXA_API_KEY config for authentication
No user config changes needed - existing MCP_SERVERS with mcp.exa.ai
continue to work transparently.
* Add scroll to metadata output in ToolUpdate
Wrapped the metadata <pre> block with custom scrollbar, max height, and vertical overflow for better readability when displaying large metadata content.
* fix(mcp): bypass mcp.exa.ai in health check, security/leak fixes
- Add Exa bypass to /api/mcp/health endpoint for instant response
- Support x-api-key header for API key (preferred over URL param)
- Fix event listener leak by addin…
* Add voice transcription feature to chat
Introduces voice recording and transcription in the chat window using Whisper models. Adds new components for voice recording and audio waveform visualization, updates feature flags and environment variables, and implements a server API endpoint for audio transcription.
* Fix frequencyData reactivity in VoiceRecorder
Replaces in-place mutation of frequencyData with assignment of a new Uint8Array to ensure Svelte reactivity in the voice visualization.
* Improve AudioWaveform visualization and responsiveness
Refactors AudioWaveform.svelte to use a timeline-based amplitude visualization with dynamic pill count based on container width, smoother animation, and responsive resizing. Updates VoiceRecorder.svelte to remove fixed pillCount and adjust maxHeight for better appearance. These changes provide a more accurate and visually appealing waveform display.
* Improve audio waveform and voice recorder UI
Reduced pill width and gap in AudioWavef…
Replaces CarbonTools and related Carbon icons with Lucide equivalents throughout the UI, updating imports and usage in Svelte components. Updates Hugging Face organization avatar URLs to the new /api/avatars/{org} endpoint in both frontend and backend code. Adds new models to dev and prod YAML configs, and improves the models page layout and filtering. Also updates dependencies to include @iconify-json/lucide and the latest @sinclair/typebox.
* Add billing organization selection
Introduces support for selecting a billing organization for inference requests in HuggingChat. Adds a new billing section in application settings, updates user settings and API to store and validate the selected organization, and ensures requests are billed to the chosen organization by sending the X-HF-Bill-To header. Also updates environment and chart files to include the new OpenID scope required for billing.
* Update +page.svelte
* Remove billingOrganization from default settings
* Fix user settings creation and update test for findUser
The test for updateUser now passes a URL to findUser to match the updated function signature. Also, the updateUser function now inserts the full DEFAULT_SETTINGS object when creating default user settings, ensuring billingOrganization is included.
Reset MCP timeout on Progress Notifications (#1992)
shaun smith
Unverified signature
0ab931d
use the reset on progress setting for adaptable timeouts. progress not surfaced to ux yet.
Add CIMD support for automatic oauth app creation, and PKCE support (#1978)
Eliott C.
Unverified signature
c0ef209
* Add CIMD support
* update env file
* Add PKCE and fix CIMD
* add spec refs
Guard MCP reasoning stream from whitespace <think> blocks
Enhances error reporting by preferring the original HTTP transport error when both HTTP and SSE transports fail, ensuring the UI displays the primary failure reason. Updates ServerCard to better display long error messages.
Refactor file handling for multimodal chat messages
Moved message and file preparation logic to a shared utility (prepareFiles.ts) for OpenAI-compatible multimodal payloads. Updated endpointOai and runMcpFlow to use the new prepareMessagesWithFiles function, improving code reuse and maintainability.
Update image ref resolution to use conversation order
File reference resolver now maps image refs (e.g. image_1, image_2) to user-uploaded images in chronological order across the entire conversation, rather than only the latest user message. Updated tool prompt instructions to clarify this behavior for users.
* Add image reference support for MCP tool calls
Introduces image reference resolution and attachment for MCP tool arguments, allowing tools to accept lightweight image reference strings (e.g. 'latest', 'image_1') and receive resolved image payloads. Updates tool invocation and flow logic to use these references, and improves tool prompt instructions for image input handling.
* Enable multiple file uploads in ChatInput
* Refactor multimodal model selection logic
* Remove 'latest' image reference support
Eliminates handling of the 'latest' image reference in image resolver logic and updates related comments and prompts to only support 'image_1', 'image_2', etc. This simplifies image reference usage and clarifies instructions for tool input parameters.
* Refactor imageRefs to fileRefs for tool payloads
- Update examples and Helm envs to use hf.co endpoint
- Relax isStrictHfMcpLogin to allow both hf.co and huggingface.co
- Keeps functionality identical while preferring the shorter domain
mcp: add detailed console logging for MCP flow and tool listing
* Update ServerCard.svelte
feat(mcp): add Model Context Protocol integration with tool support
Improve MCP tools caching and server selection logic
Replaces single-entry MCP tools cache with a multi-keyed cache based on server configuration, improving cache accuracy for different server sets. Refactors server selection logic in runMcpFlow to better handle custom server lists and selected server names. Removes MCP flow from generate.ts, streamlining text generation logic.
* Add OAuth authentication for MCP servers
Introduces browser-based OAuth flow for MCP servers, including new auth helpers, localStorage management, and UI actions for authentication and sign-out. Server cards now support authentication, and enabled servers include persisted auth headers for API requests. Adds callback handler and route for OAuth completion.
* Add server authentication status and UI indicators
Introduces an 'authRequired' property to MCPServer and health check responses to indicate when authenti…
Handle empty system messages in preprocessing and OpenAI endpoint
Added logic to strip initial system messages with empty content during message preprocessing and normalized preprompt handling in the OpenAI endpoint. This prevents sending empty system prompts to providers and ensures preprompts are only prepended or inserted when non-empty.
Adds a gradient highlight for the router (Omni) model tile in the models page, updates its description in both backend and UI, and refines active model border styling for better theme support. Also tweaks the chat input dropdown hover style for consistency.
* Replace file upload button with bits-ui DropdownMenu
Replaces the previous file upload button and tooltip with a DropdownMenu from bits-ui, providing a more modern UI for file/image uploads in ChatInput.svelte. Adds new dependencies to package.json for bits-ui and related packages.
* Add URL file fetch modal to chat input
Introduces UrlFetchModal.svelte for fetching files from HTTPS URLs and adds it to ChatInput.svelte. Updates file upload dropdown to support uploading text files from device or URL, and refines mime type handling in ChatWindow.svelte to always allow common text-like files and images for multimodal models.
* Copy shared files when creating conversation from share
Adds logic to duplicate files from a shared conversation to a new conversation when created from a share. Files are renamed and metadata is updated to associate them with the new conversation.
* Centralize MIME type allowlists and update usage
Introduces src/lib/constants/mime.ts to centralize text and…
* redirect to the convo
* backend redirect to the convo
* fix: fetch url logs
* server side redirect
* require a query only for the get
* fix error type
* fix: fetch url logs
---------
Co-authored-by: rtrm <remy.trompier@gmail.com>
* Add custom scrollbar class to Modal component
Applied the 'scrollbar-custom' class to the Modal's main container to enable custom scrollbar styling. This improves the appearance and consistency of scrollbars within modals.
* Add support for loading attachments from URLs
Implements the ability to load file attachments via URL parameters using a new utility (loadAttachmentsFromUrls) and a server-side proxy endpoint (/api/fetch-url) to securely fetch remote files. Updates chat and model pages to handle 'attachments' query parameters, injects file content into user messages, and improves multimodal message preparation. Also includes minor UI adjustments for file display and refactors Plausible analytics script initialization.
* Block redirects in fetch-url API endpoint
* Preserve and sanitize return path after login
Adds logic to capture, sanitize, and persist a 'next' return path through the OAuth login flow, ensuring users are redirected to their intended in-app location after authentication. Prevents open redirects by only allowing absolute in-app paths and updates both the auth and login callback logic to handle the new parameter.
* Update ChatMessage.svelte
* Add model refresh API and refactor model loading
Introduces a POST /models/refresh endpoint for admins to trigger a model refresh and receive a summary of changes. Refactors model loading logic in models.ts to support dynamic refresh, exposes refreshModels and lastModelRefreshSummary, and adds a test script (test-refresh.mjs) to verify refresh functionality. Minor code cleanup and improved override handling included.
* Delete test-refresh.mjs
* Upgrade dep
* link to provider's page on the Hub
* add rounding
* Update ChatMessage.svelte
* Update provider type to InferenceProvider
Replaces the provider type from string to InferenceProvider in endpoint and message update types for improved type safety and consistency with @huggingface/inference.
* Remove model author avatar from chat message link
Eliminated the model author avatar image from the chat message model link and adjusted the link's padding for consistency. Also fixed the Hugging Face organization link to use curly braces for variable interpolation.
* Switch provider logos to dynamic avatars from Hugging Face
Replaces static SVG provider logos with dynamic avatars fetched from Hugging Face organization API. Removes all local SVG assets for provider logos and updates the settings page to use the new avatar URLs, improving maintainability and ensuring up-to-date branding.
* Remove unused variable and fix type in settings page
Deleted an unused 'modelAuthor' c…