fix(local-ai): cap local models to 1b preset#1029
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR restricts local AI presets to a single MVP tier ( Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API_Handler as "Local AI Handler"
participant Presets as "Presets Module"
participant Config as "Config Loader/Applier"
Client->>API_Handler: POST /local_ai/apply_preset { tier: "ram_2_4gb" }
API_Handler->>Presets: validate_tier(tier)
Presets-->>API_Handler: OK (tier is MVP-allowed)
API_Handler->>Config: apply_preset_to_config(tier)
Config->>Config: reject if ModelTier::Custom or !is_mvp_allowed()
Config-->>API_Handler: applied config / result
API_Handler-->>Client: 200 OK (appliedTier: "ram_2_4gb")
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 19 minutes and 23 seconds. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/openhuman/local_ai/presets.rs (1)
197-203: Consider removing unused computation.The
ram_gbvalue is computed on line 199 but the recommendation logic no longer uses it (always returnsMVP_MAX_TIER). While it provides context in the debug log, you could simplify this if the RAM-based recommendation is not planned to return.♻️ Optional: Inline the log if RAM-based logic is permanently removed
pub fn recommend_tier(device: &DeviceProfile) -> ModelTier { - let ram_gb = device.total_ram_gb(); let tier = MVP_MAX_TIER; - tracing::debug!(ram_gb, ?tier, "[local_ai] recommended model tier"); + tracing::debug!(ram_gb = device.total_ram_gb(), ?tier, "[local_ai] recommended model tier"); tier }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openhuman/local_ai/presets.rs` around lines 197 - 203, The function recommend_tier computes ram_gb from DeviceProfile but never uses it and always returns MVP_MAX_TIER; either remove the unused ram_gb binding and its inclusion in the tracing::debug call or restore RAM-based logic—update the function recommend_tier to either drop ram_gb and simplify the debug message to not reference ram_gb, or implement the intended tier selection using ram_gb so the variable is used before returning MVP_MAX_TIER.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/openhuman/local_ai/presets.rs`:
- Around line 197-203: The function recommend_tier computes ram_gb from
DeviceProfile but never uses it and always returns MVP_MAX_TIER; either remove
the unused ram_gb binding and its inclusion in the tracing::debug call or
restore RAM-based logic—update the function recommend_tier to either drop ram_gb
and simplify the debug message to not reference ram_gb, or implement the
intended tier selection using ram_gb so the variable is used before returning
MVP_MAX_TIER.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 961fd556-69d9-473b-9762-acd11c229993
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
app/src/utils/__tests__/localAiBootstrap.test.tssrc/openhuman/config/schema/load.rssrc/openhuman/config/schema/local_ai.rssrc/openhuman/local_ai/model_ids.rssrc/openhuman/local_ai/presets.rssrc/openhuman/local_ai/schemas.rssrc/openhuman/local_ai/schemas_tests.rs
Summary
gemma3:1b-it-qat, with vision disabled and lightweight embeddings.Problem
Solution
local_ai_presets, and reject non-allowed larger tiers inlocal_ai_apply_presetand env-tier overrides.ram_2_4gb/ 1B-only behavior.Submission Checklist
app/) andcargo test(core) for the changed local AI preset/bootstrap paths(Any feature related checklist can go in here)
Impact
OPENHUMAN_LOCAL_AI_TIER.Related
Summary by CodeRabbit
Configuration Updates
Behavior Changes
Tests