Improved speak overall #1
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixed the config system
. Removed user overrides completely. Now config.json only has detected and active sections. No merging. No confusion.
Fixed model.cr to write detected hardware first. Then it picks the right model from models.json based on available RAM. Then writes the selected model to active section. Works in one smooth flow.
Simplified config.cr. It only loads what is in the file. No auto-detection. No creation. No saving. Pure read-only loader.
Fixed speak.cr to check for config file first. If missing, runs setup. If exists, loads config and starts chat. Handles both first run and normal runs.
Added command line options. --setup forces setup. --auto-setup runs without user input. --coding optimizes model recommendations for coding tasks.
Fixed model.cr to embed models.json at compile time using read_file macro. No network request. No file I/O at runtime. Binary is self-contained.
Fixed context size calculation. Uses available RAM minus model weight divided by KV cache per token. Clamps between 512 and model's max context.
Fixed temperature type. Now Float64 everywhere. No mismatch between config.cr and model.cr.
Fixed free_disk_space_mb. Uses System.free_disk_space_mb("/") which returns UInt64. Matches config.cr ActiveSettings property type.
Fixed model_file path. Uses settings.model_file from config.active. Installer downloads to ./speak/models/filename.
Removed user_overrides struct entirely. No longer needed. Simpler code. Less bugs.
Removed apply_overrides method. No merging required. Config.active is the source of truth.
Removed save method from config.cr. Only model.cr writes to config.json. Separation of concerns.
The flow now is clean. First run: detect hardware -> write detected -> show model list -> user picks -> write active. Subsequent runs: load config -> read active -> load model -> start chat.
No more config.json corruption. No more override confusion. No more duplicate code.