跳到正文
DEV Community· chovy·· 4 小時前AI 評分56

如何在 c0mpute 上利用連結訓練 saas-business-strategist-agent 並發布到 Hugging Face

Train a business strategy model from links, on c0mpute, and publish it to Hugging Face

AI 導讀

作者展示如何由連結建立語料,在 CPU 上以 LoRA 微調 SaaS 商業策略模型,並將模型發布到 Hugging Face。底模為 Qwen2.5-0.5B-Instruct,訓練語料包含 3,615 篇貼文;模型在 4 個 CPU 執行緒上訓練 400 steps,峯值 RAM 為 2.4 GB,留出集困惑度由 44.5 降至 28.6。

正文

chovy

We trained saas-business-strategist-agent today: a small business and SaaS strategy model, trained on a CPU from a list of links, and published it on Hugging Face. You can train your own the same way.

Model: https://huggingface.co/profullstack/saas-business-strategist-agent

Links in, model out

The c0mpute example takes links and turns them into a training corpus:

No API keys. rssamplifier and pit.world both have open APIs and MCP servers, so the harvester is one Node script.

node harvest.mjs https://rssamplifier.com/topics/business,saas,crypto \
  'https://pit.world/search?q=saas,business,crypto' --full --out data/saas-business.jsonl

Train it on c0mpute, or on your own CPU

c0mpute 0.2.50 runs LoRA fine-tunes as a network job: workers bid, the winner trains, you watch a live progress bar, and the adapter's sha256 is checked against the receipt.

c0mpute infernet text train --job job-saas.json --dataset data/saas-business.jsonl \
  --output out/saas-business-strategist-agent --yes

Or locally:

.venv/bin/python train.py job.json --name saas-business-strategist-agent --dataset data/saas-business.jsonl

The numbers

  • Base model: Qwen2.5-0.5B-Instruct, a rank 8 LoRA (about 1.1M trainable parameters), bf16.
  • Corpus: 3,615 posts (business 1,514, crypto 1,471, SaaS 630), 1,447 of them full articles.
  • 400 steps on 4 CPU threads, 2.4 GB peak RAM. Held-out perplexity went from 44.5 to 28.6.
  • The adapter is 4.4 MB.

The first version used a 135M model. It echoed questions back. 0.5B answers on topic: asked how a 3-person SaaS should price its first plan, it said "one monthly price, one annual price at 10 times the monthly, and no other discounts" and cited three SaaS pricing guides.

A sub-1B model learns the voice, not the facts. So the agent searches pit.world for each question and puts the top pages in the prompt. The facts come from search and the tune supplies the register.

Two things that bit us

  • torch uses one thread per core by default. On a busy 32-core box that ran at 22 tokens a second. Four threads ran at about 330.
  • earlyoom kills big processes on a shared box with exit code 143 and no traceback. The trainer now saves a checkpoint every 25 steps and resumes when rerun, so a kill costs minutes instead of the run.

Also shipped today

  • pit.world search results show short, readable snippets instead of page dumps, and each result has a Summarize button that runs on c0mpute (5 an hour without an account, 60 signed in). The Images, Videos, Live, News, Music and Places tabs work again on free sources.
  • rssamplifier.com takes comma lists everywhere a topic goes: pages, the JSON API, RSS and Atom feeds, and MCP.

Try it

The example, with the harvester, trainer, chat and Hugging Face publisher: https://github.com/profullstack/c0mpute/tree/master/examples/business-strategist-agent

Swap the links for your own topics and give it a name.

來源:DEV Community · dev.to