npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lucashsu95/ai-forge

v0.2.0

Published

CLI tool to scaffold AI client projects (Python + Node.js)

Readme

⚒️ AI-Forge

 █████╗ ██╗     ███████╗ ██████╗ ██████╗  ██████╗ ███████╗
██╔══██╗██║     ██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
███████║██║     █████╗  ██║   ██║██████╔╝██║  ███╗█████╗  
██╔══██║██║     ██╔══╝  ██║   ██║██╔══██╗██║   ██║██╔══╝  
██║  ██║██║     ██║     ╚██████╔╝██║  ██║╚██████╔╝███████╗
╚═╝  ╚═╝╚═╝     ╚═╝      ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚══════╝

鑄造你的 AI Client 基礎設施。 一行指令建好標準化 AI client 專案,直接串接 H200 Gemma4-31B。


🚀 快速安裝

npm (推薦)

npm install -g ai-forge

curl | bash

curl -fsSL https://gitlab.ntubimdbirc.tw/birc-backend/AI-Forge/-/raw/main/install.sh | bash

🛠️ 指令集

| 指令 | 說明 | 範例 | | :--- | :--- | :--- | | ai-forge init [名稱] | 建立專案;名稱為 . 時寫入目前目錄 | ai-forge init my-ai-app | | ai-forge init . --yes | 不提問,未指定的選項用預設值 | ai-forge init . --yes --lang python | | ai-forge init . --force | 覆寫已存在的 SDK / .env.example | ai-forge init . --yes --force | | ai-forge ask "問題" | 直接問 AI(讀取專案 .env) | ai-forge ask "你好" | | ai-forge --help | 顯示所有可用指令 | ai-forge --help | | ai-forge --version | 查看目前版本 | ai-forge --version |


🏁 快速開始

1. 初始化專案

互動式(會問名稱、模型、端點、語言):

ai-forge init my-ai-app

給 agent 或 CI 用,寫入目前目錄、不提問。--model--base-url 可省略,會用預設值:

ai-forge init . --yes --lang python

設定選項:

  • 專案名稱(. 表示目前目錄;--yes 且省略名稱時同樣寫入目前目錄)
  • 預設模型(--model,預設 Gemma4-31B
  • API 端點(--base-url,預設 https://chatapi.ntubimdbirc.tw/v1
  • 語言(--lang python,node,預設兩者皆產出)

2. 專案結構

AI-Forge 會產生 SDK 與環境設定檔。重跑 init 是升級路徑:已有檔案會跳過,只補缺少的 SDK 檔、gitignore 規則、以及 .env 裡缺的 VLLM_* 變數。--force 會覆寫 SDK 與 .env.example,但不會改 .env 既有值。不會產生或改寫 README.md

my-ai-app/
├── .env.example          # 環境變數範本
├── .gitignore            # 沒有就建立;已有則 append
└── sdk/
    ├── python/           # Python SDK (config / transport / client / factory)
    │   ├── pyproject.toml
    │   ├── src/ai_client/
    │   ├── examples/
    │   └── tests/
    └── node/             # Node.js SDK (config / transport / client / factory)
        ├── package.json
        ├── tsconfig.json
        └── src/

3. 執行與測試

Python:

cd my-ai-app/sdk/python
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dotenv]"
ai-ask "用一句話說明什麼是產銷履歷"

Node.js:

cd my-ai-app/sdk/node
npm install && npm run build
npm run example

直接詢問 (根目錄):

cd my-ai-app
# 請先在 .env 填入 VLLM_API_KEY
ai-forge ask "用一句話說明什麼是產銷履歷"

4. prompt

把下面整段貼給 AI agent,讓它用 ai-forge CLI 建制,而不是手刻 client。

用 AI-Forge CLI 在本專案建制標準化 AI client,不要手寫 SDK。

1. 確認已安裝 `ai-forge`(`ai-forge --version`)。沒有就執行:
   npm install -g ai-forge
2. 在目標目錄執行(不要提問、寫入目前目錄):
   ai-forge init . --yes --lang python
   不要加 --model / --base-url,用 CLI 預設即可(Gemma4-31B、https://chatapi.ntubimdbirc.tw/v1)。
   只要 Node:`--lang node`;兩種都要:省略 --lang,或 `--lang python,node`。
3. 遵守 CLI 行為:
   - 只產生 sdk/、.env.example、.gitignore;已有檔案就 skip,缺的才補。不要用 --force,除非我明確要求覆寫 SDK。
   - 不要建立或改寫 README.md
   - .env 已存在就不要覆蓋既有值;缺的 VLLM_API_KEY / VLLM_BASE_URL / VLLM_MODEL 才 append
4. 在 .env 填入 VLLM_API_KEY(不要把金鑰寫進 git 或 README)。
5. 建制完成後用 CLI 驗證,不要自己實作 HTTP client:
   ai-forge ask "用一句話說明什麼是產銷履歷"

🧩 核心設計與 API

簡潔的介面

不論使用哪種語言,你 90% 的時間只需要這兩個步驟:

  1. create_client() / createClient() $\rightarrow$ 從環境變數讀取設定並實例化。
  2. client.complete(prompt, max_tokens) $\rightarrow$ 發送請求並獲取回應。

依賴注入 (Dependency Injection)

AI-Forge 採用解耦設計,讓你可以輕鬆替換底層實作:

  • 換模型 $\rightarrow$ 傳入新的 AIConfig
  • 換傳輸層 $\rightarrow$ 實作新的 Transport (例如從 HTTP 換成 WebSocket)。
  • 做測試 $\rightarrow$ 注入 MockTransport 避免消耗 Token。
# Python 範例:注入 MockTransport
from ai_client import AIClient, AIConfig, ChatResponse

config = AIConfig(api_key="sk-...", model="Gemma4-31B")
class MockTransport:
    def chat(self, **kwargs):
        return ChatResponse(content="這是測試回應")

client = AIClient(config=config, transport=MockTransport())

⚙️ 環境配置

請在 .env 檔案中設定以下參數:

| 變數 | 預設值 | 用途 | | :--- | :--- | :--- | | VLLM_API_KEY | (必填) | 你的 API 授權金鑰 | | VLLM_BASE_URL | https://chatapi.ntubimdbirc.tw/v1 | OpenAI 相容端點 | | VLLM_MODEL | Gemma4-31B | 指定使用的模型名稱 |


🛠️ 開發與貢獻

如果你想修改 AI-Forge 的產生邏輯:

git clone https://gitlab.ntubimdbirc.tw/birc-backend/AI-Forge.git
cd AI-Forge
npm install
node bin/ai-forge.js --help

💡 提示:修改 templates/ 目錄下的檔案,將直接影響 init 指令產出的專案內容。


📄 License

MIT