* 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.
* 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 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…
Introduces a module-level cache for models in endpoint.ts to prevent repeated dynamic imports on every request. This improves performance by loading models only once and reusing them for subsequent calls.
Updated the default values for LLM_ROUTER_MAX_ASSISTANT_LENGTH and LLM_ROUTER_MAX_PREV_USER_LENGTH from 500/400 to 1000 each to allow longer messages in the router prompt.
Add message trimming for router prompt construction (#1935)
Introduces configurable maximum lengths for assistant and previous user messages in the router prompt via new .env variables. Implements a trimMiddle function to keep the start and end of long messages, improving prompt efficiency and latency while preserving relevant context for route selection.
Added HTTP 400 (Bad Request) to the list of status codes considered as policy errors in isPolicyError. This broadens the error handling to treat client-side validation issues as policy errors.
Add support for configuring router multimodal model via env
Introduces the LLM_ROUTER_MULTIMODAL_MODEL environment variable to allow specifying a preferred multimodal model for the router. If set, the router will use the configured model for multimodal requests; otherwise, it falls back to the first available multimodal model. Updates are reflected in .env, prod.yaml, and endpoint.ts.
* 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…
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
fix CI (#1884)
Eliott C.
Unverified signature
2883086
* fix CI
* add playwright as dev dep
* lint
* clean up spaces-config with community tools
* try to make mongo run?
* 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…