feat: add docker-compose deployment and config for local embeddings - #1164
feat: add docker-compose deployment and config for local embeddings#1164vinbyte wants to merge 6 commits into
Conversation
Signed-off-by: vinbyte <hai@gavinda.dev>
|
@vinbyte is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change adds Docker Compose deployment files, configures local embeddings through environment variables, and updates the documented and logged REST endpoint count from 129 to 130. ChangesDocker deployment
REST endpoint count
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DockerCompose
participant DockerImage
participant Entrypoint
participant DataVolume
participant AgentMemory
DockerCompose->>DockerImage: Build and start the service
DockerImage->>Entrypoint: Launch through Tini
Entrypoint->>DataVolume: Initialize data and persist HMAC secret
Entrypoint->>AgentMemory: Start as node
DockerCompose->>AgentMemory: Run liveness healthcheck
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deploy/docker-compose/entrypoint.sh`:
- Around line 85-90: Update the first-boot secret-generation output in the
entrypoint script to remove the line that echoes AGENTMEMORY_SECRET and its
value. Keep only a non-sensitive message indicating the HMAC secret was
generated, along with the existing storage and rotation guidance.
In `@src/providers/embedding/local.ts`:
- Around line 17-18: Update the dimensions initialization in the local embedding
provider constructor to validate LOCAL_EMBEDDING_DIMENSIONS with Number,
requiring a safe integer greater than zero; fall back to 384 when unset or
invalid, including fractional, partial, non-numeric, zero, and negative values.
Add tests covering unset, valid, fractional, non-numeric, zero, and negative
inputs.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e9cdd2df-0d6b-4736-9e0d-e6306b6be1d8
📒 Files selected for processing (8)
AGENTS.mdREADME.mddeploy/docker-compose/.env.exampledeploy/docker-compose/Dockerfiledeploy/docker-compose/docker-compose.ymldeploy/docker-compose/entrypoint.shsrc/index.tssrc/providers/embedding/local.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: vinbyte <hai@gavinda.dev>
…nt logs Signed-off-by: vinbyte <hai@gavinda.dev>
… security Signed-off-by: vinbyte <hai@gavinda.dev>
What this does
LocalEmbeddingProviderinsrc/providers/embedding/local.tsso we can now pass the local model name and its dimensions via.env(LOCAL_EMBEDDING_MODELandLOCAL_EMBEDDING_DIMENSIONS). If nothing is passed, it just defaults back toXenova/all-MiniLM-L6-v2(384) like before.deploy/docker-compose/. Instead of pulling the pre-built image from NPM like the other templates, this one builds directly from the local source.Why
Xenova/all-MiniLM-L6-v2) was hardcoded. Since I wanted to test out different local models (likebge-small), it was a bit annoying having to edit the source code every time. This change makes it way easier to swap models just by editing the.envfile.docker-composesetup in thedeploy/folder that builds from local source. This new setup makes it much faster to test local changes (like the embedding config above) inside a container without having to wait for an NPM release.How to verify
deploy/docker-compose..env.exampleto.env.EMBEDDING_PROVIDER=localand fill inLOCAL_EMBEDDING_MODEL&LOCAL_EMBEDDING_DIMENSIONSif you want to try a different model.docker compose up --build.unit test
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Documentation