Aller au contenu
login
arrow_backRetour aux issues
webbrain-one/webbrain #2894

Add Pollination AI and Unsloth Studio integration

ecoDébutant enhancement help wanted good first issue

descriptionDescription

## Summary Add first-class integration support for Pollination AI and Unsloth Studio so WebBrain can use them as model providers and, where appropriate, offer browser-level guidance for their web interfaces. ## Motivation - Pollination AI offers a broad OpenAI-compatible API for text, image, video, audio, embeddings, and realtime voice. - Unsloth Studio exposes an OpenAI-compatible local/remote API for models loaded in its UI. - Both can expand WebBrain’s provider coverage without requiring bespoke model adapters for every endpoint. ## Proposed implementation 1. Add a shared OpenAI-compatible provider abstraction for Pollinations and Unsloth. 2. Add provider settings for base URL, API key, model ID, timeout, and optional metadata. 3. Use secure storage for keys and avoid logging or exposing secrets. 4. Add a connection test using model discovery or a minimal request. 5. Add model discovery and capability metadata so the UI can distinguish chat, vision, embeddings, image, audio, and video support. 6. Add tests for streaming, tool calls, vision input, and common HTTP failures. ## Pollination AI details - Base URL: `https://gen.pollinations.ai` - OpenAI-compatible base: `https://gen.pollinations.ai/v1` - Auth: `Authorization: Bearer ` or `?key=` - Model discovery: `GET /v1/models` - Key prefixes: `sk_` for server-side, `pk_` for app/public flows - New integrations should prefer Connect User Wallets / BYOP with OAuth authorization-code + PKCE or device flow - Documented capabilities: streaming, tools, structured output, vision, search, embeddings, media inputs, image/audio/video/3D endpoints ## Unsloth Studio details - Local OpenAI-compatible API at `http://localhost:` - Auth: API key created in Unsloth avatar → Settings → API - Key prefix: `sk-unsloth-` - Supported endpoints: `/v1/chat/completions`, `/v1/responses`, Anthropic-compatible `/v1/messages` - Requirements: local Unsloth app running and a model loaded - Remote access can be provided through Cloudflare HTTPS ## Acceptance criteria - [ ] Provider settings UI for base URL, API key, model ID, and timeout - [ ] Secure key storage with no secret leakage in logs, prompts, or screenshots - [ ] Model discovery flow for both providers - [ ] Chat completion support with streaming - [ ] Tool calling and vision input where supported - [ ] Clear error handling for auth failures, rate limits, unavailable local ports, and unloaded models - [ ] Documentation for Pollinations BYOP/OAuth and Unsloth local setup/API key creation ## Open questions - Should browser-level Unsloth/Pollinations UI guidance live in adapters, or is provider/workflow config sufficient? - Do we want first-class support for Pollinations media-specific endpoints beyond chat completions? - Should Unsloth remote exposure be treated as a separate provider variant?
codeOuvre sur GitHub