adv-cli-char-gen - Action Report¶
Project: /home/user/Projects/adv-cli-char-gen Created: 2026-07-23
Char-gen: added Pollinations/AI-Horde/Custom providers (PARTIAL) (2026-07-23 19:36)¶
Status: 🔵 DESIGNED — provider dicts added + compiles clean; runtime branches NOT yet wired (session ended: out of tokens).
What: Began adding Pollinations (default target), AI Horde, and a Custom provider to the production char-gen incomplete-char-gen-enhanced-5k-v2.py.
Why: Anon wants Pollinations as default for BOTH text and images (doubled free credits if the app sends app attribution), AI Horde as a free crowdsourced fallback, and per standing rule 'we always want a custom field' for bring-your-own endpoints.
How / DONE this session: - Backed up to .bak-20260723_* (copy-before-edit). - Read current Pollinations API (from ~/claude/pollinations/pollinations-llm-info.txt): base moved to https://gen.pollinations.ai — text = OpenAI-compatible POST /v1/chat/completions (Bearer sk_ key REQUIRED now); image = GET https://gen.pollinations.ai/image/{prompt}?model=flux (bytes returned directly, Bearer). AI Horde = https://stablehorde.net/api/v2, async submit+poll, anon key 0000000000. - Added 3 entries to API_PROVIDERS (line ~68): pollinations (model openai / image flux / referrer=nexus-char-gen for credit attribution), aihorde (model auto / image flux), custom (empty OpenAI-compatible template). Each self-identifies with a 'provider' key. - File still COMPILES CLEAN (py_compile OK).
NOT done yet (next session — exact spots): 1. Pollinations is NOT yet the default — change _get_default_settings() lines ~1297-1298: default_chat_api + image_api should copy pollinations not openai. 2. call_api() (~line 566): text works AS-IS for pollinations via generic Bearer path, but needs a branch to inject payload['referrer'] for credit attribution; AI Horde needs a NEW _call_aihorde_text() submit-and-poll helper (NOT OpenAI-compatible). 3. generate_image() (~line 916): currently only does OpenAI-shaped POST. Needs branches: pollinations = GET image_endpoint + urlencoded prompt + ?model=&width=&height=&referrer=, Bearer header, save raw bytes; aihorde = POST /generate/async {prompt,params,models} + poll /generate/status/{id} -> generations[0].img. Should read endpoint from image_endpoint/default_image_model (image-specific fields), not the chat 'endpoint'. 4. Add 'custom' + 'pollinations' + 'aihorde' to the image-settings submenu branch (~line 4567) so their image fields are editable.
Files: MODIFIED /home/user/Projects/adv-cli-char-gen/incomplete-char-gen-enhanced-5k-v2.py (API_PROVIDERS only). Backups: incomplete-char-gen-enhanced-5k-v2.py.bak-20260723_*.
Testing: 🔵 none — no live API call made; keys never hardcoded (read from Settings only). Anon's live sk_ Pollinations key sits in plaintext at ~/claude/pollinations/pollinations-llm-info.txt line 2 — flagged to move it out of any repo, never commit.
Dependencies: rich/requests/PIL/cryptography/markdown_it (all in system python, no venv). requests only (no aihorde pypi lib — native REST chosen to dodge the python-conflict curse).