The Lemonade API spec allows for models to be load``ed with highly customized CLI options, which we call *_args (e.g., `llamacpp_args`). I will refer to these as "args" for short. We also support saving args, as well as server-provided default args.
In trying to implement GUI3, I have discovered that it is very difficult for a Lemonade client to navigate the semantics of loading and saving with args. Here are the problems in lemond on main as of this writing:
Architectural Defaults
There is a JSON file that defines 6 per-model-architecture default sampling parameters (temp, top-k, etc.). These are automatically applied to models, and there is no way to disable this.
Users can override these args, for example by passing their own --temp. However, omitting one such value semantically means "I want the architectural default". So there is no way to override one arg and pass no value for the others.
Saved Value Merge on Load
Lemonade allows for args to be saved, for example --no-mmap --threads 8. These saved args are merged with args passed in the load body (ie, the load body does not wholesale replace the saved args).
So if I saved --no-mmap --threads 8 and then pass --threads 4 in the load body, the result is --no-mmap threads 4. There is no way for me to pass my --threads 4 and tell Lemonade to omit the --no-mmap except by clearing the entire saved entry for that model.
Saved Value Merge on Save
Saving new args does not wholesale replace previously saved args. For example, if I saved --no-mmap and then save --threads 8, now my saved args are --no-mmap --threads 8.
Hidden and Conditional Defaults
The WrapedServer C++ for Lemonade also automatically applies a variety of args at runtime, some of which are static (like -ngl 99) and some of which are dynamic (like --no-mmap on APUs only). These arguments are not disclosed by the API, not even the /models/{id}/options endpoint, except that there are some cases where lemond will raise an HTTP error if the load body contradicts one of these args.
Conclusion
It is a bug that clients are unable to exercise control, or gain visibility, over the args they are loading. We should propose a comprehensive solution to allow full control and visibility.
The Lemonade API spec allows for models to be load``ed with highly customized CLI options, which we call
*_args(e.g., `llamacpp_args`). I will refer to these as "args" for short. We also support saving args, as well as server-provided default args.In trying to implement GUI3, I have discovered that it is very difficult for a Lemonade client to navigate the semantics of loading and saving with args. Here are the problems in lemond on
mainas of this writing:Architectural Defaults
There is a JSON file that defines 6 per-model-architecture default sampling parameters (temp, top-k, etc.). These are automatically applied to models, and there is no way to disable this.
Users can override these args, for example by passing their own
--temp. However, omitting one such value semantically means "I want the architectural default". So there is no way to override one arg and pass no value for the others.Saved Value Merge on Load
Lemonade allows for args to be saved, for example
--no-mmap --threads 8. These saved args are merged with args passed in the load body (ie, the load body does not wholesale replace the saved args).So if I saved
--no-mmap --threads 8and then pass--threads 4in the load body, the result is--no-mmap threads 4. There is no way for me to pass my--threads 4and tell Lemonade to omit the--no-mmapexcept by clearing the entire saved entry for that model.Saved Value Merge on Save
Saving new args does not wholesale replace previously saved args. For example, if I saved
--no-mmapand then save--threads 8, now my saved args are--no-mmap --threads 8.Hidden and Conditional Defaults
The WrapedServer C++ for Lemonade also automatically applies a variety of args at runtime, some of which are static (like
-ngl 99) and some of which are dynamic (like--no-mmapon APUs only). These arguments are not disclosed by the API, not even the/models/{id}/optionsendpoint, except that there are some cases where lemond will raise an HTTP error if the load body contradicts one of these args.Conclusion
It is a bug that clients are unable to exercise control, or gain visibility, over the args they are loading. We should propose a comprehensive solution to allow full control and visibility.