Train a decision model with one prompt
This page gives you one prompt to paste into a coding agent such as Claude Code or Codex. The agent then runs the financial decision tutorial for you. It prepares the data, trains a LoRA adapter on Qwen/Qwen3.5-4B, deploys it, scores it against the base model and releases the GPUs.
Training and the inference endpoint allocate paid GPU resources. The prompt sets a spend cap and tells the agent to stop and ask before it spends more.
Before you start
- Sign in once yourself with
el auth login; see Install and connect the CLI. The agent reuses the saved login and never needs to see your API Key. - Use the Key from
el auth login. A Key created in the Console also needs Edit on MANAGE → Resource cleanup and Read on MANAGE → Usage; without them the agent cannot read cleanup Operations or usage (Create a key). - Optional: install the EnvLoop Skill for your agent. The prompt also works without it, because it links the pages the agent needs.
- Make sure your workspace has enough balance for the cap you choose.
The prompt
Replace BUDGET_USD with your spend cap for one Train Job, then paste the whole block into the agent.
Train a small decision model on EnvLoop and show that it beats its base model.
Read these pages first:
- https://docs.envloop.ai/skill.md
- https://docs.envloop.ai/agent-docs/en/training/tutorials/finance-decision-model.md
Setup
1. Work in a new directory. Keep every request, receipt and result file in it.
2. Create a virtual environment and install "envloop-cli[data]", huggingface_hub,
pyarrow and openai. Run `el --version`.
3. Run `el auth status --check`. If it fails, stop and ask me to run `el auth login`.
Never print, log or save API keys.
4. Download prepare_data.py and evaluate.py from the tutorial.
Task
- Base model Qwen/Qwen3.5-4B, recipe sft, LoRA, thinking off.
- Data: the Hugging Face dataset EnvLoop/financial-decision-bench.
Train on the train split. Evaluate on the validation split.
- Each row has a fixed system line, a user turn holding a JSON object,
and an assistant turn holding only the chosen option ID.
Run
1. Prepare round 1 data. Check that no validation row is in the training file.
Record row counts and SHA-256 of each file.
2. Submit the Train Job with --max-cost-usd BUDGET_USD.
Follow it with `el job metrics JOB_ID --follow`.
Report step, loss and cost about every 30 minutes.
3. When it succeeds, download the Checkpoint and verify its SHA-256.
4. Register the Checkpoint as an adapter for the matching serving profile.
Submit an Inference Job with that adapter and wait until it serves.
5. Score the base model and the adapter on the same validation rows,
with temperature 0 and max_tokens 16. Report overall accuracy and
accuracy per ability.
6. If the adapter does not beat the base, stop and show me the weakest
abilities before you spend more.
7. Otherwise run round 2 as the tutorial describes: pass the two weakest
abilities of round 1 to prepare_data.py with --focus, train again from
the round 1 Checkpoint and score again.
Clean up
1. Stop the Inference Job as soon as scoring ends. Wait until `el job get`
shows inference.service_status DELETED and inference.cleanup_confirmed true.
If the Key can read Operations, also wait for its cleanup Operation.
2. Delete adapters I do not need.
3. Check that every Train Job shows training.cleanup_confirmed true.
4. End with one table: Job IDs, Checkpoint IDs, cost, base accuracy and
fine-tuned accuracy for each round.
Rules
- Ask me before raising a cap or starting any run not listed above.
- When a command fails, look up its error code in the docs before you retry.
- Reuse a request_id only to retry the same request.
What to expect
The agent works through the steps of the financial decision tutorial, and its results table should look like the one there. Round 2 gains per ability vary between runs. A round of training takes a few hours of wall-clock time, most of it waiting for GPU steps. You can close the chat while a Job runs and ask the agent to resume from its run directory. All the IDs it needs are in the saved receipts.
Check the agent's work in the Console. Experiment → Jobs shows each Job's state, metrics and cost. MANAGE → Usage shows what the run spent.
Use your own decisions
To train on your own decision records, replace the Task block with:
Task
- Base model Qwen/Qwen3.5-4B, recipe sft, LoRA, thinking off.
- Data: my file decisions.jsonl. Each line is {"messages": [...]} with a fixed
system line, a user turn describing the situation and the options, and an
assistant turn holding only the chosen option ID.
- Before training, hold out 10% of the lines, stratified by option, as the
validation set. Never train on them.
- If the file is larger than one request allows, publish it as a Dataset first,
as the tutorial's "train from a Dataset" section shows.
Personal decisions work the same way. Write each record as the situation, the options you had and the option you chose. Keep personal data in a private project.
Next: Train from a Dataset, Deploy and call a trained model, Monitor training.