Conversation
When LEMONADE_BASE_URL points to a remote server, gaia init now auto-detects remote mode and downloads models via the REST API instead of failing trying to install the local lemonade-server binary. - Auto-detect remote mode from LEMONADE_BASE_URL (non-localhost hosts) - Use LemonadeClient.pull_model_stream() API for model downloads in remote mode, with progress bar display - Fall back to API when local lemonade-server CLI is unavailable - Add unit tests for remote detection, API pull, and fallback behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0846bf7 to
0153d22
Compare
…ation-fails-on-ubuntu-24043-lts
Replace ~170-line _download_models() subprocess/CLI logic and ~50-line _pull_models_via_api() with calls to LemonadeClient.ensure_model_downloaded(), which handles availability checks, API downloads, and progress for both local and remote servers. Closes #311
Replace ~170-line _download_models() subprocess/CLI logic and ~50-line _pull_models_via_api() with calls to LemonadeClient.ensure_model_downloaded(), which handles availability checks, API downloads, and progress for both local and remote servers. Closes #311
…https://github.com/amd/gaia into 311-gaia-init-installation-fails-on-ubuntu-24043-lts
- Fix LEMONADE_HOST → LEMONADE_BASE_URL in remote error message - Update --remote CLI help to describe actual behavior (skip local install/start, download models via API, auto-detection) - Document remote mode in cli.mdx: updated options table, added env var example, annotated steps with remote behavior, added Remote Mode tip block Closes #311
Give remote mode proper visibility as a #### subsection instead of a <Tip> block, and present both activation methods (--remote flag and LEMONADE_BASE_URL env var) as equal options. Co-Authored-By: Tomasz Iniewicz <infancy_shred.0d@icloud.com>
Remove standalone #### Remote Mode section to fix asymmetric TOC, add intro paragraph explaining Local vs Remote modes before the Tabs, and move activation details into the Remote Mode tab.
|
@claude review this PR for any issues. |
|
Claude finished @kovtcharov's task —— View job Reviewing PR #345
Code Review SummaryThis PR is well-structured and addresses the issue appropriately. The changes significantly simplify the codebase by delegating model downloads to 🟢 Strengths
🟡 Minor Observations
🟢 Test QualityThe new tests are well-structured and properly mock dependencies:
VerdictLGTM - This is a clean refactor that improves maintainability while fixing the reported issue. The minor observations above are non-blocking and can be addressed in future iterations if desired. |
## Summary - Add release notes for v0.15.4.1 (`docs/releases/v0.15.4.1.mdx`) - Bump `__version__` from `0.15.4` → `0.15.4.1` in `src/gaia/version.py` - Add `releases/v0.15.4.1` to nav and update navbar label in `docs/docs.json` Closes #336, #339, #344, #345, #342, #348, #346 > **Note:** Do not tag `v0.15.4.1` until after this PR merges. --------- Co-authored-by: Tomasz Iniewicz <infancy_shred.0d@icloud.com>
## Summary Fixes #311 When `LEMONADE_BASE_URL` points to a remote Lemonade server (e.g., Docker container without local Lemonade CLI), `gaia init` previously failed trying to install the local `lemonade-server` binary. This PR fixes that by: - **Auto-detecting remote mode** from `LEMONADE_BASE_URL` when it points to a non-localhost host - **Delegating model downloads to `LemonadeClient.ensure_model_downloaded()`** instead of shelling out to the local CLI or reimplementing streaming pull logic - **Removing ~165 lines** of subprocess calls, CLI fallback routing, retry-on-corruption logic, and the separate `_pull_models_via_api()` method — all replaced by the existing client method that works for both local and remote servers ### Bonus fix: `_ctx_warning` displayed "None" during verification **Why:** During Step 4 model verification, the output showed `✓ Qwen3-0.6B-GGUF - OK None` instead of `✓ Qwen3-0.6B-GGUF - OK (ctx: 4096)`. **Before:** `self._ctx_warning` was initialized to `None` in `__init__()` (line 197). The display code used `hasattr(self, "_ctx_warning")` to check whether a warning existed — but since the attribute was always set (to `None`), `hasattr` always returned `True`. The f-string then rendered `None` as the literal string `"None"` inside the Rich markup. ```python # Before — hasattr is always True because __init__ sets it to None if hasattr(self, "_ctx_warning"): ctx_msg = f" [yellow]{self._ctx_warning}[/yellow]" # → " [yellow]None[/yellow]" delattr(self, "_ctx_warning") ``` **After:** Check the value's truthiness instead of attribute existence: ```python # After — only renders when _ctx_warning has an actual message if self._ctx_warning: ctx_msg = f" [yellow]{self._ctx_warning}[/yellow]" self._ctx_warning = None ``` **Justification:** The `hasattr` check was the wrong guard here because `_ctx_warning` is always defined on the instance. The attribute is only populated with a real string when `actual_ctx > min_ctx` (context is larger than required). When context matches exactly (the common case), it stays `None`, and truthiness correctly skips the warning display. ### Before ``` Step 3/4: Downloading models for 'minimal' profile... [runs subprocess: lemonade-server pull Qwen3-0.6B-GGUF] [retries on corruption, falls back to API if CLI missing] Step 4/4: Verifying setup... ✓ Qwen3-0.6B-GGUF - OK None ``` ### After ``` Step 3/4: Downloading models for 'minimal' profile... Downloading: Qwen3-0.6B-GGUF ✓ Downloaded Qwen3-0.6B-GGUF Step 4/4: Verifying setup... ✓ Qwen3-0.6B-GGUF - OK (ctx: 4096) ``` ## Test plan - [x] Unit tests pass (`pytest tests/unit/test_init_command.py` — 42/42 passed) - [x] Full unit test suite passes (`pytest tests/unit/` — 417 passed, 13 skipped) - [x] Lint passes (`python util/lint.py --all`) - [x] E2E: `LEMONADE_BASE_URL=https://itomek-gaia.ngrok.app/api/v1 gaia init --profile minimal --yes` — all 4 steps complete, context displays correctly --------- Co-authored-by: Tomasz Iniewicz <infancy_shred.0d@icloud.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary - Add release notes for v0.15.4.1 (`docs/releases/v0.15.4.1.mdx`) - Bump `__version__` from `0.15.4` → `0.15.4.1` in `src/gaia/version.py` - Add `releases/v0.15.4.1` to nav and update navbar label in `docs/docs.json` Closes #336, #339, #344, #345, #342, #348, #346 > **Note:** Do not tag `v0.15.4.1` until after this PR merges. --------- Co-authored-by: Tomasz Iniewicz <infancy_shred.0d@icloud.com>
Summary
Fixes #311
When
LEMONADE_BASE_URLpoints to a remote Lemonade server (e.g., Docker container without local Lemonade CLI),gaia initpreviously failed trying to install the locallemonade-serverbinary. This PR fixes that by:LEMONADE_BASE_URLwhen it points to a non-localhost hostLemonadeClient.ensure_model_downloaded()instead of shelling out to the local CLI or reimplementing streaming pull logic_pull_models_via_api()method — all replaced by the existing client method that works for both local and remote serversBonus fix:
_ctx_warningdisplayed "None" during verificationWhy: During Step 4 model verification, the output showed
✓ Qwen3-0.6B-GGUF - OK Noneinstead of✓ Qwen3-0.6B-GGUF - OK (ctx: 4096).Before:
self._ctx_warningwas initialized toNonein__init__()(line 197). The display code usedhasattr(self, "_ctx_warning")to check whether a warning existed — but since the attribute was always set (toNone),hasattralways returnedTrue. The f-string then renderedNoneas the literal string"None"inside the Rich markup.After: Check the value's truthiness instead of attribute existence:
Justification: The
hasattrcheck was the wrong guard here because_ctx_warningis always defined on the instance. The attribute is only populated with a real string whenactual_ctx > min_ctx(context is larger than required). When context matches exactly (the common case), it staysNone, and truthiness correctly skips the warning display.Before
After
Test plan
pytest tests/unit/test_init_command.py— 42/42 passed)pytest tests/unit/— 417 passed, 13 skipped)python util/lint.py --all)LEMONADE_BASE_URL=https://itomek-gaia.ngrok.app/api/v1 gaia init --profile minimal --yes— all 4 steps complete, context displays correctly