Repository navigation
Feat: add unsloth skill, fix cli - #4443
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2b923de15
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| existing = env.get("PYTHONPATH", "") | ||
| env["PYTHONPATH"] = f"{backend_dir}{os.pathsep}{existing}" if existing else backend_dir | ||
|
|
||
| args = [str(studio_python), "-m", "cli", *command_args] |
There was a problem hiding this comment.
Re-exec the checkout's CLI instead of the Studio wheel
When an existing ~/.unsloth/studio/.venv is present, this launches python -m cli, but studio/install_python_stack.py:299-305 installs unsloth from studio/backend/requirements/base.txt:1-3 into that venv. Because the re-exec only adds studio/backend to PYTHONPATH, the child process imports the packaged cli module from the venv rather than the current checkout, so users keep running stale command handlers (or an older wheel that lacks cli.__main__) until they rerun unsloth studio setup after every CLI change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in the rebase — now uses -m unsloth_cli instead of -m cli.
| @@ -33,6 +35,8 @@ def train( | |||
| config_overrides: dict = None, | |||
| ): | |||
| """Launch training using the existing Unsloth training backend.""" | |||
| _reexec_cli_in_studio_venv(sys.argv[1:]) | |||
There was a problem hiding this comment.
Do not require Studio setup for
train --dry-run
This re-execs before the config is even loaded, but the dry_run branch at lines 59-65 only dumps the resolved YAML and exits; it never touches the Studio backend. On a fresh install or CI machine without ~/.unsloth/studio/.venv, unsloth train --dry-run now exits with "Studio not set up" instead of validating and printing the config, which regresses a lightweight workflow that worked before this change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch. Moved _reexec_cli_in_studio_venv after the dry-run exit in 2ab03d3, so unsloth train --dry-run now works without studio setup.
| with_response = (eval_dir / "with_skill" / "outputs" / "response.md").read_text() | ||
| without_response = (eval_dir / "without_skill" / "outputs" / "response.md").read_text() if without_result else "N/A" |
There was a problem hiding this comment.
Guard grading against missing eval outputs
run_claude() returns {"error": ...} on timeout/JSON-parse failures and, in those cases, never writes response.md, but run_grader() unconditionally reads both response files here. If either the with-skill or baseline run fails, the benchmark crashes with FileNotFoundError during grading instead of recording a failed run and continuing, so a single flaky eval aborts the whole comparison run.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2ab03d3 — run_grader now checks if response.md exists before reading. Failed/timed-out runs get (run failed — no output) instead of crashing.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2b923de15
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| existing = env.get("PYTHONPATH", "") | ||
| env["PYTHONPATH"] = f"{backend_dir}{os.pathsep}{existing}" if existing else backend_dir | ||
|
|
||
| args = [str(studio_python), "-m", "cli", *command_args] |
There was a problem hiding this comment.
Re-exec the checkout's CLI instead of the Studio wheel
When an existing ~/.unsloth/studio/.venv is present, this launches python -m cli, but studio/install_python_stack.py:299-305 installs unsloth from studio/backend/requirements/base.txt:1-3 into that venv. Because the re-exec only adds studio/backend to PYTHONPATH, the child process imports the packaged cli module from the venv rather than the current checkout, so users keep running stale command handlers (or an older wheel that lacks cli.__main__) until they rerun unsloth studio setup after every CLI change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Same fix — resolved in the rebase, now uses -m unsloth_cli.
| @@ -33,6 +35,8 @@ def train( | |||
| config_overrides: dict = None, | |||
| ): | |||
| """Launch training using the existing Unsloth training backend.""" | |||
| _reexec_cli_in_studio_venv(sys.argv[1:]) | |||
There was a problem hiding this comment.
Do not require Studio setup for
train --dry-run
This re-execs before the config is even loaded, but the dry_run branch at lines 59-65 only dumps the resolved YAML and exits; it never touches the Studio backend. On a fresh install or CI machine without ~/.unsloth/studio/.venv, unsloth train --dry-run now exits with "Studio not set up" instead of validating and printing the config, which regresses a lightweight workflow that worked before this change.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2ab03d3 — _reexec_cli_in_studio_venv now runs after the dry-run check.
| with_response = (eval_dir / "with_skill" / "outputs" / "response.md").read_text() | ||
| without_response = (eval_dir / "without_skill" / "outputs" / "response.md").read_text() if without_result else "N/A" |
There was a problem hiding this comment.
Guard grading against missing eval outputs
run_claude() returns {"error": ...} on timeout/JSON-parse failures and, in those cases, never writes response.md, but run_grader() unconditionally reads both response files here. If either the with-skill or baseline run fails, the benchmark crashes with FileNotFoundError during grading instead of recording a failed run and continuing, so a single flaky eval aborts the whole comparison run.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Same fix — grader now guards against missing response files.
b2b923d to
5df7fc5
Compare
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ded3b48af
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for config, res in [("with_skill", with_res), ("without_skill", without_res)]: | ||
| if not res or "error" in res: | ||
| continue |
There was a problem hiding this comment.
Record failed eval runs instead of dropping them
If either Claude invocation times out or returns invalid JSON, build_benchmark() skips that configuration entirely here. That makes benchmark.json and the printed deltas look healthier than reality—for example, a timed-out with_skill run disappears and the summary is computed only from the surviving baseline runs. Please emit a run entry with errors > 0 and a zero pass rate so failures count against the benchmark instead of being silently ignored.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in bf59c63 — failed/timed-out runs now emit a run entry with errors: 1 and zero pass rate instead of being skipped.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca1a77e60b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| env["PYTHONPATH"] = ( | ||
| f"{backend_dir}{os.pathsep}{existing}" if existing else backend_dir | ||
| ) | ||
|
|
||
| args = [str(studio_python), "-m", "unsloth_cli", *command_args] |
There was a problem hiding this comment.
Add the checkout root to PYTHONPATH before re-exec
Fresh evidence after the rebase: this still only prepends studio/backend before launching python -m unsloth_cli. studio/install_python_stack.py installs unsloth into ~/.unsloth/studio/.venv, so when a developer runs unsloth from any cwd outside the repo root, the child process will import the venv wheel's unsloth_cli instead of the checkout they are testing. That means CLI changes in this PR are silently ignored until Studio setup is rerun, so the original stale-code problem still exists for a common development workflow.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e2e2a31 — now adds both the checkout root and studio/backend to PYTHONPATH, so the re-exec'd process imports unsloth_cli from the local checkout instead of a stale venv wheel.
| result = subprocess.run( | ||
| cmd, capture_output = True, text = True, timeout = 120, cwd = str(REPO_ROOT) | ||
| ) |
There was a problem hiding this comment.
Catch grading timeouts and keep the benchmark running
run_grader() uses subprocess.run(..., timeout=120) without handling TimeoutExpired. If any grading call hangs or is just slower than two minutes, the exception escapes and the whole eval script aborts before benchmark.json is written, even though the per-run execution path already treats timeouts as recoverable. In practice this makes a single flaky grader response kill the entire benchmark iteration.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e2e2a31 — run_grader now catches TimeoutExpired and returns empty grading instead of crashing the script.
| expectations = g.get("expectations", []) | ||
| passed = 0 if is_error else sum(1 for e in expectations if e.get("passed")) | ||
| total = len(expectations) or (1 if is_error else 0) |
There was a problem hiding this comment.
Mark ungraded runs as unavailable instead of 0%
When grading is skipped (--skip-grading) or a grader parse failure leaves expectations empty, successful runs fall into this branch with is_error == False, so total becomes 0 and the emitted pass_rate is forced to 0 a few lines later. That makes benchmark.json and the printed summary report a failed eval even though nothing was graded, which corrupts the experiment results rather than signaling that the score is unavailable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in e2e2a31 — ungraded runs now emit pass_rate: null (filtered from stats) instead of a misleading 0%.
|
Thanks so much @TimPietrusky ! :) |
|
@danielhanchen while creating the skill and testing it, i found a couple of things that need to be changed in order for the skill to work. if this pr is too large to review, i can also split it, but those changes are needed to make the skill work. |
|
@TimPietrusky great work! can you elaborate on the changes? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8d2a944b9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if not vals: | ||
| return {"mean": 0, "min": 0, "max": 0} |
There was a problem hiding this comment.
Preserve missing-baseline stats instead of zero-filling
When this runner is invoked with its advertised --skip-baseline mode, without_runs is empty, but stats() still returns {mean: 0, min: 0, max: 0} and the delta block below compares the with-skill run against those zeros. That makes benchmark.json and the printed summary report fake improvements in pass rate, tokens, and time even though no baseline was executed, which corrupts the comparison for a supported workflow.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2034a86 — stats() returns None when no runs exist, delta is skipped entirely when baseline is missing. No more fake improvements from zero-filled stats.
| - unsloth CLI is installed at /opt/homebrew/bin/unsloth (version 2026.3.5) | ||
| - Studio venv exists at ~/.unsloth/studio/.venv (Python 3.11) | ||
| - Use pip3, not pip. | ||
| - `unsloth studio setup` is already done in this environment. Only run it if the task explicitly requires verifying setup behavior. |
There was a problem hiding this comment.
Stop telling the fresh-setup eval that Unsloth is installed
These environment hints are prepended to every eval prompt, including setup-fresh in skills/unsloth/evals/evals.json:22-37. That case is supposed to measure a clean-machine install, but the agent is explicitly told that unsloth is already installed, the Studio venv already exists, and setup is already done, so it can legitimately skip the very install/setup actions the grader expects. This makes the fresh-install benchmark unreliable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2034a86 — split ENV_CONTEXT into base context (all evals) and ENV_CONTEXT_INSTALLED (appended only for non-fresh evals). setup-fresh no longer gets told that unsloth is already installed.
2034a86 to
5777037
Compare
There was a problem hiding this comment.
💡 Codex Review
unsloth/unsloth_cli/commands/train.py
Line 74 in 224ae99
--local-dataset flag
This validation path still tells users to pass --local-dataset, but this commit's options.py change deliberately removed list-valued CLI flags, so Typer now rejects that option. In the new local-JSONL workflow, a user who follows this error message immediately hits No such option: --local-dataset instead of being directed to the YAML --config path that actually works.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| eval_id: str = "", | ||
| ) -> dict: | ||
| """Run a single eval via claude -p and return the JSON result.""" | ||
| output_dir.mkdir(parents = True, exist_ok = True) |
There was a problem hiding this comment.
Clear previous outputs before reusing an iteration directory
run_claude() now reuses output_dir as-is. If someone reruns the same --iteration and the current Claude call times out or returns invalid JSON, this function exits before overwriting response.md, so run_grader() later reads the stale file from the previous attempt and scores the failed run as if it had succeeded. That corrupts benchmark.json for retry/partial-rerun workflows.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9e8cb63 — run_claude() now clears the output directory before each run, so stale response.md files from previous attempts can't leak into grading.
| ENV_CONTEXT = """ | ||
| CONTEXT about the environment: | ||
| - Working directory: {repo_root} | ||
| - Mac M4, no NVIDIA GPU. Full Unsloth training does not work here, but dry-run flows do. GGUF inference does work on this machine. |
There was a problem hiding this comment.
Detect the eval machine instead of hard-coding Mac-only context
Every eval prompt now tells Claude it is on a "Mac M4, no NVIDIA GPU" box where full training cannot work and GGUF inference does. On any Linux/CUDA runner, CI host, or Windows machine, that steers both the skill and baseline agents away from capabilities that actually exist (or toward ones that do not), so tasks like train-and-export no longer measure the real environment and the benchmark results become misleading outside the author's laptop.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 9e8cb63 — ENV_CONTEXT now auto-detects platform (platform.system() + machine()) and GPU (checks nvidia-smi) instead of hardcoding Mac M4.
|
@rolandtannous the main goal was to add an agent skill ( while building and testing the skill on macOS (M4), i found and fixed several cli issues:
these fixes were needed to make the skill accurate. |
224ae99 to
9b07394
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec13e9acab
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| checkout_root = str(_PACKAGE_ROOT) | ||
| env = os.environ.copy() | ||
| existing = env.get("PYTHONPATH", "") | ||
| extra = f"{checkout_root}{os.pathsep}{backend_dir}" | ||
| env["PYTHONPATH"] = f"{extra}{os.pathsep}{existing}" if existing else extra |
There was a problem hiding this comment.
Stop prepending an installed site-packages root to PYTHONPATH
_PACKAGE_ROOT is only a checkout root for editable installs; in a normal pip install unsloth it resolves to the caller's site-packages directory. Prepending that whole directory here makes the studio child import outer-environment packages before its own, so a CLI installed under Python 3.9/3.10 (allowed by pyproject.toml) can re-exec into the 3.11-3.13 Studio venv (studio/setup.sh) and then pick up incompatible wheels or stale pure-Python deps from the outer env. This turns the stale-code fix into a cross-environment import bug for packaged installs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 53a4423 — checkout root is now only added to PYTHONPATH for editable installs (detected by checking for pyproject.toml in _PACKAGE_ROOT). For normal pip install unsloth, only studio/backend is added.
There was a problem hiding this comment.
Fixed in 53a4423 — _PACKAGE_ROOT is now only prepended to PYTHONPATH for editable installs (detected via .dist-info/direct_url.json). Normal pip installs no longer pollute the Studio venv's import path.
| "id": "setup-fresh", | ||
| "prompt": "Install Unsloth from scratch and set up the Studio environment. This is a clean machine with nothing installed.", | ||
| "expectations": [ | ||
| "Runs pip install unsloth (or pip install -e . if in repo)", |
There was a problem hiding this comment.
Accept the documented uv install flow in
setup-fresh
run_grader() scores this benchmark from the free-form expectations text, and this expectation only treats pip install unsloth / pip install -e . as correct. The repo's own install docs use uv pip install unsloth --torch-backend=auto on a clean machine, so an agent that follows the documented setup path can be graded as failing setup-fresh even though it did the right thing. That makes benchmark.json and the claimed accuracy for this eval unreliable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 53a4423 — setup-fresh expectation now accepts pip install, pip install -e ., and uv pip install unsloth.
There was a problem hiding this comment.
Fixed in 53a4423 — setup-fresh eval expectations now accept uv pip install unsloth alongside pip install unsloth.
53a4423 to
18b7d60
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25169bcf4a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "passed": passed, | ||
| "failed": total - passed, | ||
| "total": total, | ||
| "time_seconds": res.get("total_duration_seconds", 0), |
There was a problem hiding this comment.
Preserve timeout durations in benchmark results
When run_claude() times out it returns only duration_ms, but this summary path records time_seconds from total_duration_seconds and falls back to 0. In timeout/error scenarios, benchmarks therefore underreport runtime (showing zero seconds) and can produce misleading speed deltas. Use duration_ms as a fallback (converted to seconds) for error runs so timeout-heavy iterations are measured accurately.
Useful? React with 👍 / 👎.
| if grading_file.exists(): | ||
| grading = json.loads(grading_file.read_text()) |
There was a problem hiding this comment.
Ignore stale grading files when grading is skipped
This always loads any existing grading.json for an iteration, even when the current run used --skip-grading (or grading failed and produced no new file). If a user reuses --iteration, old grading data is silently applied to new outputs, so pass/fail metrics can reflect a previous run instead of the current one. Clear/overwrite grading artifacts per run or bypass loading stale grading when no fresh grading step ran.
Useful? React with 👍 / 👎.
25169bc to
79ca5a0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfebcb7153
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if eval_id != "setup-fresh": | ||
| ctx += "\n" + ENV_CONTEXT_INSTALLED |
There was a problem hiding this comment.
Exclude all fresh-install evals from installed-env context
Fresh evidence after the earlier setup-fresh fix: this commit adds setup-fresh-docker and setup-fresh-windows in skills/unsloth/evals/evals.json, but this guard still only exempts setup-fresh. As a result, those fresh-machine evals are told that unsloth and studio setup already exist, which conflicts with their prompts and can let runs skip installation while still being graded, skewing benchmark correctness.
Useful? React with 👍 / 👎.
| for eval_entry in evals: | ||
| eval_id = eval_entry["id"] |
There was a problem hiding this comment.
Skip Windows-only evals on non-Windows hosts
The runner executes every eval ID unconditionally in this loop, so setup-fresh-windows is attempted on Linux/macOS too. That eval’s note in skills/unsloth/evals/evals.json says it should be skipped outside Windows, so default runs on non-Windows machines include an impossible task and artificially lower pass-rate comparisons unrelated to skill behavior.
Useful? React with 👍 / 👎.
cfebcb7 to
aabdd5b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52d05818fe
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if system_prompt: | ||
| messages.append({"role": "system", "content": system_prompt}) |
There was a problem hiding this comment.
Avoid double-injecting system prompts in standard inference
When --system-prompt is set, this helper adds a system message into messages, and the non-GGUF path also passes system_prompt separately to generate_chat_response. In studio/backend/core/inference/inference.py, that backend prepends system_prompt to messages again, so standard inference receives the same system instruction twice. This can materially skew outputs for prompt-sensitive runs; keep system text in only one channel for the non-GGUF path.
Useful? React with 👍 / 👎.
|
@rolandtannous @danielhanchen Rebased cleanly on latest main — no more conflicts. Changes are now in 3 commits:
All of main's additions are preserved ( |
52d0581 to
3f2b718
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5acfc61a6e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| existing = ( | ||
| sorted(WORKSPACE_DIR.glob("iteration-*")) if WORKSPACE_DIR.exists() else [] | ||
| ) | ||
| iteration = len(existing) + 1 |
There was a problem hiding this comment.
Compute next iteration from max existing suffix
The auto-iteration logic uses len(existing) + 1, which can reuse an already existing directory when iteration folders are sparse (for example after deleting older runs or after using --iteration manually). Because iteration_dir.mkdir(..., exist_ok=True) allows reuse, a subsequent run can overwrite/mix artifacts in a prior iteration-* folder and corrupt benchmark history. Parse the numeric suffixes of existing iteration-* directories and pick max + 1 instead of counting entries.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b49be3424b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| backend_dir = str(_PACKAGE_ROOT / "studio" / "backend") | ||
| env = os.environ.copy() | ||
| existing = env.get("PYTHONPATH", "") | ||
| extra_paths = [backend_dir] |
There was a problem hiding this comment.
Remove outer backend path from re-exec PYTHONPATH
_reexec_cli_in_studio_venv prepends backend_dir built from the caller install (_PACKAGE_ROOT/studio/backend) before launching the Studio venv, so bare imports used throughout backend modules (for example from loggers import ...) resolve from the outer environment first instead of the Studio venv. When the outer unsloth package version differs from ~/.unsloth/studio/unsloth_studio, this mixes module versions in one process and can break train/inference/export after re-exec with hard-to-diagnose import/runtime errors.
Useful? React with 👍 / 👎.
cc704ab to
39f9467
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb470e2625
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for eval_entry in evals: | ||
| eval_id = eval_entry["id"] |
There was a problem hiding this comment.
Skip Docker-only eval when Docker is unavailable
This loop runs every eval ID unconditionally, including setup-fresh-docker, but that eval is explicitly documented as requiring a running Docker daemon. On machines without Docker installed/running, the benchmark now includes an impossible task and depresses pass-rate/token/time comparisons for reasons unrelated to the skill itself. Add an environment gate (or auto-skip) before scheduling Docker-only evals so results remain comparable across hosts.
Useful? React with 👍 / 👎.
77d5476 to
79bb57a
Compare
|
The CLI pieces here have since landed on main (_is_list_type in unsloth_cli/options.py, the GGUF llama-server routing, and the studio/backend path insertion), so could you rebase and narrow this to just skills/unsloth plus its evals? That would make it much quicker to get in. |
Squashed from 5 commit(s); reduced to an empty diff so the contribution is credited on merge.
b86bedc to
23bd40c
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks for the PR! Sorry on the delay as well - we superseded the PR, but we merged the PR for now - appreciate the contribution! |
summary
adds an agent skill (
skills/unsloth/SKILL.md) so that any ai coding agent can use the unsloth cli without trial-and-error exploration. covers training, inference, export, and studio commands with config templates and gotchas.eval results: 100% correctness with skill vs 93% without, 31% fewer tokens, 49% less time.
cli fixes found while testing the skill
list-checkpointsandexportcrashed withModuleNotFoundError: No module named 'loggers'— venv re-exec wasn't addingstudio/backend/to the python path--local-datasetcli flag was broken —Optional[List[str]]wasn't detected as a list type, leaked through as a string flagllama-servertest plan