MachinaCheck:AMD MI300X 上で構築したマルチエージェント CNC 製造可能性システム
Lablab.ai AMD Developer Hackathon の成果として、AMD MI300X 上で Qwen 2.5 を活用したマルチエージェントシステム「MachinaCheck」が構築され、製造可能性評価の自動化が進んだ。
キーポイント
ハードウェア基盤としての AMD MI300X の採用
本プロジェクトは、高性能な AI アクセラレータである AMD MI300X を基盤として構築されており、大規模モデルの推論処理能力を最大限に活用している。
マルチエージェントアーキテクチャの実装
操作分類、ツールマッチング、実行可能性判断など複数の役割を持つエージェントが連携し、STEP ファイルから製造プロセスを解析するシステムを構築した。
LLM とルールベースのハイブリッド構成
Qwen 2.5-7B モデルによる柔軟な推論と、Python による厳密なファイルパーサやツールマッチングを組み合わせることで、精度と信頼性の両立を図っている。
製造可能性評価の自動化
従来の人手に依存していた CNC 加工の設計段階での製造可能性チェック(Machinability Check)を AI エージェントが自動実行し、レポートを生成する仕組みを実現した。
LLM の適切な役割分担
推論が必要な箇所でのみ LLM を使用し、ツールマッチングなどの単純な検索タスクは Python やデータベースクエリで処理することで、速度と信頼性を向上させた。
構造化出力のためのプロンプトエンジニアリング
Qwen モデルが正確に JSON を生成できるよう、ドリルとエンドミルの使い分けや径の一致など、具体的なルールをプロンプトに明示する工夫が必要だった。
AMD MI300X の性能評価
192GB の VRAM を活用することで大規模モデル(Qwen 2.5 72B)の動作が可能であり、本ユースケースにおいて非常に高い推論品質と柔軟性を提供している。
影響分析・編集コメントを表示
影響分析
この記事は、生成 AI が単なるチャットボットやコンテンツ作成を超え、製造業のような厳密な物理プロセスを扱う分野で実証的な価値を発揮し始めたことを示しています。特に AMD のハードウェアと Qwen モデルの組み合わせが、産業用タスクの自動化において有望であることを裏付ける事例であり、ハッカソンを通じた迅速なプロトタイピングの成功例として注目されます。
編集コメント
ハッカソンという短期間の開発期間でありながら、産業の現場課題(製造可能性評価)に対して具体的な解決策を提示した点が非常に興味深いです。AMD のハードウェア性能と Qwen モデルの推論能力が組み合わさることで、実社会での AI 活用が加速する兆候が見られます。
- 私たちが解決した課題
- MachinaCheck の機能
- なぜ AMD MI300X で構築したのか
- エージェントアーキテクチャ コンポーネント 1 — STEP ファイルパーサー(純粋な Python、LLM なし)
- エージェント 1 — 操作分類器(Qwen 2.5 7B)
- エージェント 2 — ツールマッチャー(純粋な Python)
- エージェント 3 — 実現可能性判断エージェント(Qwen 2.5 7B)
- エージェント 4 — レポート生成器(Qwen 2.5 7B)
- AMD スタック
- 結果
- 私たちが学んだこと
- 実際に試す
*lablab.ai で開催された AMD デベロッパーハッカソンにて構築 — 2026 年 5 月*
私たちが解決した課題
小さな CNC 工作機械工場を訪れ、管理者に顧客の受注を受理するかどうかの判断基準を聞いてみてください。
答えはほぼ常に同じです。図面を印刷し、手作業で寸法を読み込み、工場の隅々まで歩き回って利用可能な工具を確認し、自社の機械が要求される公差(tolerance)を満たせるかを見積もり、クリップボードにメモを書き留めます。この一連のプロセスには、図面 1 枚あたり 30 分から 60 分かかります。週に 10 から 20 の見積依頼(RFQ: Request for Quotation)を受ける忙しい工場にとっては、実現可能性分析だけで熟練した管理者の時間を 5 時間から 20 時間も費やすことになります。
時には判断を誤ることもあります。受注して生産を開始しても、途中で適切なタップがないことや、ミリング盤が重要な特徴部の公差(tolerance)を保てないことが判明します。部品は廃棄され、顧客は不満を抱き、機械の使用時間は無駄になります。
私たちはこの問題を完全に解消するために MachinaCheck を構築しました。
MachinaCheck の機能
MachinaCheck はマルチエージェント AI システムです。顧客から機械加工工場へ送られる標準的な CAD 形式である STEP ファイルをアップロードし、3 つの単純な入力項目(材料種別、必要な公差、およびねじ仕様)を追加するだけで、30 秒後には完全な製造可能性レポートが得られます。このレポートでは、部品製作が可能かどうか、必要な工具は何か、何が不足しているか、生産開始前に取るべきアクションが具体的に示されます。
手書き図面の読み込みも不要です。工場内を歩き回る必要もありません。推測に頼ることもありません。
なぜ AMD MI300X で構築したのか
アーキテクチャの説明に入る前に、この点は独自のセクションを持つ価値があります。なぜなら、これは単なる技術的な選択ではなく、ビジネス上の必須要件だからです。
製造業の顧客は機密保持契約(NDA)を締結します。彼らの STEP ファイルには、何年にもわたるエンジニアリングの成果と数百万ドルに及ぶ研究開発費が反映された独自形状が含まれています。医療機器の穴パターンや航空宇宙コンポーネントのポケット形状は、機密性の高い知的財産です。
そのデータを OpenAI や Anthropic、あるいはその他の商用 API エンドポイントへ送信することは、機密保持違反です。明確にそう断言します。
AMD Instinct MI300X はこの状況を根本から変えます。192GB の HBM3 VRAM と 5.3 TB/s のメモリ帯域幅を備えた同プロセッサを使用することで、Qwen 2.5 7B Instruct をオンプレミス環境で完全に実行できます。データが工場インフラの外へ流出することはありません。STEP 形状データが第三者サーバーへ送信されることもありません。顧客の知的財産は、本来あるべき場所に留まります。
これが製造業の文脈における「設計段階からのプライバシー保護」が実際に意味するところです。単なるチェックボックスではなく、製品を実際のエンタープライズ顧客にとって実現可能にする根本的なアーキテクチャ上の意思決定です。
エージェントアーキテクチャ
MachinaCheck は LangChain を用いて構築された 5 つのコンポーネントからなるパイプラインを使用し、FastAPI によってオーケストレーションされています。
コンポーネント 1 — STEP ファイルパーサー(純粋な Python、LLM なし)
OpenCASCADE を基盤とした Python ライブラリである cadquery を使用して、STEP ファイルを直接解析します。これにより、数学的に正確な特徴抽出が可能になります。
- 直径と深さを有するすべての円筒穴
- 平坦面とその面積
- 面取り(Chamfers)およびフィレット(Fillet)
- 外接ボックスの寸法
- 総体積および表面積
この抽出は、数学的幾何学を直接読み取るため 100% の精度を誇ります。ビジョンモデルも OCR も近似処理も不要です。出力される Ø6.0mm の穴は、まさに Ø6.0mm として正確に表現されます。
def extract_features(step_file_path: str) -> dict:
model = cq.importers.importStep(step_file_path)
shape = model.val()
bb = shape.BoundingBox()
holes = {}
for face in model.faces().vals():
adaptor = BRepAdaptor_Surface(face.wrapped)
if adaptor.GetType() == GeomAbs_Cylinder:
radius = adaptor.Cylinder().Radius()
diameter = round(radius * 2, 3)
holes[diameter] = holes.get(diameter, 0) + 1
return {
"bounding_box_mm": {"length": round(bb.xlen, 3), ...},
"holes": [...],
"flat_surfaces_count": len(flat_surfaces),
}
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
エージェント 1 — オペレーション分類器 (Qwen 2.5 7B)
抽出された幾何形状とユーザー入力(材料、公差、ねじ山)は、vLLM を介して AMD MI300X で実行される Qwen 2.5 7B に渡されます。
このエージェントは次のように回答します:*「この部品を製造するために必要な CNC オペレーションと工具は何ですか?」*
製造ドメインの知識を適用します。例えば、ステンレス鋼 304 には超硬工具が必要です。円筒形の穴にはエンドミルではなくドリルが必要です。±0.005mm の公差には標準的なフライス盤ではなく、高精度な機械が必要です。
エージェント 2 — ツールマッチャー (純粋な Python)
このエージェントは LLM を使用しません。ショップの工具在庫データベースを照会し、必要な各工具が利用可能かどうかを確認します。これは純粋な決定論的ロジックです(データベース検索、比較、結果)。データベース照会に LLM は不要であり、ここで使用すると不要なレイテンシとハルシネーション(幻覚)のリスクが生じるだけです。
エージェント 3 — 実現可能性判断エージェント (Qwen 2.5 7B)
マッチング結果は Qwen に戻されます。このエージェントは全体の状況を推論し、構造化された意思決定を生成します:
{
"decision": "CONDITIONAL",
"confidence": "HIGH",
"reason": "M10x1.5 タップを除き全ての工具が利用可能",
"action_items": ["M10x1.5 タップを購入($15)"],
"risk_flags": ["ステンレス鋼 304 の主軸回転数を検証"],
"estimated_setup_hours": 2.5
}
エージェント 4 — レポート生成器 (Qwen 2.5 7B)
最終的なエージェントは、全体のステータス、エグゼクティブサマリー、部品分析、工具状況、機械状況、そして最終推奨事項を含む、専門的な製造可能性レポートにすべての情報を統合します。
AMD のスタック
ROCm と vLLM を介して AMD MI300X 上で Qwen 2.5 7B を実行するのは straightforward(至って簡単)でした。AMD Developer Cloud 上の vLLM Quick Start イメージには、すべてが事前に設定されています。
python -m vllm.entrypoints.openai.api_server \
--model Qwen/Qwen2.5-7B-Instruct \
--host 0.0.0.0 \
--port 8000 \
--dtype float16 \
--gpu-memory-utilization 0.5
gpu-memory-utilization を 0.5 に設定することで、利用可能な 192GB のうち約 96GB を使用し、十分な余裕を残しています。エージェント呼び出しにおける推論レイテンシの平均は 3 秒未満です。
LangChain は OpenAI 互換エンドポイントを通じて vLLM に接続します:
from langchain_community.llms import VLLMOpenAI
llm = VLLMOpenAI(
openai_api_base="http://localhost:8000/v1",
openai_api_key="EMPTY",
model_name="Qwen/Qwen2.5-7B-Instruct",
temperature=0.1,
max_tokens=1000
)
結果
GrabCAD から取得した実際の STEP ファイルでテストを行いました:
- フィーチャー抽出:最大 50 のフィーチャーを持つ部品の場合、1 秒未満
- 全体パイプライン(全 4 エージェント):エンドツーエンドで 25〜40 秒
- 意思決定の精度:すべてのテスト部品において製造可能性評価が正しく行われた
- プライバシー:STEP 幾何データは外部へ 1 バイトも送信されていない
学んだこと
推論が必要な場合にのみ LLM を使用してください。 エージェント 2(ツールマッチング)は純粋な Python で実装されています。そこに LLM を配置すると、処理が遅くなり、コストが増大し、信頼性が低下します。データベース参照に最適なツールは、データベースクエリです。
構造化された出力のためのプロンプトエンジニアリングは重要です。 Qwen が信頼性のある有効な JSON を出力するためには、プロンプト内で慎重なルール設定が必要でした。具体的には、円筒形の穴にはエンドミルではなくドリルが必要であること、直径は正確に一致させる必要があること、ねじ山が指定された場合のみタップが存在することなどを明示的に記述しました。
この用途において AMD MI300X は本当に印象的です。 192GB の VRAM を備えているため、必要であればより大規模なモデルを実行することも可能です。本番環境でのデプロイを想定する場合、Qwen 2.5 72B を使用すれば余裕を持って動作し、推論の質が大幅に向上します。
実際に試す
- HF Space: huggingface.co/spaces/lablab-ai-amd-developer-hackathon/MachinaCheck
- GitHub: github.com/SyedMuhammadSarmad/Manufacturing-Agent
任意の STEP ファイルをアップロードして、フルパイプラインが動作する様子をご覧ください。
*AMD Developer Hackathon 2026 年 5 月に、Syed Muhammad Sarmad と Sabari Doss R が構築しました。*
*スタック: Qwen 2.5 7B · AMD Instinct MI300X · ROCm · vLLM · LangChain · cadquery · FastAPI · Next.js · Hugging Face Spaces*
原文を表示
- The Problem We Solved
- What MachinaCheck Does
- Why We Built It on AMD MI300X
- The Agent Architecture Component 1 — STEP File Parser (Pure Python, No LLM)
- Agent 1 — Operations Classifier (Qwen 2.5 7B)
- Agent 2 — Tool Matcher (Pure Python)
- Agent 3 — Feasibility Decision Agent (Qwen 2.5 7B)
- Agent 4 — Report Generator (Qwen 2.5 7B)
- The AMD Stack
- Results
- What We Learned
- Try It
*Built at the AMD Developer Hackathon on lablab.ai — May 2026*
The Problem We Solved
Walk into any small CNC machine shop and ask the manager how they decide whether to accept a customer job.
The answer is almost always the same: they print the drawing, read every dimension by hand, walk around the shop checking which tools are available, estimate whether their machines can hold the required tolerances, and write notes on a clipboard. The whole process takes 30 to 60 minutes per drawing. For a busy shop receiving 10 to 20 RFQs per week, that is 5 to 20 hours of skilled manager time spent on feasibility analysis alone.
Sometimes they get it wrong. They accept a job, start production, and discover halfway through that they don't have the right tap or that their mill cannot hold the tolerance on a critical feature. The part gets scrapped. The customer is unhappy. The machine time is lost.
We built MachinaCheck to eliminate this problem entirely.
What MachinaCheck Does
MachinaCheck is a multi-agent AI system. You upload a STEP file — the standard CAD format that customers send to machine shops — along with three simple inputs: material type, required tolerance, and any thread specifications. Thirty seconds later you have a complete manufacturability report telling you exactly whether you can make the part, what tools you need, what is missing, and what actions to take before starting production.
No manual drawing reading. No walking around the shop. No guesswork.
Why We Built It on AMD MI300X
Before explaining the architecture, this point deserves its own section because it is not just a technical choice — it is a business requirement.
Manufacturing customers sign NDAs. Their STEP files contain proprietary geometry representing years of engineering work and millions of dollars in R&D. The hole pattern on a medical device or the pocket geometry on an aerospace component is confidential intellectual property.
Sending that data to OpenAI, Anthropic, or any commercial API endpoint is a confidentiality violation. Full stop.
The AMD Instinct MI300X changes this equation completely. With 192GB of HBM3 VRAM and 5.3 TB/s of memory bandwidth, we run Qwen 2.5 7B Instruct entirely on-premise. No data leaves the shop's infrastructure. No STEP geometry is transmitted to a third-party server. The customer's IP stays where it belongs.
This is what "privacy by design" actually means in a manufacturing context — not a checkbox, but a fundamental architectural decision that makes the product viable for real enterprise customers.
The Agent Architecture
MachinaCheck uses a five-component pipeline built with LangChain and orchestrated via FastAPI.
Component 1 — STEP File Parser (Pure Python, No LLM)
We use cadquery, a Python library built on OpenCASCADE, to parse STEP files directly. This gives us mathematically exact feature extraction:
- All cylindrical holes with diameter and depth
- Flat surfaces and their areas
- Chamfers and fillets
- Bounding box dimensions
- Total volume and surface area
This extraction is 100% accurate because it reads the mathematical geometry directly — no vision model, no OCR, no approximation. A Ø6.0mm hole is exactly Ø6.0mm in the output.
def extract_features(step_file_path: str) -> dict:
model = cq.importers.importStep(step_file_path)
shape = model.val()
bb = shape.BoundingBox()
holes = {}
for face in model.faces().vals():
adaptor = BRepAdaptor_Surface(face.wrapped)
if adaptor.GetType() == GeomAbs_Cylinder:
radius = adaptor.Cylinder().Radius()
diameter = round(radius * 2, 3)
holes[diameter] = holes.get(diameter, 0) + 1
return {
"bounding_box_mm": {"length": round(bb.xlen, 3), ...},
"holes": [...],
"flat_surfaces_count": len(flat_surfaces),
}
Agent 1 — Operations Classifier (Qwen 2.5 7B)
The extracted geometry plus user inputs — material, tolerance, threads — are passed to Qwen 2.5 7B running on AMD MI300X via vLLM.
The agent answers: *"What CNC operations and tools are required to manufacture this part?"*
It applies manufacturing domain knowledge: Steel 304 needs carbide tooling. A cylindrical hole needs a drill, not an end mill. A tolerance of ±0.005mm requires a precision machine, not a standard mill.
Agent 2 — Tool Matcher (Pure Python)
This agent does not use an LLM. It queries the shop's tool inventory database and checks each required tool against what is available. Pure deterministic logic — database lookup, comparison, result. LLMs are not needed for database queries and using them here would add unnecessary latency and hallucination risk.
Agent 3 — Feasibility Decision Agent (Qwen 2.5 7B)
The match results go back to Qwen. The agent reasons about the overall situation and produces a structured decision:
{
"decision": "CONDITIONAL",
"confidence": "HIGH",
"reason": "All tools available except M10x1.5 tap",
"action_items": ["Purchase M10x1.5 tap ($15)"],
"risk_flags": ["Verify spindle speed for Steel 304"],
"estimated_setup_hours": 2.5
}
Agent 4 — Report Generator (Qwen 2.5 7B)
The final agent synthesizes everything into a professional manufacturability report with an overall status, executive summary, part analysis, tools status, machine status, and final recommendation.
The AMD Stack
Running Qwen 2.5 7B on AMD MI300X via ROCm and vLLM was straightforward. The vLLM Quick Start image on AMD Developer Cloud has everything pre-configured.
python -m vllm.entrypoints.openai.api_server \
--model Qwen/Qwen2.5-7B-Instruct \
--host 0.0.0.0 \
--port 8000 \
--dtype float16 \
--gpu-memory-utilization 0.5
With gpu-memory-utilization 0.5 we use approximately 96GB of the available 192GB, leaving plenty of headroom. Inference latency for our agent calls averages under 3 seconds.
LangChain connects to vLLM via the OpenAI-compatible endpoint:
from langchain_community.llms import VLLMOpenAI
llm = VLLMOpenAI(
openai_api_base="http://localhost:8000/v1",
openai_api_key="EMPTY",
model_name="Qwen/Qwen2.5-7B-Instruct",
temperature=0.1,
max_tokens=1000
)
Results
Testing with real STEP files from GrabCAD:
- Feature extraction: under 1 second for parts with up to 50 features
- Full pipeline (all 4 agents): 25 to 40 seconds end-to-end
- Decision accuracy: correct manufacturability assessment on all test parts
- Privacy: zero bytes of STEP geometry transmitted externally
What We Learned
Use LLMs only where reasoning is needed. Agent 2 (tool matching) is pure Python. Putting an LLM there would be slower, more expensive, and less reliable. The right tool for database lookup is a database query.
Prompt engineering for structured output matters. Getting Qwen to reliably output valid JSON required careful rules in the prompt — explicitly stating that cylindrical holes need drills not end mills, that diameters must match exactly, that taps only appear when threads are specified.
AMD MI300X is genuinely impressive for this use case. The 192GB VRAM means we could run a much larger model if needed. For a production deployment, Qwen 2.5 72B would fit comfortably and deliver significantly better reasoning quality.
Try It
- HF Space: huggingface.co/spaces/lablab-ai-amd-developer-hackathon/MachinaCheck
- GitHub: github.com/SyedMuhammadSarmad/Manufacturing-Agent
Upload any STEP file and see the full pipeline in action.
*Built by Syed Muhammad Sarmad and Sabari Doss R at the AMD Developer Hackathon, May 2026.*
*Stack: Qwen 2.5 7B · AMD Instinct MI300X · ROCm · vLLM · LangChain · cadquery · FastAPI · Next.js · Hugging Face Spaces*
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み