Skip to main content

AutoForge

讓 AI 自己分析需求、選擇方法、訓練、評估、部署 AI 模型的可安裝平台。

  • 三種 AI 大腦:訂閱制 AI(透過 MCP)、雲端 API、本地模型
  • 硬體:NVIDIA GPU(CUDA),沒有 GPU 時自動改用 CPU
  • 方法包:從 GitHub 安裝的「教學包」,AI 讀了就知道怎麼訓練
  • 隱私:敏感資料只允許本地模型指揮

1.2.0 · 文件網站:https://honguan.github.io/autoforge/ · 變更紀錄

安裝與第一次使用

pip install autoforge-trainer          # 需要 Python 3.11 以上
autoforge quickstart              # 約 1 分鐘:檢查硬體 → 安裝方法包 → 訓練 → 註冊 → 預測
autoforge gui                     # 網頁介面
安裝方式 包含
pip install autoforge-trainer 表格、文字(TF-IDF)、時間序列、異常偵測、自動調參、網頁介面、MCP、REST
pip install "autoforge-trainer[deep]" 再加上 Transformer、Embedding、LLM 微調與 DPO、圖片分類、物件偵測、影像分割、語音辨識、圖像生成 LoRA(NVIDIA GPU)
pip install "autoforge-trainer[all]" 再加上強化學習、Claude 代理、ONNX 匯出
docker run --rm -p 127.0.0.1:8800:8800 -v autoforge:/data ghcr.io/honguan/autoforge:cpu CPU 映像,預設啟動網頁介面
docker run --rm --gpus all -p 127.0.0.1:8800:8800 -v autoforge:/data ghcr.io/honguan/autoforge:cuda NVIDIA CUDA 映像,所有方法包

PyPI 上的 autoforge 是另一個不相關的專案(autoforge-ai、autoforge-ml 也都無法使用),請安裝 autoforge-trainer;裝好之後指令一樣是 autoforge。

操作方式:網頁介面 · 一句話訓練 · 讓訂閱制 AI 透過 MCP 操作 · 改進模型 · 部署 · 架構 · 路線圖

內建方法包

方法包 用途 方法 硬體
tabular-classic 表格分類、回歸 邏輯迴歸、隨機森林(可匯出 ONNX) CPU
text-classification 文字分類(情緒、意圖、主題、垃圾訊息) TF-IDF + 線性模型;Transformer 微調 CPU / GPU
llm-finetune 大型語言模型微調 LoRA / QLoRA(可匯出合併後的權重) GPU(8GB+)
image-classification 圖片分類 timm 預訓練模型微調(可匯出 ONNX) GPU 建議,CPU 可跑小模型
timeseries-forecast 時間序列預測(銷量、用電、流量),單一或多條序列 落後特徵 + 梯度提升;多序列共用一個模型;和「明天=今天」的基準比較 CPU
anomaly-detection 異常偵測(詐欺、故障、離群值) Isolation Forest CPU
object-detection 物件偵測(框出物品、瑕疵、人車) torchvision Faster R-CNN 微調,mAP@0.5 GPU 建議,CPU 可跑小模型
image-segmentation 影像分割(逐像素標類別) torchvision LR-ASPP / DeepLabV3,mIoU GPU 建議,CPU 可跑小模型
embedding-finetune 文字向量微調(搜尋、RAG 檢索、相似度) 對比學習(同批負樣本),和微調前比較 recall@1 CPU / GPU
speech-recognition 語音辨識 Whisper 微調,WER / CER,和微調前比較 GPU 建議
llm-preference LLM 偏好對齊(選好的回答、避開壞的) DPO + LoRA / QLoRA GPU(8GB+)
diffusion-lora 圖像生成風格 / 主體 LoRA Stable Diffusion 1.x/2.x UNet LoRA GPU(8GB+)
reinforcement-learning 強化學習(遊戲、控制、自己的模擬器) stable-baselines3:PPO / A2C / DQN / SAC CPU(小網路)/ GPU
recommendation 推薦系統(商品、內容) 隱式回饋 ALS、Item-KNN,和熱門排行比較 CPU

每個方法包都附給 AI 讀的 KNOWLEDGE.md,以及在 CPU 上 30 秒內跑完的測試。自己做方法包:autoforge pack new(見 docs/PACK_SPEC.md)。

從原始碼開發

git clone https://github.com/Honguan/autoforge && cd autoforge
pip install -e ".[dev]"            # 加上 ,deep 安裝深度學習方法包的依賴,,rl 安裝強化學習的依賴
pytest -q

