Flexible configuration system for RKLLAMA #19
Merged
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.
This pull request introduces a new flexible configuration system for RKLLAMA, which includes changes to multiple files to support this new system. The changes involve updating the configuration handling, modifying how scripts and the client handle configuration, and adding new configuration schema and documentation.
#18
Configuration System Enhancements:
README.md
: Added a new section on configuration, explaining how RKLLAMA uses a flexible configuration system that loads settings from multiple sources in a priority order.documentation/configuration.md
: Added comprehensive documentation for the new configuration system, detailing configuration sources, file locations, format, environment variables, command-line arguments, and usage of the configuration API.Codebase Updates:
client.py
: Refactored to use the new configuration system, removing direct file handling and replacing it with calls to theconfig
module. This includes changes to how the server port and script paths are determined. [1] [2] [3] [4]client.sh
: Updated to determine the application root dynamically, source configuration from a new environment file, and handle arguments more cleanly. This includes changes to how the port is specified and how the Python script is executed. [1] [2] [3]New Files:
config/default.ini
: Added a default configuration file that will be automatically generated at startup if it does not exist. It includes default settings for server, paths, model, and platform sections.config_schema.py
: Introduced a new module defining the configuration schema, including field types, validation logic, and schema creation for RKLLAMA.Script Enhancements:
lib/fix_freq_rk3576.sh
: Added debug mode support, allowing conditional logging based on the debug mode argument.