Commit Graph

54 Commits

Author SHA1 Message Date
709dcd8882 fix: use correct NO_DOCS and NO_REDOC environment variables
- Replace DISABLE_SWAGGER_UI with NO_DOCS and NO_REDOC
- Following official LiteLLM documentation for disabling API docs
- Disables both Swagger UI and Redoc documentation interfaces

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 02:17:40 +01:00
b66e28d874 fix: use DISABLE_SWAGGER_UI environment variable instead of invalid flag
- Remove invalid --disable_swagger command flag
- Add DISABLE_SWAGGER_UI=true environment variable
- Fixes LiteLLM startup error

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 02:15:31 +01:00
f1ff42f452 feat: disable Swagger UI in LiteLLM proxy
- Add --disable_swagger flag to LiteLLM command
- Improves security by hiding API documentation interface

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 02:14:43 +01:00
2934caa9ed fix: disable Watchtower for Facefusion custom local image
Watchtower was trying to pull updates from Docker Hub for facefusion-patched:3.5.0-cpu
which only exists locally, causing spam errors. Disabled Watchtower monitoring for this
container since it's a custom-built image with NSFW filter patches.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 08:30:51 +01:00
f71b150263 feat: add tty flag for Gradio to start properly 2025-11-13 06:18:58 +01:00
0b43299ffd fix: update content_analyser hash check in core.py for patched version 2025-11-13 06:16:14 +01:00
95099a443e feat: build custom Facefusion image with NSFW filter patch baked in 2025-11-13 06:05:42 +01:00
8f406f62c1 fix: add command with -u flag to start Facefusion 2025-11-13 06:01:09 +01:00
c2d25dde59 fix: remove entrypoint override to use default Facefusion startup 2025-11-13 05:59:05 +01:00
3c56f05286 fix: add Gradio environment variables and remove conflicting command 2025-11-13 05:52:13 +01:00
65865b7bb8 fix: add listen and port flags to start Gradio server properly 2025-11-13 05:51:24 +01:00
539f689269 fix: use run.py to start Gradio server 2025-11-13 05:50:37 +01:00
025118a25e fix: use simple run command without extra flags 2025-11-13 05:47:32 +01:00
72fd26f8ea fix: use headless-run command to start Gradio server 2025-11-13 05:46:20 +01:00
77f945dd3f fix: add execution flags to facefusion.py run command 2025-11-13 05:43:51 +01:00
7f667c371f fix: correct patch for Facefusion 3.5.0 content_analyser.py
- Fixed line number and function names to match actual source
- Added validation to ensure patch was applied
- Updated patch file with correct context

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 04:28:50 +00:00
cd9c38e524 docs: add patch file for disabling NSFW filter
This patch file documents the exact change made to content_analyser.py
for disabling the NSFW content filter in Facefusion 3.5.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 04:24:36 +00:00
59f2e8b0fc refactor: use source code patch instead of deleting NSFW models
Cleaner solution based on Reddit community feedback:
- Patch content_analyser.py to return False (always safe)
- Remove unused config file
- Remove config volume mount from compose
- Much simpler and more reliable than file deletion approach

Credit: https://www.reddit.com/r/StableDiffusion/comments/1m2w5af/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 04:23:38 +00:00
398ebd342c fix: add verbose logging to NSFW model deletion
- Added echo statements to track script execution
- Added -v flag to rm to show deleted files
- Confirmed deletion is working correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 04:07:33 +00:00
dd9a9a44cb fix: allow Facefusion to start by deleting NSFW models after download
Previous approach caused infinite download loop. Now waits for models
to download, then deletes NSFW models once, allowing Gradio to start.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 04:02:30 +00:00
5768fe65ff feat: disable NSFW filter in Facefusion
- Add entrypoint script to continuously delete NSFW model files
- Add Facefusion config file (for future use)
- NSFW content filtering now disabled

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 03:52:21 +00:00
c30d2d7407 chore: facefusion 2025-11-12 16:42:41 +01:00
8445256b0f chore: facefusion 2025-11-12 16:38:57 +01:00
9f9119358a fix: add Python unbuffered flag to see Gradio startup logs 2025-11-12 11:01:23 +01:00
b7f03a313f fix: use port 7865 for both Gradio and Traefik 2025-11-12 10:56:30 +01:00
08cce3479f fix: add command back with python3 and default port 7860 2025-11-12 10:51:35 +01:00
22eaaa9b30 fix: remove custom command and use default Gradio port 7860 for Facefusion 2025-11-12 10:50:11 +01:00
8ac025a14c fix: add command to start Facefusion web UI 2025-11-12 09:42:31 +01:00
8b77f92028 feat: integrate Facefusion into AI stack
Added Facefusion face swapping service to the AI stack:

