[PR #502] [MERGED] feat: add llamactl serve command for local development #504

Closed
opened 2026-02-16 02:15:23 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_deploy/pull/502
Author: @masci
Created: 5/20/2025
Status: Merged
Merged: 5/20/2025
Merged by: @masci

Base: mainHead: massi/serve


📝 Commits (10+)

📊 Changes

27 files changed (+462 additions, -119 deletions)

View changed files

📝 e2e_tests/apiserver/deployments/deployment_env_local.yml (+3 -3)
📝 e2e_tests/apiserver/deployments/deployment_hitl.yml (+1 -1)
📝 e2e_tests/apiserver/deployments/deployment_streaming.yml (+1 -1)
📝 e2e_tests/apiserver/rc/deployment.yml (+1 -1)
📝 llama_deploy/apiserver/deployment.py (+43 -37)
📝 llama_deploy/apiserver/deployment_config_parser.py (+6 -3)
📝 llama_deploy/apiserver/routers/deployments.py (+4 -2)
📝 llama_deploy/apiserver/server.py (+8 -13)
📝 llama_deploy/apiserver/settings.py (+3 -3)
📝 llama_deploy/apiserver/source_managers/base.py (+14 -1)
📝 llama_deploy/apiserver/source_managers/git.py (+13 -2)
📝 llama_deploy/apiserver/source_managers/local.py (+28 -4)
📝 llama_deploy/cli/__init__.py (+4 -2)
📝 llama_deploy/cli/serve.py (+49 -7)
📝 llama_deploy/client/models/apiserver.py (+7 -2)
📝 tests/apiserver/data/env_variables.yaml (+3 -0)
📝 tests/apiserver/data/example.yaml (+0 -3)
📝 tests/apiserver/data/python_dependencies.yaml (+3 -0)
📝 tests/apiserver/data/service_ports.yaml (+9 -0)
📝 tests/apiserver/routers/test_deployments.py (+1 -1)

...and 7 more files

📄 Description

General concept:

  • Added a new command serve to llamactl to boostrap a local LlamaDeploy instance running a specific deployment.
  • When passing --local to llamactl serve, no code will be copied around, so changes to the local code will be picked up at the next restart (there's a plan to introduce a file watcher to make iterations even faster)
  • Prior to this PR the concept of "local run" didn't exist, so I had to instruct several components to not try to sync the code listed in a deployment file. Several parts of the apiserver now takes a boolean flag called local.

For more specific comments to the code, see my review.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_deploy/pull/502 **Author:** [@masci](https://github.com/masci) **Created:** 5/20/2025 **Status:** ✅ Merged **Merged:** 5/20/2025 **Merged by:** [@masci](https://github.com/masci) **Base:** `main` ← **Head:** `massi/serve` --- ### 📝 Commits (10+) - [`862f341`](https://github.com/run-llama/llama_deploy/commit/862f341ccd2a9202dea25ae5301a10d60cdb2b66) get deployment folder from config - [`316304b`](https://github.com/run-llama/llama_deploy/commit/316304b62bfec236b9490219b435a7bbac6ee1da) add serve command - [`648230b`](https://github.com/run-llama/llama_deploy/commit/648230bde4a58a3bee3f449f9cb0b639e4ac1d1b) rework sync method - [`37764d0`](https://github.com/run-llama/llama_deploy/commit/37764d0c1c86ed66207837780ceecbc36f689c4e) propagate skip_sync - [`3f032ca`](https://github.com/run-llama/llama_deploy/commit/3f032ca6d83483775dfce827f0ee6f1318025dae) propagate skip_sync param - [`23cd109`](https://github.com/run-llama/llama_deploy/commit/23cd109367c68aa27e389392e6f4a507bebcab2d) do not shell out, run uvicorn directly - [`bd0120a`](https://github.com/run-llama/llama_deploy/commit/bd0120a4eb9a7cfd7bc639b578dfae4ac654b69d) backup - [`4c80684`](https://github.com/run-llama/llama_deploy/commit/4c806845c527f862800c28b324402f6e4737d6b4) lazy pass deployments path to Manager - [`41a07ec`](https://github.com/run-llama/llama_deploy/commit/41a07ece341664683bce989bcde51e34862c16f6) backup - [`2db81c5`](https://github.com/run-llama/llama_deploy/commit/2db81c571fb700b0027db654d59ee56861392d19) fix ### 📊 Changes **27 files changed** (+462 additions, -119 deletions) <details> <summary>View changed files</summary> 📝 `e2e_tests/apiserver/deployments/deployment_env_local.yml` (+3 -3) 📝 `e2e_tests/apiserver/deployments/deployment_hitl.yml` (+1 -1) 📝 `e2e_tests/apiserver/deployments/deployment_streaming.yml` (+1 -1) 📝 `e2e_tests/apiserver/rc/deployment.yml` (+1 -1) 📝 `llama_deploy/apiserver/deployment.py` (+43 -37) 📝 `llama_deploy/apiserver/deployment_config_parser.py` (+6 -3) 📝 `llama_deploy/apiserver/routers/deployments.py` (+4 -2) 📝 `llama_deploy/apiserver/server.py` (+8 -13) 📝 `llama_deploy/apiserver/settings.py` (+3 -3) 📝 `llama_deploy/apiserver/source_managers/base.py` (+14 -1) 📝 `llama_deploy/apiserver/source_managers/git.py` (+13 -2) 📝 `llama_deploy/apiserver/source_managers/local.py` (+28 -4) 📝 `llama_deploy/cli/__init__.py` (+4 -2) 📝 `llama_deploy/cli/serve.py` (+49 -7) 📝 `llama_deploy/client/models/apiserver.py` (+7 -2) 📝 `tests/apiserver/data/env_variables.yaml` (+3 -0) 📝 `tests/apiserver/data/example.yaml` (+0 -3) 📝 `tests/apiserver/data/python_dependencies.yaml` (+3 -0) 📝 `tests/apiserver/data/service_ports.yaml` (+9 -0) 📝 `tests/apiserver/routers/test_deployments.py` (+1 -1) _...and 7 more files_ </details> ### 📄 Description General concept: - Added a new command `serve` to `llamactl` to boostrap a local LlamaDeploy instance running a specific deployment. - When passing `--local` to `llamactl serve`, no code will be copied around, so changes to the local code will be picked up at the next restart (there's a plan to introduce a file watcher to make iterations even faster) - Prior to this PR the concept of "local run" didn't exist, so I had to instruct several components to not try to sync the code listed in a deployment file. Several parts of the `apiserver` now takes a boolean flag called `local`. For more specific comments to the code, see my review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:15:23 -05:00
yindo closed this issue 2026-02-16 02:15:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_deploy#504