2.6 KiB
2.6 KiB
Aider on FreeBSD (Notes)
This captures what worked in this repo/session for Aider on FreeBSD.
Rust toolchain (required for native deps)
Some Aider dependencies compile native code. Install rustup under /opt/clawdie
so the toolchain is available across reboots and rebuilds:
sudo mkdir -p /opt/clawdie/tmp /opt/clawdie/rustup /opt/clawdie/cargo
sudo fetch -o /opt/clawdie/tmp/rustup-init.sh https://sh.rustup.rs
sudo env RUSTUP_HOME=/opt/clawdie/rustup CARGO_HOME=/opt/clawdie/cargo \
sh /opt/clawdie/tmp/rustup-init.sh -y --profile minimal --default-toolchain stable
Add to your shell profile:
export RUSTUP_HOME=/opt/clawdie/rustup
export CARGO_HOME=/opt/clawdie/cargo
export PATH=/opt/clawdie/cargo/bin:$PATH
What did not work (yet)
pkg install uv+uv tool install aider-chatfailed to buildtree-sitter: missingtree_sitter/parser.hon FreeBSD. Thetree-sitterpkg only shipsapi.h, so building from source fails.
Working install (tested)
- Install Aider from packages (adds many deps but works):
sudo pkg install py311-aider_chat
- Create a project-local venv that can override litellm:
python3.11 -m venv --system-site-packages /home/clawdie/clawdie-ai/tmp/aider-venv
- Upgrade Aider + pin litellm to the expected version inside the venv:
/home/clawdie/clawdie-ai/tmp/aider-venv/bin/pip install --no-user --no-deps --upgrade --ignore-installed aider-chat==0.86.2
/home/clawdie/clawdie-ai/tmp/aider-venv/bin/pip install --no-user --no-deps --upgrade --ignore-installed litellm==1.81.10
- Align tree-sitter with the system tree-sitter-languages package (fixes repo-map crash):
env TMPDIR=/home/clawdie/clawdie-ai/tmp \
/home/clawdie/clawdie-ai/tmp/aider-venv/bin/pip install --no-user --upgrade --force-reinstall tree_sitter==0.20.4
FreeBSD ships tree_sitter_languages from packages (1.10.2) which expects
tree_sitter 0.20.x. Mismatch causes:
TypeError: __init__() takes exactly 1 argument (2 given)
- Run Aider (use the venv binary):
env AIDER_ANALYTICS_DISABLE=1 /home/clawdie/clawdie-ai/tmp/aider-venv/bin/aider \
--no-check-update --no-gitignore --model zai/glm-5-turbo --message "What model are you?"
ZAI endpoint mismatch
PI uses this ZAI base:
https://api.z.ai/api/coding/paas/v4
LiteLLM defaults to https://api.z.ai/api/paas/v4, which caused failures until
we aligned the base URL. Set this in .env:
ZAI_API_BASE=https://api.z.ai/api/coding/paas/v4
Model access notes
zai/glm-5-turboworks with the current key.zai/glm-5-codereturns403("You do not have permission to access").