**Configuration:**
- URL: https://facefusion.ai.pivoine.art
- Image: facefusion/facefusion:3.5.0-cpu
- Port: 7865
- Container: ai_facefusion
- Volume: ai_facefusion_data
- HTTP Basic Auth protection
- CPU execution mode (GPU when available)

**Changes:**
- Added facefusion service to ai/compose.yaml
- Added AI_FACEFUSION_* env vars to arty.yml
- Created ai_facefusion_data volume
- Removed old standalone facefusion stack
- Removed ai/README-export.md and ai/webui-export.py

Facefusion will run on CPU until GPU server is available.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 09:36:52 +01:00
3ddc76e213 fix: add additional_drop_params at global litellm_settings level 2025-11-11 12:36:49 +01:00
cabac4b767 fix: use additional_drop_params to explicitly drop prompt_cache_key
According to litellm docs, drop_params only drops OpenAI parameters.
Since prompt_cache_key is an Anthropic-specific parameter, we need
to use additional_drop_params to explicitly drop it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 12:33:10 +01:00
da0dc2363a fix: disable prompt caching and responses API in litellm
- Add LITELLM_DROP_PARAMS environment variable
- Disable cache in litellm_settings
- Attempt to disable responses API endpoint
- Remove invalid supports_prompt_caching parameter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 12:27:06 +01:00
813823995c fix: disable prompt caching for claude-sonnet-4.5
Explicitly set drop_params and supports_prompt_caching=false for
claude-sonnet-4.5 model to prevent prompt_cache_key parameter from
being sent to Anthropic API.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 12:22:27 +01:00
f36e0fa9eb fix: enhance litellm parameter dropping for codex compatibility
Add router_settings and default_litellm_params to ensure unsupported
parameters like prompt_cache_key are properly dropped when using codex
with the litellm proxy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 12:14:00 +01:00
ce6c60d8e0 fix: disable responses ID security for Codex CLI compatibility
Added disable_responses_id_security setting to allow Codex CLI to access
the /responses endpoint without 401 errors. This removes the encryption
requirement on response IDs while maintaining API key authentication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 19:00:55 +01:00
db69b30d06 feat: add PostgreSQL initialization script for AI stack
Created database initialization script following the core stack pattern.
The script automatically creates required databases on first initialization:
- openwebui: Open WebUI application database
- litellm: LiteLLM proxy database for API key management and tracking

Changes:
- Created ai/postgres/init/01-init-databases.sh
- Mounted init directory in ai_postgres service
- Added automatic privilege grants to AI_DB_USER

Note: Init script only runs on first database creation when volume is empty.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:36:50 +01:00
5a6b007cf3 feat: connect LiteLLM to AI PostgreSQL database
LiteLLM now uses the ai_postgres database instance with a dedicated
'litellm' database for API key management, usage tracking, and rate limiting.

Changes:
- Set DATABASE_URL to postgresql://ai:password@ai_postgres:5432/litellm
- Added depends_on ai_postgres to ensure DB starts first

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:34:10 +01:00
b6cb155da8 fix: remove HTTP Basic Auth from LiteLLM proxy
Removed authentication middleware to simplify access. LiteLLM now relies
solely on Bearer token authentication via LITELLM_MASTER_KEY.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:30:57 +01:00
87654f5ae8 feat: enable LiteLLM API key authentication
Re-enabled LITELLM_MASTER_KEY for proper API key authentication.
LiteLLM supports master key without database for simple auth scenarios.

- LiteLLM validates Bearer token against master key
- Open WebUI uses same key for internal communication
- External access requires both HTTP Basic Auth + API key

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:25:57 +01:00
7ea4b3ab57 fix: remove LiteLLM MASTER_KEY requirement
Removed LITELLM_MASTER_KEY as it requires a database for virtual key
management. Security is already provided by HTTP Basic Auth on the
public Traefik endpoint. Internal Open WebUI communication doesn't
need additional API key auth.

