Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
- name: Install locked dependencies
run: |
python -m pip install uv
uv sync --locked --extra train
uv sync --locked
- name: Offline unit tests and current run evidence
run: uv run --extra train python -m unittest -v
run: uv run python -m unittest -v
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Use Python 3.12+ and `uv sync --locked --extra train`. Run
Use Python 3.12+ and `uv sync --locked`. Run
`uv run python -m unittest -v` before submitting changes. Follow the
[dataset guide](docs/DATASET.md) for the separate data-build and validation steps.

Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

We fine-tuned **Qwen3.5-4B on Together AI** to make decisions: give it context,
a question, and 2–24 options, and it returns one answer letter. We're calling
it **tev1-4B-experimental**. A separate blog post will cover the project, how we
fine-tuned it, and what we learned.
it **tev1-4B-experimental**.

This repo contains the data recipe, training example, and saved results so you
can fine-tune your own decision model.

- [Learn how to train your own classifier for $17](https://www.together.ai/blog/how-to-train-your-own-jev)
- [Full model weights](https://huggingface.co/togethercomputer/Tev1-4B-experimental)

```text
State Returns are allowed within 30 days. This purchase was 12 days ago.
Question Is this return within the allowed window?
Expand Down Expand Up @@ -40,7 +42,7 @@ Requires Python 3.12+ and [uv](https://docs.astral.sh/uv/).
Run these commands from the repository root:

```bash
uv sync --locked --extra train
uv sync --locked
uv run python fetch_sources.py
uv run python build_all.py
```
Expand All @@ -54,9 +56,9 @@ for validation, provenance, and how to adapt the recipe.
Preview the training settings, then launch when ready:

```bash
uv run --extra train python examples/train_together.py
uv run python examples/train_together.py
export TOGETHER_API_KEY='your-key'
uv run --extra train python examples/train_together.py --launch
uv run python examples/train_together.py --launch
```

`--launch` uploads `data/new-v1/instruction/train.jsonl` and `dev.jsonl` and starts
Expand Down
22 changes: 11 additions & 11 deletions docs/TRAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ verified export of the historical job's settings.
| Early stopping / seed | Disabled / 42 |
| Train on inputs | False; completion-only loss |

Install the locked SDK with `uv sync --locked --extra train`. Preview with
`uv run --extra train python examples/train_together.py`; append `--launch` to
Install the locked SDK with `uv sync --locked`. Preview with
`uv run python examples/train_together.py`; append `--launch` to
upload and start a billed job. The script waits for both uploaded files to finish
processing before submission. It uses the Python SDK directly to set LoRA rank.
See Together's [fine-tuning API reference](https://docs.together.ai/reference/post-fine-tunes).
Expand Down Expand Up @@ -47,31 +47,31 @@ request before calling the endpoint. Inference and hosting have separate charges

## Follow the job and deploy from the CLI

If using a `.env` file, load it explicitly for each command. Use the locked
`train` extra so the Python example and `tg` use the same SDK:
If using a `.env` file, load it explicitly for each command. The Together SDK and `tg` CLI are installed by `uv sync --locked`, so the
Python example and CLI use the same version:

```bash
uv sync --locked --extra train
uv sync --locked
cp .env.example .env
# Edit .env to set TOGETHER_API_KEY, then preview or launch:
uv run --extra train --env-file .env python examples/train_together.py
uv run --extra train --env-file .env python examples/train_together.py --launch
uv run --env-file .env python examples/train_together.py
uv run --env-file .env python examples/train_together.py --launch
```

Replace `YOUR_JOB_ID` below with the ID printed by that launch. Use the same ID
for status and output-model lookup:

```bash
uv run --extra train --env-file .env tg fine-tuning retrieve YOUR_JOB_ID
uv run --extra train --env-file .env tg fine-tuning retrieve YOUR_JOB_ID --json
uv run --env-file .env tg fine-tuning retrieve YOUR_JOB_ID
uv run --env-file .env tg fine-tuning retrieve YOUR_JOB_ID --json
```

Once training completes, copy `model_output_name` from the JSON. In the next
command, replace `MODEL_OUTPUT_NAME` and choose hardware available to your account
that supports your model. Creating the endpoint starts separately billed hosting:

```bash
uv run --extra train --env-file .env tg endpoints create MODEL_OUTPUT_NAME \
uv run --env-file .env tg endpoints create MODEL_OUTPUT_NAME \
--hardware 1x_nvidia_h100_80gb_sxm --display-name tev1-4B-experimental --wait
```

Expand All @@ -89,7 +89,7 @@ model to emit that JSON object.
Stop your dedicated endpoint when finished, using its **ID**:

```bash
uv run --extra train --env-file .env tg endpoints stop YOUR_ENDPOINT_ID
uv run --env-file .env tg endpoints stop YOUR_ENDPOINT_ID
```

Training cost and duration vary with settings and provider capacity. The original
Expand Down
7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,4 @@ description = "Fine-tune Qwen3.5-4B decision models on Together AI"
readme = "README.md"
license = "MIT"
requires-python = ">=3.12"
dependencies = ["datasets==4.8.5", "transformers==5.17.0", "jinja2>=3.1,<4"]

[project.optional-dependencies]
train = [
"together==2.23.0",
]
dependencies = ["datasets==4.8.5", "transformers==5.17.0", "jinja2>=3.1,<4", "together==2.23.0"]
2 changes: 1 addition & 1 deletion test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_sdk_serializes_completion_only_lora_recipe(self):
try:
from together import Together
except ImportError:
self.skipTest('Install the train extra to verify SDK serialization')
self.fail('Run uv sync --locked to install the required Together SDK')
client = Together(api_key='fixture')
# Intercept submission and model-limits lookup so this test is offline.
with patch.object(client.fine_tuning, 'estimate_price',
Expand Down
43 changes: 19 additions & 24 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading