mirror of
https://github.com/akitaonrails/ai-memory.git
synced 2026-10-02 03:24:46 +08:00
Adds the deploy plumbing modelled on ~/Projects/frank_mega's bin/deploy
pattern: a single shell script that builds the image, pushes to a
registry, ssh's the homelab, and `docker compose pull/down/up`s.
Lab-specific values (server, deploy dir, image tag, API keys) live in
.gitignored local files; the repo ships only `.example` templates.
Files added (templates, committed):
- bin/deploy — build/push/restart script; sources bin/deploy.env
- bin/deploy.env.example — SERVER / DEPLOY_DIR / IMAGE template
- docker/docker-compose.prod.yml.example — LAN-binding compose with
`security_opt: label:disable` (required on SELinux-enforcing hosts:
openSUSE MicroOS, Fedora, RHEL) and env_file for secrets
- docker/.env.production.example — API key + provider env template
- docs/deploy.md — first-time setup walkthrough + routine ops
Files added to .gitignore (live copies stay local):
- /bin/deploy.env
- /docker/docker-compose.prod.yml
- /docker/.env.production
Supporting changes surfaced while deploying:
- Default LLM model per provider now lands in factory.rs
(anthropic=claude-sonnet-4-6, openai=gpt-4o-mini; openai-compat
still requires explicit AI_MEMORY_LLM_MODEL). M11 referenced this
in its commit message but the actual code change never made it
into factory.rs; this fixes that gap.
- Stale `claude-sonnet-4-7` references swept to `claude-sonnet-4-6`
across cli.rs / payload.rs / README.md / ARCHITECTURE.md.
Anthropic's API returns 404 for `claude-sonnet-4-7`; the current
Sonnet generation is 4.6.
- Dockerfile was the lone file the earlier port-rename sed missed
(no extension matched my `--include`). EXPOSE + CMD now both use
49374; the container was binding to 7777 silently.
- max_tokens bumped 1500→4000 (single-page consolidator) and
2000→4000 (lint contradiction pass) to accommodate reasoning
models. Kimi 2.6 burns ~2k tokens on hidden reasoning before any
visible JSON, which truncated both paths at the old limits. Non-
reasoning models stop early and don't pay extra for the higher cap.
- Removed `#[serde(deny_unknown_fields)]` from Config. Figment's
Env::prefixed("AI_MEMORY_") provider pulls every AI_MEMORY_-
prefixed var into the struct deserializer, including
AI_MEMORY_LLM_*, AI_MEMORY_EMBEDDING_*, etc. — which are read
directly by factory.rs. Strict rejection crashed every deploy
that configured an LLM via env vars.
End state: container running on the homelab at
http://<homelab>:49374/mcp, healthy, configured for Kimi 2.6 (via
OpenRouter / openai-compat) + text-embedding-3-small hybrid retrieval.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
901 B
Bash
22 lines
901 B
Bash
# Homelab-specific deploy configuration.
|
|
#
|
|
# Copy this file to `bin/deploy.env` and fill in your values. The real
|
|
# `bin/deploy.env` is gitignored — never commit it.
|
|
|
|
# SSH target (user@host or just host if you've set it up in ~/.ssh/config).
|
|
SERVER="me@homelab.example.com"
|
|
|
|
# Absolute path on the homelab where docker-compose.yml + .env.production live.
|
|
# The deploy script runs `docker compose pull/down/up` inside this dir.
|
|
DEPLOY_DIR="/var/opt/docker/utils/ai-memory"
|
|
|
|
# Image tag to build + push + pull. Make sure the Docker host can pull
|
|
# from wherever you push to (Docker Hub, GHCR, your own registry).
|
|
# Default: the official published image. Change to your own fork if
|
|
# you're building from source.
|
|
IMAGE="akitaonrails/ai-memory:latest"
|
|
|
|
# Optional: override the container name if your docker-compose.yml
|
|
# uses something other than the default `ai-memory`.
|
|
# CONTAINER_NAME="ai-memory"
|