Security layers:
- Public access: HTTP Basic Auth via Traefik
- Internal LiteLLM: Network isolation (no auth needed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:21:13 +01:00
2055cbb675 feat: secure LiteLLM API key with environment variable
- Added AI_LITELLM_API_KEY environment variable to .env
- Configured LiteLLM MASTER_KEY for authentication
- Updated Open WebUI to use secure API key from environment
- Generated secure 64-character hex key: sk-77b42236...

This replaces the insecure hardcoded sk-1234 key with proper
secret management via environment variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:19:26 +01:00
16dd8064d4 fix: disable LiteLLM healthcheck due to missing curl
Healthcheck was failing because curl is not installed in the LiteLLM
container, causing Traefik to mark it as unhealthy and not route traffic.
Disabled healthcheck as Traefik doesn't require it for routing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:13:26 +01:00
c86faf1898 fix: bind LiteLLM to 0.0.0.0 for Traefik accessibility
LiteLLM was binding to localhost by default, making it unreachable
from Traefik reverse proxy. Added --host 0.0.0.0 parameter to allow
connections from the Docker network.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:10:15 +01:00
eb4a025c20 feat: add HTTP Basic Auth to LiteLLM for enhanced security
Added Traefik Basic Auth middleware to LiteLLM public endpoint for
two-layer security:
1. HTTP Basic Auth (Traefik level)
2. API Key authentication (LiteLLM level)

Changes:
- Added basicauth middleware using AUTH_USERS credentials
- Chained auth middleware before compression and security headers
- Prevents unauthorized access to public LiteLLM endpoint

Usage with Codex:
export OPENAI_BASE_URL=https://username:password@llm.ai.pivoine.art
export OPENAI_API_KEY=sk-1234

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:04:09 +01:00
1d69107ebb feat: expose LiteLLM publicly for Codex CLI integration
Added Traefik configuration to make LiteLLM accessible at llm.ai.pivoine.art
for use with @openai/codex CLI tool.

Changes:
- Added AI_LITELLM_TRAEFIK_HOST to arty.yml (llm.ai.pivoine.art)
- Updated ai/compose.yaml litellm service with full Traefik labels
- HTTP to HTTPS redirect
- SSL termination via Let's Encrypt
- Compression and security headers

This allows external tools like Codex to use Claude models via
OpenAI-compatible API endpoint.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 17:56:34 +01:00
cdb8d2ef34 fix: correct LiteLLM environment variable syntax
Changed API key reference from ${ANTHROPIC_API_KEY} to
os.environ/ANTHROPIC_API_KEY to match LiteLLM's documented syntax.

The os.environ/ prefix tells LiteLLM to use os.getenv() to retrieve
the environment variable at runtime, which is the correct way to
reference environment variables in LiteLLM config files.

Reference: https://docs.litellm.ai/docs/proxy/deploy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 00:30:07 +01:00
f0e99d2776 revert: remove SFTP integration from AI stack
Removed custom Dockerfile and SFTP function integration in favor of
the simpler REST API approach (webui-export.py).

Changes:
- Restored webui service to use official Open WebUI image
- Removed custom Dockerfile.webui (paramiko build)
- Removed ai/functions/save_to_disk.py SFTP function
- Removed SSH key and functions volume mounts

The REST API export script (webui-export.py) is a simpler and more
flexible solution that doesn't require Docker modifications.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 23:15:27 +01:00
a0d5006cf5 feat: add Open WebUI code export script via REST API
Added Python script to extract and save code blocks from Open WebUI
chat conversations to local disk using the REST API.

Features:
- Export code blocks from specific chats or all chats
- Automatic language detection and proper file extensions
- Organizes files by chat title with metadata
- No Docker modifications needed
- Remote access support via SSH tunnel or public URL

Usage:
  python3 ai/webui-export.py --all --output-dir ./exports
  python3 ai/webui-export.py --chat-id <id> --output-dir ./code

This replaces the complex SFTP integration with a simple API-based
approach that's easier to maintain and use.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 23:12:37 +01:00
5818644c1a feat: add SFTP integration for saving code to local disk
Added custom Open WebUI function for SSH/SFTP file operations:

**New Function: save_to_disk.py**
- save_file(): Write generated code to local filesystem via SFTP
- read_file(): Read files from local disk
- list_files(): List directory contents
- Configurable via Valves (host, port, username, paths)

**Custom Dockerfile (Dockerfile.webui)**
- Based on ghcr.io/open-webui/open-webui:main
- Installs paramiko library for SSH/SFTP support
- Creates .ssh directory for key storage

**Configuration Updates**
- Mount SSH private key from host (/root/.ssh/id_rsa)
- Mount functions directory for custom tools
- Build custom image with SFTP capabilities

**Usage in Open WebUI**
Claude can now use these tools to:
- Generate code and save it directly to your local disk
- Read existing files for context
- List project directories
- Create new files in any project

Default base path: /home/valknar/Projects
Authentication: SSH key-based (passwordless)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 23:07:11 +01:00
424e6d044d fix: configure LiteLLM without database requirement 2025-11-08 23:02:07 +01:00