Feat/gemma3 model intelligence #487
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context :
This is a follow-up enhancement to my previous PR (the core MCP Bridge). It adds a layer of system intelligence to ensure users run the version of Gemma 3 best suited for their specific hardware.
Description :
This PR introduces a Hardware Intelligence Layer to the Gemma 3 MCP Gateway. While Gemma 3 offers a wide range of model sizes (1B to 27B), users often face "out of memory" errors or poor performance by selecting a model that exceeds their local hardware capabilities.
This update allows the gateway to "think" about the system it is running on, automatically recommending and defaulting to the optimal Gemma 3 variant based on detected system RAM.
Key Changes
system_utils.py: Added a diagnostic utility using psutil to detect system RAM and map it to recommended Gemma 3 variants (1B, 4B, 12B, or 27B).
config.py: Centralized model mapping and introduced support for the GEMMA_MODEL_SIZE environment variable for flexible deployment.
server.py: Integrated a "Startup Intelligence Report" that logs detected hardware and the selected model choice to the console on boot.