* 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
MCP Tool Progress Notifications and MCP SDK bump. (#2030)
* Optimize message update handling and rendering
Refactors ChatMessage.svelte to interleave tool and stream updates for more accurate message rendering, consolidates consecutive stream tokens, and updates ToolUpdate.svelte styles for improved spacing. Also optimizes update handling in both the client and server to merge consecutive stream updates, reducing unnecessary array growth and improving performance.
* Improve message updates reactivity and storage efficiency
In the Svelte page, message update merging now creates new objects and arrays to ensure UI reactivity when streaming tokens are merged. On the server, ephemeral stream tokens and keep-alive updates are filtered out before persisting messages to the database, reducing payload size and improving rehydration performance.
* Improve chat message block handling and update persistence
Refactors ChatMessage.svelte to better handle interleaved tool and stream updates, ensuring correct text chunking and fallback behavior. Update…
* 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.
* 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…
* 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…
Add provider info to router metadata in chat messages
Extends router metadata to include a 'provider' field throughout the backend and frontend, allowing display of provider information alongside route and model in chat messages. Updates types, message update handling, and UI rendering to support and show provider details when available.
* BREAKING? Remove overflow-hidden from message info container
The overflow-hidden class was removed from the message info container div to allow content to overflow as needed. This may improve the display of message metadata or related elements.
* Add subscribe modal and improve error handling
Introduces a SubscribeModal component to prompt users to upgrade when hitting message limits, shown on 402 errors in conversation pages. Enhances error propagation and handling in router and endpoint logic, preserving HTTP status codes and error messages, and updates types to support status codes in message updates. Also includes minor UI improvements to Toast and refines error extraction and logging throughout the routing flow.
* Sanitize and improve error handling in router endpoints
Introduces functions to sanitize error messages before sending them to clients, preventing leakage of provider details. Differentiates between policy errors (e.g., authorization, payment) and transient errors…
* Add AbortRegistry for user-initiated generation cancellation
Introduces an AbortRegistry singleton to track and manage AbortControllers for active conversation generations, enabling user-initiated cancellation of ongoing requests. Updates text generation and endpoint logic to support abort signals, and ensures proper cleanup and partial response handling when a generation is aborted. The stop-generating endpoint now triggers aborts via the registry.
* Remove 'continue message' feature from chat flow
Eliminated the 'continue message' functionality and related code, including the ContinueBtn component, associated props, and logic in both frontend and backend. This simplifies the message handling flow and removes unused parameters and UI elements.
Automatically refresh oauth token (#1913)
Eliott C.
Unverified signature
ab8b948
automatically refresh oauth token
Store oauth token in DB + use it when doing API calls (#1885)
Eliott C.
Unverified signature
c4f6eb3
* store oauth token in DB
* store user token/oauth token in session
* use token when making API call if USE_USER_TOKEN is true in env
* lint
Add COUPLE_SESSION_WITH_COOKIE_NAME env var (#1881)
Eliott C.
Unverified signature
69ef081
* Add COUPLE_SESSION_WITH_COOKIE_NAME env var
This means the user's session will be reset if the value of the coupled cookie name changes.
Useful if the app is deployed on a subpath of another site, and you want to reset the session when the auth
for the user changes
* fix test
Refactor token parameters to standardize naming across models and generation settings
* refactor: remove tokenizer-related functionality and dependencies
- Removed tokenizer dependencies from package.json.
- Deleted TokensCounter component and its usages across the application.
- Updated model configurations to exclude tokenizer properties.
- Refactored model processing logic to support only OpenAI-compatible endpoints.
- Adjusted API responses to omit tokenizer information.
- Cleaned up related utility functions and imports.
* Remove web search functionality and related components
- Deleted endpoints for various web search APIs (serpApi, serpStack, serper, webLocal, youApi).
- Removed generateQuery function and its usage in search.
- Eliminated web search related types and interfaces from the codebase.
- Updated Assistant and Conversation types to remove references to web search and embedding models.
- Cleaned up related utility functions and message updates for web search.
- Adjusted API routes and components to reflect the removal of web search features.
- Updated…
* feat(API): refactor API with Elysia
* feat: initial elysia setup
* feat: replace conv/[id] load function with universal
* fix: delete v1 catchall
* wip
* fix: response type
* fix: add cors
* feat: more routes in tools & assistants
* refacto: use normal svelte fetch in `/assistant/[assistantId]`
* refacto: use normal svelte fetch in `conversation/[id]`
* feat: use universal load function for `tools/[toolId]`
* wip: removing more server load function stuff
* feat: more routes to universal load functions
* feat: more routes to universal
* refactor: move tools loading to API endpoint
* refactor(api): implement tools search API endpoint and move load function
* fix: types on tool search
* refactor: update assistant route and remove redundant page load function
* refactor(api): move assistants page load function to api call
* refactor(settings): remove waterfall loading
* refactor: main load function
* fix: types
* feat: improve fetchJSON to handle empty responses
* …
Revert "refactor: new API & universal load functions (#1743)"
* feat(API): refactor API with Elysia
* feat: initial elysia setup
* feat: replace conv/[id] load function with universal
* fix: delete v1 catchall
* wip
* fix: response type
* fix: add cors
* feat: more routes in tools & assistants
* refacto: use normal svelte fetch in `/assistant/[assistantId]`
* refacto: use normal svelte fetch in `conversation/[id]`
* feat: use universal load function for `tools/[toolId]`
* wip: removing more server load function stuff
* feat: more routes to universal load functions
* feat: more routes to universal
* refactor: move tools loading to API endpoint
* refactor(api): implement tools search API endpoint and move load function
* fix: types on tool search
* refactor: update assistant route and remove redundant page load function
* refactor(api): move assistants page load function to api call
* refactor(settings): remove waterfall loading
* refactor: main load function
* fix: types
* feat: improve fetchJSON to handle empty responses
* …
* feat(config): wip, make config controllable from DB, public side for now
* fix: build
* feat(config): add config manager env var toggle
* wip: make backend config use config manager
* fix: typechecks
* fix: circular import
* refactor: init hook sveltekit
* fix: disable config manager during tests
* refactor: use enum for semaphore, move delete from auto after 60s to separate `deleteAt` field
* feat: config manager checks for updates on requests
* fix: config script exit
* fix: remove top-level awaits
* fix: script await
* feat: filter config keys based on public environment variables for more security
* fix: change import to type for public environment variables
* feat: implement admin token management and CLI login functionality
- Added `ADMIN_CLI_LOGIN` and `ADMIN_TOKEN` to the environment configuration.
- Introduced `AdminTokenManager` for handling admin sessions and token validation.
- Updated user session handling to include admin status.
- Enhanced API routes to utilize admin checks based on the new token management.
- Modified frontend components to reflect admin status correctly.
- Added a new endpoint for validating admin tokens.
* fix: remove token after validation
Add `toolId` to ToolCall and use it in tool results (#1787)
Kelig+1: Kelig LEFEUVRE
Unverified signature
6f95791
* Add `toolId` to ToolCall and use it in tool results
* Make `toolId` optional in ToolCall interface
---------
Co-authored-by: Kelig LEFEUVRE <klefeuvre@alpes-controles.fr>
Simplify frontend for conversation tree representation (#1678)
* feat: new tool UI
* wip community tools support
* fix: community tools support
* fix: line heights
* fix: MIME types
* fix: remove debug logs
* fix: make sure file upload is always last
* fix: always enable document parser when a pdf is present in the conversation
* fix: use correct icon for document upload
* fix: make sure community tools use their custom icons correctly
* feat: add button to browse community tools
* tweak buttons
* add some tooltips
* fix: bug in file upload tooltips
* fix: lint
---------
Co-authored-by: Victor Mustar <victor.mustar@gmail.com>
* feat: add a reasoning dropdown for CoT models
* feat: add status updates
* fix: various cleanups
- pass content & status to result dropdown
- dont store streaming updates in db
- make status generation non blocking
* fix: make sure not to push reasoning token stream to db
* feat: add time indicator and make the ui match websearch
* fix: change in status update & prompt
feat: lazy stream conversations load function (#1553)
* fix(continue): more reliable end token stripping
before we would try to strip end tokens once in order from the stop array, now we strip all end tokens from the array until we can't anymore
* fix(tools): remove generation prompt in continue mode
* Saving and reloading the current tree on page refresh
* Saving and reloading the current tree on page refresh / Moving to the last branch when editing a user message or retrying an assistant message.
* Update Reload the current tree state on page refresh
* updated updateCurrentIndex function
* Update updateCurrentIndex Function
* Persist current tree in navigation/shared conversations v1
Co-authored-by: Kenneth Ramos <kenneth.ramos95@gmail.com>
Co-authored-by: Eduardo Rocha <rocha092@csusm.edu>
* Removed uncessary comment.
Co-authored-by: Long Dao <hailongdao1017@gmail.com>
Co-authored-by: Eduardo Rocha <rocha092@csusm.edu>
* Added enhance import and document focus fix.
Co-authored-by: Long Dao <hailongdao1017@gmail.com>
Co-authored-by: Eduardo Rocha <rocha092@csum.edu>
* Fixed code to have updated formatting and LoadEvent type in page.ts
Co-authored-by: Long Dao <hailongdao1017@gmail.com>
Co-authored-by: Eduardo Rocha <rocha092@csusm.edu>
* run formatting
* simplify pr…
* wip: give assistant tool access
* add api endpoints
* add/delete tools from assistant settings
* make tools work with assistants
* feat(tools): add more tools indicator throughout UI
* formatting
* feat(models): Add llama 3.1 405B and 70B
* feat(tools): improve tools support for llama 3.1 models
* feat(models): update mistral to latest
* feat(models): use llama 3.1 8B for tasks
* fix(tools): disable tools by default
* feat(models): update model descriptions in huggingchat
* fix(front): show branding for llama 3
* fix(config): fix encoding
* feat(migrations): reset tools for everyone
* feat(config): replace orgs with final org
* feat(config): update website for llama 3.1
Add "disable streaming tokens" settings & remove media query (#1299)
feat: mime types on tools, show upload btn on demand (#1204)
Liam Dyer+2: nsarrazin, victor
Unverified signature
33592b9
* feat: mime types on tools, show upload btn on demand
* feat: enable and disable all tools button
* feat: minor tools ui changes and nits
* Only paste or drop the allowed MIME types (#1222)
* Only allow specific MIME types when pasting
* lint
* Simplify upload button show logic
Since we already take into account if the model is multimodal above
* Add mime type check to file dropzone
* Make error clearer
* enable/disable same button
* cs
* rm unused
---------
Co-authored-by: Nathan Sarrazin <sarrazin.nathan@gmail.com>
Co-authored-by: Victor Mustar <victor.mustar@gmail.com>