# How do I set up kohya_ss or LLaMA-Factory on RunPod or Vast without dependency conflicts every time?

> Get the training run working once, then pack it: a nest keeps the training tool, the exact package versions that resolved on that machine, the base model and how the run was started. On the next machine a restore reinstalls exactly those versions and runs the training once, and the run only counts when the adapter file it was packed to produce appears. Your training images don't travel; you put them back.

Canonical page: https://renest.ai/answers/finetune-env-new-machine

<h2 id="conflicts">Why does a fresh install on RunPod give me conflicted versions every time?</h2>

<p>Because <code>pip install -r requirements.txt</code> re-decides the versions each time
you run it, against whatever the package index holds that day. Users of both tools ask for
the same thing — <em>"python requirements.txt doesn't install all the right versions …
please lock them down"</em> — and the honest fix is to keep the list that worked, not the
file that produced it. <a href="/docs/reresolving-deps-is-a-different-env">A fresh
resolve is a different environment</a> explains why.</p>

<p>Renest does that for a run that already finished: it records the versions that were
actually installed when the training worked, and on the next machine installs exactly that
list with uv, with no new resolution step.</p>

<h2 id="pack">How do I save a kohya_ss or LLaMA-Factory setup that works?</h2>

<p>Pack it right after a training run that finished. You describe that run in a small JSON
file — the working directory, the command line and the environment
(<code>&#123;"cwd": …, "argv": [...], "env": &#123;…&#125;&#125;</code>) — and Renest reads
the recipe out of it: for kohya_ss the command line itself, for LLaMA-Factory the config file
the command names.</p>

<pre>$ renest pack --dir ./run --framework kohya --run-record run.json --out ./nests --dest hosted
$ renest pack --dir ./run --framework llamafactory --run-record run.json --out ./nests --dest hosted</pre>

<p>What goes in: the training tool's folder, the config files the run read, the base model
it trained from, and the dependency lock. What stays out: the checkpoints and adapters the
run produced, and your dataset. They aren't dropped silently — each is recorded in the nest
as a spot that pointed at your own files. <code>--dest hosted</code> uploads the nest to your
drive as it packs, so it isn't left only on a machine you are about to destroy.
<a href="/docs/capture#training">Capture a run</a> has the details.</p>

<p>When the dependency list can't be installed elsewhere as recorded — a package installed from a folder the pack can't carry (a folder outside the environment is carried when it is under 100 MiB), packages from conda's base environment — the pack still
finishes, names those packages and the fix, and marks the nest as not restorable on another
machine. See <a href="/answers/pip-freeze-is-not-a-backup">why pip freeze isn't a
backup</a>.</p>

<h2 id="watch">Do I need renest watch?</h2>

<p>Run the training once under <code>renest watch</code> before packing. A trainer exits when
it's done, so by packing time there's no process left to ask which system libraries it
loaded. <code>watch</code> records that while the run happens, inside the folder you will
pack, and changes nothing about the run — same arguments, same output, same exit code:</p>

<pre>$ renest watch -- accelerate launch train_network.py --config config.toml</pre>

<p>Without it, packing falls back to what the installed packages declare, which is wider
than what the run used and can only ever warn.</p>

<h2 id="restore">How do I get it running on another RunPod or vast.ai machine?</h2>

<p>In the web console, open the nest and choose <strong>Restore</strong>; the page gives you
a command with a restore code. On the new machine:</p>

<pre>$ uv tool install renest
$ cd /workspace 2&gt;/dev/null || cd ~
$ renest restore --grant grant.json --dir ./run</pre>

<p>Before any file moves, the restore checks the machine against the one the nest was packed
on: a GPU generation the recorded build has no code for, a driver too old for its CUDA build,
or a CPU without avx2 stops it there. A missing git, C compiler, git-lfs or system library is offered for install first (it asks; <code>--yes</code> skips the question), or named with the command if it can't install it. It also asks whether the recorded package list can be
installed here, before the large downloads.</p>

<p>Then every file is checked against its recorded checksum, the packages are reinstalled
from the lock, and the training command runs once. Its output goes to
<code>.renest/evidence/&lt;run&gt;/entrypoint.log</code> inside the folder you restored to;
when the run fails, that log is the real diagnosis and the restore points you to it. A run
that dies on a missing system library such as <code>libGL.so.1</code> is reported as that,
with the install command, not as a broken environment. More in
<a href="/docs/restore">Restore a nest</a>.</p>

<h2 id="data">Where did my training data go?</h2>

<p>Your dataset is never packed into a nest, and a restore says so as soon as the files have
landed: it lists each spot in the recipe that pointed at your own files — the training data
it read, where results went — so you know what to put back. If the run then fails because
the data isn't there (kohya prints a "no data found" kind of message), the restore says
exactly that: put the data back where the recipe expects it and run the same restore command
again. Files already checked are kept.</p>

<h2 id="done">When does a restored training setup count as working?</h2>

<p>When the run produces the adapter it was packed to produce. An exit code alone isn't
trusted: kohya can print an error and exit 0 when it finds no data, so when a nest names the
expected adapter file, the restore requires that file to appear and fails if it doesn't.</p>

<p>Our own fine-tuning restores, failures included, are on the <a href="/proof">Proof page</a>.</p>

<h2 id="not">When Renest isn't the answer</h2>

<ul>
  <li><strong>You have never had the training run working.</strong> Renest only carries a run
  that already finished. It doesn't fix the first install, resolve dependency conflicts or
  recommend a template; the tool's own install guide or a community image is the place to
  start.</li>
  <li><strong>You train with something other than kohya_ss or LLaMA-Factory</strong> — for
  example diffusion-pipe, musubi, ai-toolkit or Axolotl. Those aren't supported.</li>
  <li><strong>Your new card is a GPU generation the recorded PyTorch build doesn't
  support.</strong> Renest refuses that pairing before downloading; it doesn't swap your
  PyTorch version. Get the run working on that generation once and pack again.</li>
</ul>

<p>Related: <a href="/answers/keep-setup-between-sessions">Keep a setup between cloud
sessions</a> · <a href="/answers/what-to-back-up">What a backup has to include</a> ·
<a href="/docs/base-image">The official base image</a></p>