網頁介面

autoforge gui      # 打開瀏覽器:上傳資料 → 選任務 → 選方法 → 訓練 → 調參 → 註冊 → 預測
                   # 或在「AI 助手」頁面用一句話讓 AI 幫你做完(開始訓練前會先問你)

使用

autoforge doctor               # 偵測硬體
autoforge doctor --json        # 給 AI 讀的 JSON
autoforge schema               # 列出所有資料結構
autoforge schema TrainingPlan --json

# 方法包
autoforge pack search csv --fit            # 搜尋這台電腦跑得動的方法包
autoforge pack install tabular-classic    # 從索引安裝(鎖定 commit)
autoforge pack install ./packs/tabular-classic   # 從本地資料夾安裝
autoforge pack install github:owner/repo/subdir@v1.0.0
autoforge pack info tabular-classic --json       # 給 AI 讀的知識和方法
autoforge pack list

# 訓練
autoforge plan validate examples/churn_plan.yaml     # 檢查訓練計畫
autoforge run start examples/churn_plan.yaml --wait  # 訓練並即時顯示進度
autoforge run start plan.yaml --json                 # 背景訓練,立即回傳 run_id(給 AI 用)
autoforge run status <run_id>
autoforge run pause|resume|stop <run_id>
autoforge run metrics|logs|audit <run_id>
autoforge run retry <run_id>                         # 同計畫重跑,從 checkpoint 接續

每次訓練的所有檔案都在 ~/.autoforge/runs/<run_id>/:計畫、模型、checkpoint、日誌、指標、稽核紀錄,計畫和 AI 寫的程式會用 git 版本管理。

方法包格式見 docs/PACK_SPEC.md,索引放在本 repo 的 packs-index 分支。

改進模型

autoforge run diagnose <run_id>                                       # 找問題、給建議
autoforge hpo start examples/churn_plan.yaml -m f1_macro -n 20 --wait # 自動調參(trial 0 = 基準)
autoforge run adjust <run_id> --set learning_rate=0.0003              # 訓練中途改參數
autoforge run compare <id1> <id2> -m f1_macro                         # 比較

部署

autoforge model register <run_id> --name churn      # 註冊成模型(v1、v2…)
autoforge model predict churn --rows '[{...}]'       # 預測
autoforge serve                                      # REST API(127.0.0.1:8000)
autoforge serve-mcp                                  # 每個模型變成 MCP 工具 predict_<名稱>,給其他 AI 呼叫
autoforge model export churn --format onnx           # 匯出

一句話訓練(內建 AI 代理)

pip install -e ".[anthropic]"
autoforge train "預測 churned 欄位" --data examples/data/churn.csv                   # Claude(預設)
autoforge train "預測 churned 欄位" --data examples/data/churn.csv --brain ollama:qwen3   # 本地模型

詳見 docs/AGENT.md。

讓 AI 操作(MCP)

claude mcp add autoforge -- autoforge mcp --actor ai:claude-code   # Claude Code

Claude Desktop 和隱私設定見 docs/MCP.md。

autoforge data mark ~/data/customers -s sensitive   # 敏感資料:雲端 AI 不能使用

測試

pytest

Metadata

Release files for autoforge-trainer 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autoforge-trainer 1.2.0
File Size Uploaded
autoforge_trainer-1.2.0.tar.gz 238.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autoforge-trainer 1.2.0
File Interpreter ABI Platform
autoforge_trainer-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 360.4 kB

Release files / autoforge_trainer-1.2.0.tar.gz

Download URL autoforge_trainer-1.2.0.tar.gz
Size 238.9 kB
Tags Source
SHA-256 checksum
How to use checksums
222b21673b1b51f8840ef94e49c14d7430b253c125d5254159debeb49a16e053
BLAKE2b-256 checksum
How to use checksums
dc37e720aa516d8460de6ae2d59bd5fb3d594874c69726b7fdcf89236374a133
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / autoforge_trainer-1.2.0-py3-none-any.whl

Download URL autoforge_trainer-1.2.0-py3-none-any.whl
Size 121.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
479a4fa84d9e0ba2d5a783f337a1979cbbad9e548971d3e515f42fbd5f7757a2
BLAKE2b-256 checksum
How to use checksums
ac3556cde142f5d939237cec5ba6d755309b3ae67c2fef07b734e81772e83de9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page