This document details the differences and considerations for AI Studio Proxy API on different operating systems (Windows, macOS, Linux).
All platforms need to meet the following basic requirements:
- Python: >=3.9, <4.0 (Recommended 3.10 or 3.11)
- Memory: Recommended 2GB+ available RAM
- Disk: At least 1GB available space
- Network: Stable internet connection
- OS: Windows 10 or later
- Architecture: x86_64
- PowerShell: 5.1 or later (Built-in with Windows 10)
Method 1: Official Installer (Recommended)
- Visit python.org
- Download Python 3.10+ installer for Windows
- Run installer, Check "Add Python to PATH"
- Verify installation:
python --version
Method 2: Windows Store
# Install Python 3.11 from Microsoft Store
# Search "Python 3.11" and installMethod 3: Chocolatey
choco install python311PowerShell:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -Add Poetry to PATH:
$env:Path += ";$env:APPDATA\Python\Scripts"PowerShell:
# Poetry Shell
poetry shell
# Or use poetry run
poetry run python launch_camoufox.py --headlessCMD:
poetry shellWindows uses backslash \, but Python code uses / or os.path.join() handles it automatically.
Config File Path:
# Use forward slash or double backslash in .env file
USERSCRIPT_PATH=browser_utils/more_models.js
# Or
USERSCRIPT_PATH=browser_utils\\more_models.jsuvloop supports only Linux and macOS, but the project handles it automatically:
# Configured in pyproject.toml
uvloop = {version = "*", markers = "sys_platform != 'win32'"}Windows will automatically use standard asyncio event loop, functionality is fully normal.
# Check port occupancy
netstat -ano | findstr 2048
# End process
taskkill /PID <ProcessID> /FFirst run might require allowing Python through firewall:
- Windows Firewall prompt will pop up
- Select "Allow access"
- Or manually add rule:
- Open "Windows Defender Firewall"
- Click "Allow an app or feature through Windows Defender Firewall"
- Add Python and Poetry
If you encounter path length limits:
- Open Registry Editor (regedit)
- Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem - Set
LongPathsEnabledto1 - Restart computer
Windows does not have built-in IANA timezone database like Linux/macOS. This project depends on tzdata package to provide timezone support.
- Auto Install: Poetry will automatically install
tzdatabased onpyproject.toml. - Troubleshooting: If
ZoneInfoNotFoundErroroccurs, check iftzdatais installed:poetry run pip show tzdata
- Windows Terminal (Recommended): Modern, supports multiple tabs
- PowerShell 7+: Cross-platform, powerful
- Git Bash: Unix-like environment
Issue: poetry command not found
Solution:
# Check Poetry install path
$env:APPDATA\Python\Scripts\poetry --version
# Add to PATH
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:APPDATA\Python\Scripts", "User")Issue: SSL Certificate Error
Solution:
# Temporarily disable SSL verification (Not recommended for production)
$env:PYTHONHTTPSVERIFY = "0"
# Or install certificates
pip install --upgrade certifi- OS: macOS 10.15 (Catalina) or later
- Architecture: x86_64 or ARM64 (Apple Silicon)
- Xcode Command Line Tools: Auto or manual install
Method 1: Homebrew (Recommended)
# Install Homebrew (If not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python 3.11
brew install python@3.11
# Verify installation
python3 --versionMethod 2: pyenv (Recommended for Developers)
# Install pyenv
brew install pyenv
# Install Python 3.11
pyenv install 3.11
# Set global version
pyenv global 3.11
# Verify
python --versionMethod 3: Official Installer
- Visit python.org
- Download macOS universal installer
- Run
.pkgfile to install
curl -sSL https://install.python-poetry.org | python3 -
# Or use Homebrew
brew install poetryMost dependencies support ARM64 architecture, but Rosetta 2 might be needed:
# Install Rosetta 2 (If needed)
softwareupdate --install-rosettaConfirm Architecture:
# Check Python architecture
python3 -c "import platform; print(platform.machine())"
# arm64 = Apple Silicon native
# x86_64 = Intel or Rosetta 2Use x86_64 version (If compatibility issues occur):
# Run under Rosetta 2
arch -x86_64 python3 script.pymacOS needs to grant terminal permissions:
# If "Operation not permitted" error occurs
# Open "System Preferences" -> "Security & Privacy" -> "Privacy" -> "Full Disk Access"
# Add "Terminal" or "iTerm"# Install macOS certificates
/Applications/Python\ 3.11/Install\ Certificates.command
# Or manual install
pip install --upgrade certifimacOS has GUI by default, but if virtual display is needed:
# Install Xvfb (via XQuartz)
brew install --cask xquartz
# Use after restart
Xvfb :99 -screen 0 1920x1080x24 &
export DISPLAY=:99# Check port occupancy
lsof -i :2048
# End process
kill -9 <PID>- iTerm2 (Recommended): Powerful, customizable
- Terminal.app: Built-in, simple enough
- Warp: Modern, AI assisted
Issue: command not found: poetry
Solution:
# Add Poetry to PATH
export PATH="$HOME/.local/bin:$PATH"
# Add permanently (zsh)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Add permanently (bash)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profileIssue: SSL Certificate Error
Solution:
# Install certificates
/Applications/Python\ 3.11/Install\ Certificates.command- Distro: Ubuntu 20.04+, Debian 11+, Fedora 35+, Arch Linux etc.
- Architecture: x86_64 or ARM64
- Dependencies: Depends on distro
Ubuntu/Debian:
sudo apt update
sudo apt install python3.11 python3.11-venv python3.11-devFedora:
sudo dnf install python3.11 python3.11-develArch Linux:
sudo pacman -S pythoncurl -sSL https://install.python-poetry.org | python3 -
# Or use package manager
# Ubuntu/Debian
sudo apt install python3-poetry
# Fedora
sudo dnf install poetry
# Arch Linux
sudo pacman -S python-poetry# Install Playwright dependencies
sudo apt-get update
sudo apt-get install -y \
libgbm-dev \
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libpango-1.0-0 \
libcairo2 \
libasound2
# Or use Playwright auto install
playwright install-depssudo dnf install -y \
nss \
alsa-lib \
at-spi2-atk \
cups-libs \
gtk3 \
libdrm \
libgbm \
libxkbcommon \
mesa-libgbmsudo pacman -S \
nss \
alsa-lib \
at-spi2-core \
cups \
libdrm \
libxkbcommon \
mesaHeadless servers need virtual display:
# Install Xvfb
# Ubuntu/Debian
sudo apt-get install xvfb
# Fedora
sudo dnf install xorg-x11-server-Xvfb
# Arch Linux
sudo pacman -S xorg-server-xvfb
# Start service with virtual display mode
python launch_camoufox.py --virtual-display# No X Server needed, completely background run
python launch_camoufox.py --headless# Ensure current user has permission to access necessary directories
chmod -R 755 ~/AIstudioProxyAPI
# If binding privileged ports (<1024) is needed
sudo setcap 'cap_net_bind_service=+ep' $(which python3)Ubuntu/Debian (ufw):
sudo ufw allow 2048/tcp
sudo ufw allow 3120/tcp
sudo ufw reloadFedora/RHEL (firewalld):
sudo firewall-cmd --permanent --add-port=2048/tcp
sudo firewall-cmd --permanent --add-port=3120/tcp
sudo firewall-cmd --reloadiptables:
sudo iptables -A INPUT -p tcp --dport 2048 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3120 -j ACCEPT
sudo iptables-saveCreate /etc/systemd/system/aistudio-proxy.service:
[Unit]
Description=AI Studio Proxy API
After=network.target
[Service]
Type=simple
User=youruser
WorkingDirectory=/path/to/AIstudioProxyAPI
Environment="PATH=/path/to/poetry/env/bin"
ExecStart=/path/to/poetry/env/bin/python launch_camoufox.py --headless
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable Service:
sudo systemctl daemon-reload
sudo systemctl enable aistudio-proxy
sudo systemctl start aistudio-proxy
sudo systemctl status aistudio-proxyIf SELinux is enabled:
# Temporarily set to permissive mode
sudo setenforce 0
# Or create custom policy
# (Requires SELinux management knowledge)- GNOME Terminal: GNOME default
- Konsole: KDE Plasma default
- tmux: Terminal multiplexer, suitable for remote server
- Terminator: Supports split screen
Issue: libgbm.so.1: cannot open shared object file
Solution:
sudo apt-get install libgbm1
# Or
sudo dnf install libgbmIssue: Playwright browser installation failed
Solution:
# Use Playwright auto install dependencies
playwright install-deps
# Manually install browser
playwright install firefox- x86_64: Fully supported
- ARM64: Fully supported (Including Apple Silicon)
cd docker
cp .env.docker .env
nano .env # Edit config
docker compose up -d- ✅ Best performance
- ✅ Fully supports all features
- ✅ Minimal resource usage
- ✅ Supports all features
⚠️ Performance slightly lower than native Linux⚠️ Higher resource usage (VM overhead)- 💡 Tip: Allocate sufficient RAM and CPU
Docker Desktop Config:
- Memory: At least 4GB
- CPU: At least 2 Cores
- ✅ Supports all features
⚠️ Requires WSL 2 backend⚠️ Performance slightly lower than Linux- 💡 Tip: Ensure WSL 2 is enabled
WSL 2 Config:
# Check WSL version
wsl --list --verbose
# If using WSL 1, upgrade to WSL 2
wsl --set-version Ubuntu 2
wsl --set-default-version 2All platforms need to get auth file on host then mount:
# docker-compose.yml
volumes:
- ./auth_profiles:/app/auth_profilesSteps:
- Run debug mode on host to get auth.
- Ensure
auth_profilesdirectory (containingactive/subdirectory) is correctly mounted to container. - Restart container.
Performance varies across platforms, mainly depending on underlying architecture and virtualization overhead:
- Linux (Native): Usually provides best performance and lowest latency, benefiting from
uvloopsupport and efficient process management. - macOS: Good performance, Apple Silicon chips perform excellently.
- Windows: Due to lack of
uvloopsupport and file system differences, performance is slightly lower than Linux/macOS, but completely sufficient for daily use. - Docker:
- Linux: Performance close to native.
- macOS/Windows: Due to Docker Desktop using VM, there is extra CPU and memory overhead, startup time and response latency might be slightly higher.
- Primary: macOS or Linux (Native)
- Alternative: Windows 10/11 (Native)
- Not Recommended: Docker (Unless isolation needed)
- Primary: Linux (Native or Docker)
- Alternative: Docker (Cross-platform deployment)
- Not Recommended: Windows Server (Performance and compatibility issues)
- Primary: Docker (Consistency)
- Alternative: Virtual Machine
- Quick Start Guide - Quick deployment
- Installation Guide - Detailed installation steps
- Docker Deployment Guide - Docker deployment
- Troubleshooting Guide - Platform specific issues
If platform specific issues persist, please check Troubleshooting Guide or submit an Issue.