RFC: per-model and user settings — shipped defaults in model_list.json, a user file we never overwrite
This is a request for comment before anyone builds it. The most useful replies are concrete: a case where the layering gives the wrong answer, a setting that doesn't fit the scheme, or a migration that would lose someone's data.
The problem
Every speed or memory trade-off we add becomes another switch:
- #181 adds
--prefill-mode leanandOFLM_OPEN_PREFILL_MODE. - K2-Horizon-7B-Uno (#184) is about to add an exact/fast decode mode and a block size.
oflm run|servealready has--ctx-lenand--pmode.- The code in
src/reads 59 differentOFLM_*environment variables. Most are debug knobs, but nothing marks which ones users are meant to set.
To keep a choice for one model, a user has to retype the flag on every run, or export a variable that then applies to every model. LM Studio and Ollama remember preferences per model. We should too, and before more switches land.
Proposal: two files, split by who owns them
model_list.jsonbelongs to us. Every release overwrites it.- Its entries already carry per-model defaults:
default_context_length,max_prefill_lenanddetails.think. - New per-model defaults go in those same entries. App-wide defaults go in a new top-level
defaultsblock. - Adding a model is still a one-entry change.
- Its entries already carry per-model defaults:
~/.config/oflm/settings.jsonbelongs to the user. Nothing we ship or install ever writes to it.- It is a sparse overlay. When the registry loads, it is deep-merged onto
model_list.jsonby tag. - It holds the models the user installed with
oflm add(as complete entries). - It holds their per-model preferences (only the fields they changed).
- It holds their app-wide preferences.
- It is a sparse overlay. When the registry loads, it is deep-merged onto
{
"defaults": { "pmode": "balanced" },
"models": {
"qwen3.6-moe": { "35b-a3b": { "default_context_length": 8192, "prefill_mode": "lean" } },
"my-finetune": { "3b": { /* complete entry, written by oflm add */ } }
}
}
In this example, prefill_mode is #181's switch as it would look here. It is not a registry key today.
When the same setting is set in more than one place, the later source in this list wins:
- shipped defaults
- the user's file
- command-line flags
- per-request API fields
Commands:
oflm config set [--model <tag>] <key> <value>andoflm config unset ...edit the user's file.oflm config show [<tag>]prints every effective value and where it came from: shipped, user, or flag.
Debug knobs stay as environment variables and don't go in this file.
oflm add already breaks the two-file rule
This isn't only about future settings. Today the registry is a single file, and find_model_list picks one candidate and reads only that.
- The first
oflm addsnapshots the registry. It copies the whole shipped registry into~/.config/oflm/model_list.jsonand adds its model there (register). The user file is a copy of the registry as it was on the day of that first add. - Where the user file is read, it replaces the shipped one entirely. This happens on an install that keeps the registry under
share/oflmand doesn't setOFLM_CONFIG_PATH.- From then on, the user gets no new models and no entry fixes from releases.
- One dev machine has such a copy, dated 2026-09-13. It lists 37 of
main's 46 models, and every one of those 37 entries differs frommain's.
- Where the user file isn't read, the added model can't be found.
- Windows installers: they put
model_list.jsonnext tooflm.exe(oflm.iss:98).find_model_listchecks the executable's directory before the user directory (utils.cpp:76-95), so the user file is never read. home_install.sh: its env script exportsOFLM_CONFIG_PATHpointing at the shipped file (home_install.sh:81).oflm addhonours that variable and writes its model into the shipped file (oflm_add/init.py:186-192), and the next install overwrites it.- In both layouts,
oflm addends by printing "no OFLM_CONFIG_PATH/OFLM_XCLBIN_PATH exports needed."
- Windows installers: they put
I found all of this by reading the code on main. I haven't reproduced it on an installed build.
With the overlay, every layout behaves the same way: the shipped registry is always read, and the user file is always merged on top of it.
Migration: on the first load after the upgrade, an old full-copy ~/.config/oflm/model_list.json is reduced to the tags the shipped registry doesn't have, which are the user's own adds. Those move into settings.json. The old file is kept as model_list.json.bak, and the log lists what was carried over.
Open questions
- Which keys can a user override on a shipped model?
- One option is everything, which would let a user repoint
urlorfiles. - The other is a declared list of settings with types, where an unknown key gets a warning.
- I lean towards the declared list. It lets
oflm config setvalidate input, and it givesconfig showa defined set of values to print.
- One option is everything, which would let a user repoint
- Hand edits in old copies. Migration can't tell a hand-edited shipped entry from a stale one. I propose dropping it, because stale is far more likely, and keeping the
.bak. Does anyone edit their copy by hand? - What should
OFLM_CONFIG_PATHdo?- It could stay a whole-registry override with no overlay, for development and tests.
- Or it could replace only the shipped file, with the user overlay still applied on top.
- One user file or two?
- Added models and preferences could live in separate files (
models.jsonandsettings.json). - One file means a single merge rule.
- Two files mean
oflm addnever rewrites a file that a person edits by hand.
- Added models and preferences could live in separate files (
- What can an API request change? Which settings may a single request override (for example, opting out of a fast decode mode), and which need a model reload?
Not proposed
- A GUI.
- Per-project config files.
- Syncing settings between machines.
- I lean toward everything, for concern of needing to constantly maintain that validation. I tend to be against lists and hard-coding.
- I even more strongly lean against hand editing production code, but I am completely for the user's ability to do so.
OFLM_CONFIG_PATH- I think it should be an overlay, except for the shipped list. The original intent of olfm-add was without realizing people would ever use it to install a model already on the list. To be fair I made it without considering anyone would ever look at it. BUT, it should actually be enforced that there are no collisions. A model should be able to update from its installed name, but you should not be able to install one over another. That means we're going to need to record the URL as well. I do not think hashes are a very good idea when avoidable. It's validated, but brittle. Rather, I don't think those hashes should be hard-coded. At least not in models we don't control. So if someone installs a differently sourced qwen3.8:27b, it should not be able to occupy the same name as the shipped list.- A single request should definitely be able to set reasoning on/off and effort level, I would like to see an ability to resize the context window in the middle of a conversation but that seems improbable
- I think a TUI should come before a GUI if we go that direction; meaning like pi or opencode. We can probably adapt webui or something like what llama.cpp does for a GUI.
-- on oflm-add; I've been using the /opt/openflowlm/model_list.json and that explains a lot. I've never set that env as a permanent thing and I didn't even realize the app itself tells you to. If you don't, it'll write to the user's home model_list.json But openflowlm itself reads from both files.
-
Which keys can a user override on a shipped model? I think letting the user override everything is fine, but there can still be helpers when a new config lands (validation, or a config-edit TUI with dropdowns for example)
-
Hand edits in old copies. We're talking about configs? the user config can be hand edited, right? so if we're talking about the config from the oflm install path, then yes, override with a .bak and a warning message seems simple enough. maybe long term, if a key or value is renamed, than that could be upgraded automatically.
-
I think it should act as an override for the user's configuration. If it's for dev purpose, then just copying the full file from upstream with all the defaults, and editing that should be fine.
-
so, models.json is just the definition of the models, and setttings.json the model's config? I like the config files in
conf.dpatterns, maybe whatever is in models.json can then load models/.json ? for oflm add, it could be that the add --forcerewrites it? -
ooh ... well if everything can be changed on the fly, it'd be great :) then it could for example make use of lossy configs for tasks that don't require precision but do it fast ... otherwise, changing thinking is a must, temperature would be great too (is there a standard set of parameters that would make the api compatible with the most harnesses?). What about the 'thinking budget' or the 'max generated tokens' is that something that in general can be changed (for example for agents)?
in a nutshell, it's this -- we expand model_list.json to also carry default settings that we think make sense.
model_list.json belongs to us. Every release overwrites it.
the users' settings are overlaid on top of this in their own settings.json -- edited through a Ui maybe-someday, but hand-editable now:
~/.config/oflm/settings.json belongs to the user. Nothing we ship or install ever writes to it.
i think the main risk is that we ship a new default that has a setting that doesn't play well with the other model settings a user has. But I don't see a better way to do that, that is also simple.
The request is that -- is there a better way, is this an acceptable risk, and is it appropriate to expand the use of model_list.json to include default setting?
If there is a conflict with a user setting it can warn and offer to update the users config?
If there is a conflict with a user setting it can warn and offer to update the users config?
@abondis @Cyronius this is the way. Two things actually work here. First, versioning. When there's a change that breaks something in that way we can use n.x.n, when nothing breaks we use n.n.x, and whole feature sets on x.n.n. So a configuration break would get n.x.n and a warning if needed. We can use some fancy parsing there.
So the idea would be to drop the new list right into its usual area for the system wide list (/opt/openflowlm for me), and let it be overridden by the user's model list. I would expect the system list to be untouched by a user, it's not even user owned. So we really only have to worry about What outranks what.
The curated list we ship just needs a representative collection of models and the special cases like embedding. When a user oflm-add's a model it goes to the user's own list. The risk is in if the same entry exists in both places. That just shouldn't happen at all though. I could see someone pulling the same model twice, one in the intended way via oflm pull and a second of the same model via oflm add is possible but it shouldn't take the same name if you do that.
Let's use sane semantic versioning and a verbose updater, that should cover all cases.
Caveat being that If someone has their system set to ONLY look at the user list, we have no way to update that for them.