Draft
feat: Add Pollinations API as primary generation backend with nova-fast intent routing#1
Conversation
- Add POLLINATIONS_API_KEY / POLLINATIONS_BASE_URL to .env.example - Replace active custom endpoint examples in librechat.example.yaml with Pollinations (nova-fast default); old examples commented out - packages/api/src/pollinations/classify.ts: intent classification + image-prompt enhancement via nova-fast - packages/api/src/pollinations/service.ts: orchestration layer — text → nova-fast, image → enhance+zimage, video → placeholder - packages/api/src/pollinations/index.ts: public exports - packages/api/src/pollinations/classify.spec.ts: Jest tests for all intent paths, error cases, and multi-turn conversation - packages/api/src/index.ts: export Pollinations module - README.md: Pollinations integration section with setup instructions Agent-Logs-Url: https://github.com/verdjs/LibreChat/sessions/ace58aa9-0e14-4a38-9814-baa691114088 Co-authored-by: verdjs <225778361+verdjs@users.noreply.github.com>
Deploying librechat with
|
| Latest commit: |
0710eea
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://89e3001f.librechat-8ny.pages.dev |
| Branch Preview URL: | https://copilot-remove-existing-api.librechat-8ny.pages.dev |
Copilot
AI
changed the title
[WIP] Remove existing API integrations and add Pollinations API
feat: Add Pollinations API as primary generation backend with nova-fast intent routing
Apr 3, 2026
…guest user When GUEST_MODE=true: - POST /api/auth/refresh creates/reuses a shared guest user and returns a real JWT even without a refresh token cookie - Frontend suppresses all login redirects (AuthContext, useAuthRedirect, Root, ChatRoute, Startup all guard with guestMode flag) - Startup.tsx redirects /login → /c/new immediately when guestMode - Guest account uses a random non-bcrypt password so it cannot be used for local password auth - TStartupConfig extended with guestMode?: boolean - .env.example documents GUEST_MODE=false Agent-Logs-Url: https://github.com/verdjs/LibreChat/sessions/d5aba8f2-9ba1-41a7-b47d-7c07e46a2acc Co-authored-by: verdjs <225778361+verdjs@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.env.example— addGUEST_MODE=falseenv var with docsapi/server/routes/config.js— exposeguestModein startup config payloadapi/server/controllers/AuthController.js—getOrCreateGuestUser()helper;refreshControllerreturns guest JWT whenGUEST_MODE=trueand no refresh token cookie; random non-bcrypt password so account can't be used for local authpackages/data-provider/src/config.ts—guestMode?: booleanadded toTStartupConfigclient/src/hooks/AuthContext.tsx— readsguestModefrom startup config; guards bothnavigate(buildLoginRedirectUrl())calls anduserQuery.isErrorredirectclient/src/routes/useAuthRedirect.ts— skips 300ms redirect-to-login timer whenguestModeclient/src/routes/Root.tsx— allows render whenguestModebefore token arrivesclient/src/routes/ChatRoute.tsx— same guard as Rootclient/src/routes/Layouts/Startup.tsx— immediately redirects/login→/c/newwhenguestModeOriginal prompt
Create a pull request in
verdjs/LibreChatthat removes all existing/custom API integrations for text/image generation and replaces them with a single Pollinations API integration.Requirements:
https://gen.pollinations.aiPOST /v1/chat/completions(chat)POST /v1/images/generations(images; OpenAI SDK compatible with base_urlhttps://gen.pollinations.ai/v1)Authorization: Bearer <API_KEY>or?key=<API_KEY>.gemini-fast.nova-fastfirst to classify intent (text vs image vs video).nova-fastto enhance the prompt, then generate image with modelzimage.gemini-fast(unless user overrides model).nova-fast.zimage.gemini-fast.Notes:
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: hi
Assistant: Hi — what do you want to do with
verdjs/LibreChat?A few common things I can help with (pick one, or tell me your goal):
Tell me what you’re trying to accomplish and any file path / error message you have.
User: ok so make a pull request to get rid of all custom api and just use this api # Pollinations API
Base URL: https://gen.pollinations.ai
API Keys: https://enter.pollinations.ai
Docs: https://gen.pollinations.ai/api/docs
Quick Start
Text (Python, OpenAI SDK)
Image (URL — no code needed)
Image (Python, OpenAI SDK)
Audio (cURL)
Authentication
All generation requests require an API key. Model listing endpoints work without auth.
Authorization: Bearer YOUR_API_KEY?key=YOUR_API_KEYKey types:
sk_(secret, server-side) |pk_(publishable, client-side, rate limited)Endpoints
POST /v1/chat/completions
OpenAI-compatible chat completions. Use any OpenAI SDK with base_url="https://gen.pollinations.ai".
Request body (JSON):
GET /text/{prompt}
Simple text generation. Returns plain text.
Query params: model, seed, system, json, temperature, stream
GET /image/{prompt}
Generate image or video. Returns binary (image/jpeg or video/mp4).
Query params:
This pull request was created from Copilot chat.