Files
s41r4j-aish/docs/DOCKER.md
T

4.1 KiB

AiSH Docker Setup

AiSH runs entirely in Docker. The Rust binary and llama-cli are installed in the image, while the GGUF model, configuration, history, logs, and cache are stored in the persistent aish-home Docker volume.

Model

  • Repository: Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF
  • File: qwen2.5-coder-1.5b-instruct-q2_k.gguf
  • Container path: /home/aish/.aish/models/aish.gguf
  • Config path: /home/aish/.aish/config.toml

The repository is public, so HF_TOKEN is not required for the current model. Passing -e HF_TOKEN="$HF_TOKEN" is still supported and is useful if the configured model is changed to a gated or private repository.

Build

Start Docker Desktop, then run from the repository root:

docker build -t aish-beta-llama .
docker volume create aish-home

Rebuilding the image does not remove or replace the aish-home volume.

Download the Model

Download directly into the persistent Docker volume:

docker run --rm \
  -v aish-home:/home/aish/.aish \
  --entrypoint aish-download-model \
  aish-beta-llama

AiSH also downloads the configured model automatically on first use when the model path does not exist.

Open the Docker Shell

docker run --rm -it \
  -v aish-home:/home/aish/.aish \
  --entrypoint /bin/bash \
  aish-beta-llama

Inside the container:

aish

Use preview-only mode while validating generated commands:

aish --no-exec "show the 20 largest files recursively"

Use natural-language summaries instead of direct command output:

aish --natural-output

Run AiSH Directly

Interactive:

docker run --rm -it \
  -v aish-home:/home/aish/.aish \
  aish-beta-llama:latest

Interactive with natural-language output enabled:

docker run --rm -it \
  -v aish-home:/home/aish/.aish \
  aish-beta-llama:latest \
  --natural-output

Preview real-model command generation without executing it:

docker run --rm \
  -v aish-home:/home/aish/.aish \
  aish-beta-llama:latest \
  --no-exec "find all Python files recursively"

Test harmless execution with raw output:

docker run --rm \
  -v aish-home:/home/aish/.aish \
  aish-beta-llama:latest \
  "show current directory"

Test harmless execution with summarized output:

docker run --rm \
  -v aish-home:/home/aish/.aish \
  aish-beta-llama:latest \
  --natural-output "show current directory"

The previous token-based form remains valid:

docker run --rm -it \
  -e HF_TOKEN="$HF_TOKEN" \
  -v aish-home:/home/aish/.aish \
  aish-beta-llama:latest

Configuration

Inspect the active configuration:

docker run --rm \
  -v aish-home:/home/aish/.aish \
  --entrypoint /bin/bash \
  aish-beta-llama \
  -lc 'cat /home/aish/.aish/config.toml'

Read it from an interactive container shell:

sed -n '1,200p' ~/.aish/config.toml

The default model settings are:

model_download_dir = "/home/aish/.aish/models"
model_path = "/home/aish/.aish/models/aish.gguf"
model_repo = "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF"
model_file = "qwen2.5-coder-1.5b-instruct-q2_k.gguf"

Existing volumes retain their old config.toml. To update one without deleting its history or model, open the Docker shell and edit only these four values.

Volume Maintenance

Show the downloaded model:

docker run --rm \
  -v aish-home:/home/aish/.aish \
  --entrypoint /bin/bash \
  aish-beta-llama \
  -lc 'ls -lh /home/aish/.aish/models'

The volume survives container removal. Removing aish-home permanently deletes the model, config, and command history, so do that only when a complete reset is intended.

Troubleshooting

model download failed: verify Docker has internet access and rerun the download command.

failed to start AiSH model runtime: verify llama-cli:

docker run --rm --entrypoint llama-cli aish-beta-llama --version

Permission denied under /home/aish/.aish: repair volume ownership:

docker run --rm --user root \
  -v aish-home:/home/aish/.aish \
  --entrypoint /bin/bash \
  aish-beta-llama \
  -lc 'chown -R aish:aish /home/aish/.aish'