How to train your own Jev for $17
https://www.together.ai/blog/how-to-train-your-own-jev📌 訓練一個屬於自己的分類模型,只要 17 美元
TL;DR:Together AI 公開教學,教你用 Qwen3.5 4B 微調出 Jev 風格分類模型,訓練成本約 17 美元且可全程復現。
Jev 最近在 AI 圈引起不少討論——一個又快又便宜的分類模型,丟給它一段狀態加上預先定義的問題,它就能回傳分數、布林值或選擇題答案。Together AI 這篇文章沒有停在討論熱度上,而是直接示範怎麼自己動手做一個,並附上完整的指令與成本明細。
🤔 解決什麼問題
文章指出,這類「輸入狀態 + 問題 → 結構化答案」的分類模型有大量實際用途:電商平臺評估自動退貨申請、將 ML 論文分類、或是為一段文字打情感分數。Together AI 以此為出發點,在自家 serverless 平臺上發布了 together/Tev1-4B-experimental,並以此篇文章示範如何從頭微調出等效模型。
🧩 核心架構:用 Qwen3.5 4B 打底
模型底座是 Qwen3.5 4B,訓練資料則從 Hugging Face 上取樣了約 37,840 筆範例,涵蓋八個不同任務類型:
| 資料來源 | 任務類型 | 訓練筆數 |
|---|---|---|
| MultiNLI | 支持/反駁/中立 | 5,000 |
| BoolQ | 依段落回答是/否 | 3,000 |
| Banking77 | 選擇銀行業務意圖 | 3,000 |
| AG News | 新聞分類 | 1,500 |
| SST-5 | 情感等級 | 2,000 |
| Programmatic policies | 套用規則 | 13,500 |
| Routing | 路由決策 | 6,000 |
| Research taxonomy | 論文分類 | 3,840 |
文章特別強調,把資料量控制在這個規模,是為了讓整個微調成本壓在 17 美元左右;用更大的資料集雖然可能更準,但成本與訓練時間都會明顯上升。
🛠️ 怎麼用:從 clone 到部署
整個流程分成幾個步驟,Together AI 把每一步都寫成了可直接執行的指令:
- Clone 專案並安裝依賴:
git clone https://github.com/togethercomputer/tev1,接著uv sync --locked。 - 設定環境變數:複製
.env.example為.env,填入TOGETHER_API_KEY(JEV_MODEL先留空)。 - 下載並正規化資料:依序執行
uv run python fetch_sources.py與uv run python build_all.py,把八個資料源統一成同樣的 JSON 格式。 - 啟動微調:執行
uv run --with together --env-file .env python examples/train_together.py --launch,腳本會自動上傳訓練資料並在 Together AI Fine-tuning 服務上啟動任務,過程約需 25 分鐘,也可用tg fine-tuning retrieve查詢狀態。 - 部署成端點:取得
model_output_name後,用tg endpoints create搭配1x_nvidia_h100_80gb_sxm硬體建立專屬端點,再把端點名稱寫回.env的JEV_MODEL。
模型接受的輸入格式是結構化 JSON,包含 state(狀態描述)、question(問題)與 options(選項清單,每個選項有 label、key、description)。文章舉的範例是客服意圖分類:給模型一段「同一筆訂閱被重複扣款」的客戶留言,讓它從四個候選意圖中選出最匹配的一項。
⚠️ 適用場景與限制
這套流程的定位很清楚:不是要做出一個通用對話模型,而是針對「狀態 + 固定問題集 → 結構化答案」這類任務做輕量化微調。若不想自己訓練,Together AI 也提供已經部署好的 together/Tev1-4B-experimental 可直接呼叫。
🎯 實務啟示
對於需要大量重複性分類判斷(客服分流、內容審核、路由決策)的團隊,這篇教學提供了一條成本可控、步驟透明的路徑:不必依賴大型通用模型做這類任務,一個 4B 規模、針對性微調的分類器可能就足夠快、也足夠便宜。文中提供的資料混合比例,也是規劃自有分類任務資料集時值得參考的起點。
🔗 來源
- 標題:How to train your own Jev for $17
- 作者/機構:Together AI
- 連結:https://www.together.ai/blog/how-to-train-your-own-jev
#TogetherAI #Qwen #FineTuning #Classification #LLM #OpenSource #MLOps #Jev #AIEngineering #MachineLearning
原始資料 Together AI · 收集於 2026-09-24
摘要原文
Summary We just launched our own Jev-like classifier, together/Tev1-4B-experimental , on top of Qwen3.5 4B on Together’s serverless platform. In this blog post we’ll show you how to fine-tune your own version! Jev has quickly become one of the most talked about model releases in the AI space. It’s a powerful classification model that’s both fast and incredibly cheap to run. Give Jev a piece of state plus predefined questions and it will quickly give back a result in the form of a score, boolean value, or multiple choice answer. This sort of classification model has many real-world applications, such as an e-commerce site evaluating automated customer returns, categorizing ML papers, or even providing a sentiment rating for a piece of text. Today we’re going to fine-tune our own Jev-like classification model that takes state and returns an answer. Our goal is to create a model that can quickly and efficiently answer questions like: Customer message: Hi, I checked my statement and your company charged my card twice for the October subscription. The amounts are both $19.99 on the same day. I have not changed my plan. Which listed support intent best matches this customer's message? A. The customer reports being charged more than once. B. The customer wants to end or downgrade a subscription. C. The customer reports a payment that failed or was declined. D. None of the listed intents matches. In this blog post we’ll cover how to fine-tune and deploy a classification model that can answer these types of questions. By the time we’re done, you’ll have your own model deployed with an API endpoint that’s easy to integrate into any piece of software. Let’s get started by setting up your computer with everything needed to train the model. If you would rather jump straight into using the classifier, and not bother with training your own model, check out together/Tev1-4B-experimental on Together’s serverless platform. Getting started The first thing we need to do is clone the tev1 GitHub repository. git clone https://github.com/togethercomputer/tev1 Once the repository is cloned, we’ll need to install the necessary dependencies using: uv sync --locked The final setup step is to create an .env file that will hold the necessary environment variables. Copy .env.example : cp .env.example .env Edit the new .env file and add your TOGETHER_API_KEY . You do not need to add a JEV_MODEL just yet. Leave it blank for now. And that’s it. We’re now ready to fine-tune our model. Fine-tuning a classification model The next step is to take an existing language model and turn it into a model that specializes in classification. In order to do that we’ll need to create a fine-tune using a base model and a number of existing datasets. For the base model we’ll use Qwen3.5 4B and for the datasets we’ll use a handful that are hosted on Hugging Face. Picking datasets We’ll sample 38,000 questions from various datasets, each one specializing in a different type of classification. Here are the datasets and the number of examples we’ll use: Source Decision Training examples MultiNLI Support, contradict, or neutral 5,000 BoolQ Yes or no, using a passage 3,000 Banking77 Pick a banking intent 3,000 AG News Classify a news item 1,500 SST-5 Pick a sentiment level 2,000 Programmatic policies Apply a rule 13,500 Routing Rule decisions 6,000 Research taxonomy Paper classification 3,840 Total 37,840 We only use 38,340 examples to keep our fine-tuning costs low. Training against a dataset of this size will only cost about $17.0, while larger datasets are more expensive and time-consuming to train against. Normalizing the data Now that we have picked our six data sources, we need to sample a limited number of questions from them as well as normalize these questions so they are all in the same format. The repository contains a number of Python scripts that automate this process. First, download the datasets: uv run python fetch_sources.py Next, sample and normalize the questions that we will use for training: uv run python build_all.py For these commands you should see some output and no errors. Now that we have our training datasets, we’re ready to move on to the next step and fine-tune the classification model. Training the model We can launch a fine-tuning job using Together AI’s Fine-tuning service. There is a Python script that will help automate this process. Run it using: uv run --with together --env-file .env python examples/train_together.py --launch This script takes care of a number of steps needed to train a model. First, it uploads the training data to Together and then it launches a fine-tuning job using the dataset and appropriate parameters. Once the fine-tuning job launches, the training script will output a training job ID. Uploaded train.jsonl: file-81f6cdf1-6bc0-4e61-9aaa-bace7eb0a50a Uploaded dev.jsonl: file-5e61eb67-d4a1-474c-9871-f9d8307a2dc6 Training job: ft-f3e14f1e-a0ce You can check on the status of the training using the Together CLI: tg fine-tuning retrieve ft-f3e14f1e-a0ce You can also check on the status of the training job using the Fine-tuning dashboard over on Together AI. The training job will take roughly 25 minutes to complete, and once it does we’ll have a model that is ready to do classification. Deploying the model Before we can deploy our model, we’ll first need its name from the fine-tuning job. Run the following command: tg fine-tuning retrieve ft-f3e14f1e-a0ce --json | jq -r '.model_output_name' This command will print the model’s model_output_name . We’ll use this name to deploy the model to a dedicated endpoint on Together AI. Dedicated endpoints are responsible for exposing a fine-tuned model over an HTTP server so that we can send queries to it. tg endpoints create MODEL_OUTPUT_NAME --hardware 1x_nvidia_h100_80gb_sxm --display-name jev-v1-4b --wait Running this command will return information about your new endpoint: √ Dedicated endpoint created. Name: ENDPOINT_NAME ID: endpoint-5a31a048-d3f9-43bf-a56a-8aab8a4de8d6 State: Pending Hardware: 1x_nvidia_h100_80gb_sxm Model: MODEL_OUTPUT_NAME Replicas: min: 1 max: 1 Created: 09/22/2026, 02:23 PM √ Endpoint started Once created, you will see the name of the endpoint in the output. You can also find more information about the endpoint using your Dedicated endpoints dashboard over on Together AI as well. Put the name of the endpoint inside of your .env as JEV_MODEL . For example, if your endpoint were named account_855c/Qwen3.5-4B-jev-efde5bd5-068f756b then your .env should have: # .env TOGETHER_API_KEY=... JEV_MODEL=account_855c/Qwen3.5-4B-jev-efde5bd5-068f756b And that’s it. Your model is now deployed on Together AI and ready to answer any classification questions. In the next section, we’ll learn how to query our model. Querying the model The code repository contains a number of test cases to verify the model is functioning correctly. Let’s use our classification model to find the intent of a customer’s question about their subscription: Customer message: Hi, I checked my statement and your company charged my card twice for the October subscription. The amounts are both $19.99 on the same day. I have not changed my plan. Since our model was fine-tuned on JSON input and output, we need to format that question, and its possible answers, using a JSON data structure like so: { "state": "Customer message: Hi, I checked my statement and your company charged my card twice for the October subscription. The amounts are both $19.99 on the same day. I have not changed my plan.", "question": "Which listed support intent best matches this customer's message?", "options": [ { "label": "A", "key": "duplicate_charge", "description": "The customer reports being charged more than once." }, { "label": "B", "key": "cancel_subscription", "description": "The customer wants to end or downgrade a subscription." }, { "label": "C", "key": "card_declined", "description": "The customer reports a payment that failed or was declined.
由 claude-code/sonnet 自動生成