Support reading default model from environment variable
Hi, thanks for building SkillNet.
I ran into a small usability issue with the CLI: currently the model can only be set via --model, but it does not seem to support reading a default model from an environment variable.
Current behavior
Commands like:
skillnet evaluate <target>
skillnet create ...
skillnet analyze ...
default to gpt-4o unless I explicitly pass:
--model <model-name>
From the current implementation, API_KEY, BASE_URL, and GITHUB_TOKEN can be read from environment variables, but model cannot.
Expected behavior
It would be very helpful if SkillNet could also read the default model from an environment variable, for example:
MODEL=gpt-5.4-high
or a SkillNet-specific variable such as:
SKILLNET_MODEL=gpt-5.4-high
Then users could keep all configuration in .env / shell environment and avoid repeating --model on every command.
Why this would help
In many workflows, users already load these variables from a local .env into the shell:
- API_KEY
- BASE_URL
- GITHUB_TOKEN
But model still has to be manually appended every time. This becomes inconvenient, especially when a deployment/provider does not support the CLI default model (gpt-4o) but does support another model.
In my case, evaluation failed with the default model, and only worked after explicitly passing a supported model via --model.
Suggested behavior
A possible precedence rule could be:
1. explicit CLI argument --model
2. environment variable SKILLNET_MODEL (or MODEL)
3. fallback default like gpt-4o
Possible implementation
For example, in the CLI layer, instead of hardcoding:
model: str = typer.Option("gpt-4o", "--model", "-m", help="LLM model to use.")
it could use something like:
DEFAULT_MODEL = os.getenv("SKILLNET_MODEL") or os.getenv("MODEL") or "gpt-4o"
model: str = typer.Option(DEFAULT_MODEL, "--model", "-m", help="LLM model to use.")
This would preserve backward compatibility while making configuration much easier.
Additional note
If you prefer not to use a generic env var like MODEL, I think SKILLNET_MODEL would be clearer and safer.
Thanks!
```md
Title: Support default model from environment variable
Hi, thanks for the project.
Currently `skillnet` supports reading `API_KEY`, `BASE_URL`, and `GITHUB_TOKEN` from environment variables, but `model` still has to be passed explicitly via `--model`.
This is inconvenient in setups where users load config from `.env` into shell environment. It would be great if commands like `create`, `evaluate`, and `analyze` could also read a default model from an env var such as:
- `SKILLNET_MODEL`
- or `MODEL`
Suggested precedence:
1. `--model`
2. `SKILLNET_MODEL` / `MODEL`
3. default `gpt-4o`
This would keep backward compatibility and make SkillNet easier to use in scripted/project-based workflows.
Thanks!
Thanks for reporting the problem, we will process it soon!
Hi, thanks for the suggestion! 👋 This has been implemented. The CLI now supports a SKILLNET_MODEL environment variable to configure the default model globally. Priority chain: --model CLI flag > SKILLNET_MODEL env var > gpt-4o (built-in default) Usage:
# Set default model via environment variable
export SKILLNET_MODEL="gpt-4.1-mini"
# All commands will now use gpt-4.1-mini by default
skillnet create --prompt "..."
skillnet evaluate ./my_skill
skillnet analyze ./skills_dir
# CLI flag still takes highest priority
skillnet create --prompt "..." --model gpt-4o
Affected commands: create, evaluate, analyze. Feel free to reopen if anything doesn't work as expected!
Thank you so much, we'll have a try on new version
hi, do you have any further questions?
hi, do you have any further questions?
Thank you for your reply. I got the desired result among the other respondents. Thank you for your contributions to the project!
Thank you so much, we'll have a try on new version
Thank you.
Hi, thanks for the suggestion! 👋 This has been implemented. The CLI now supports a SKILLNET_MODEL environment variable to configure the default model globally. Priority chain: --model CLI flag > SKILLNET_MODEL env var > gpt-4o (built-in default) Usage:
# Set default model via environment variable export SKILLNET_MODEL="gpt-4.1-mini" # All commands will now use gpt-4.1-mini by default skillnet create --prompt "..." skillnet evaluate ./my_skill skillnet analyze ./skills_dir # CLI flag still takes highest priority skillnet create --prompt "..." --model gpt-4oAffected commands: create, evaluate, analyze. Feel free to reopen if anything doesn't work as expected!
Thank you.
Thanks for reporting the problem, we will process it soon!
Thank you.