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

079project

v9.1.0

Published

a matrix based ai that can performance well in little source of words,which use little resources.its startpoint initialize it and you can start it as the description in readme.md

Readme

079Project

一个实验型 AI 项目:把“图谱推理 + 学习模块 + 网关 API + 前端控制台 + 身份系统”组合在同一仓库内运行。

当前架构已拆分为 两个 Node 进程

  • 主 AI 进程main.cjs(只提供 /api/*,默认需要 Token)
  • 身份 + 前端进程auth_frontend_server.cjs(提供 /auth/*,并托管 React build;同时把 /api/* 反代到主 AI)

说明:仓库仍处实验阶段,接口/行为可能调整。


目录结构(关键)

  • main.cjs:主 AI 进程(图谱运行时、SparkArray、多控制器池、MemeBarrier、RL/ADV 学习、快照与导出、/api 路由)。
  • auth_frontend_server.cjs:身份系统 + 前端托管进程(SQLite 用户/会话、JWT、/auth 路由、/api 反代)。
  • 079project_frontend/:React 前端(Chat + Config 控制台)。
  • robots/:机器人语料(TXT)。
  • tests/:测试用例/词表(TXT,可运行时新增并刷新到 RL 模块)。
  • snapshots/:快照目录。
  • runtime_store/:运行时缓存/导出目录;默认也会生成 runtime_store/auth.sqlite
  • lmdb/:LMDB 数据目录(如不可用会回落 JSON 存储)。

环境要求

  • Windows + PowerShell(本仓库默认命令以 pwsh.exe 为准)。
  • Node.js >= 18(建议 LTS)。

安装

后端依赖:

cd "079Project/"
npm install

前端依赖:

cd "079Project/079project_frontend"
npm install

启动(两进程)

端口默认值:

  • 主 AI:127.0.0.1:5080
  • 身份 + 前端:127.0.0.1:5081

注意,在所有的启动之前,必须要先启动一个redis服务器

模式 A:推荐(身份+前端托管 + /api 反代)

  1. 启动主 AI(只提供 /api/*):
cd "079Project/"
$env:AI_AUTH_ENABLED="true"
$env:AI_AUTH_JWT_SECRET="change-me"
node .\main.cjs

如果你需要启用“性能/并发实验功能”(--group-proc/--infer-mp/--single-proc),请改用:

node .\mainFailedOfJing1Xi4Hua4Zhi4Duan3Yu3.cjs
  1. 启动身份服务 + 前端托管(同时反代 /api/* 到主 AI):
cd "079Project/"
$env:AUTH_JWT_SECRET="change-me"
$env:AI_API_BASE="http://127.0.0.1:5080"
node .\auth_frontend_server.cjs
  1. 浏览器访问:
  • http://127.0.0.1:5081/

首次启动需要在页面中选择“首次启动?去初始化”,创建管理员账号(只允许一次)。

注意:AUTH_JWT_SECRETAI_AUTH_JWT_SECRET 必须一致,否则 Token 无法被主 AI 验证。

模式 B:纯前端开发(可选)

前端开发服务器(CRA)默认使用 079project_frontend/package.jsonproxy。 如果你仍使用该模式,建议把 proxy 改为 http://127.0.0.1:5081(让 /api/* 通过身份进程反代,避免跨域与 Token 问题)。

启动命令:

cd "079Project/079project_frontend"
npm start

浏览器访问 CRA 提示的地址即可。

模式 C:生产(构建前端 + 身份进程托管 build)

  1. 构建前端:
cd "079Project/079project_frontend"
npm run build
  1. 启动主 AI:
cd "079Project/"
$env:AI_AUTH_ENABLED="true"
$env:AI_AUTH_JWT_SECRET="change-me"
node .\main.cjs
  1. 启动身份服务 + 前端托管:
cd "079Project/"
$env:AUTH_JWT_SECRET="change-me"
$env:AI_API_BASE="http://127.0.0.1:5080"
node .\auth_frontend_server.cjs

浏览器访问:http://127.0.0.1:5081/


启动方式速查(按场景)

说明:

  • main.cjs:偏“传统单进程”入口(稳定/默认)。
  • mainFailedOfJing1Xi4Hua4Zhi4Duan3Yu3.cjs:包含并发实验开关(--group-proc/--infer-mp/--single-proc)的入口。

场景 1:最简本地调试(单进程 + 免鉴权 + 快速启动)

cd "079Project/"
$env:AI_AUTH_ENABLED="false"
$env:AI_ROBOTS_AUTOLOAD="false"
node .\mainFailedOfJing1Xi4Hua4Zhi4Duan3Yu3.cjs --single-proc=true --robots-autoload=false --tests-autoload=false --port=5080

场景 2:推荐日常使用(两进程:身份/前端托管 + API 反代)

主 AI:

cd "079Project/"
$env:AI_AUTH_ENABLED="true"
$env:AI_AUTH_JWT_SECRET="change-me"
node .\main.cjs --port=5080

身份 + 前端:

cd "079Project/"
$env:AUTH_JWT_SECRET="change-me"
$env:AI_API_BASE="http://127.0.0.1:5080"
node .\auth_frontend_server.cjs

场景 3:强制单进程(避免多进程导致变慢/更稳定)

当你发现多进程模式在当前机器/当前负载下反而更慢,使用:

cd "079Project/"
node .\mainFailedOfJing1Xi4Hua4Zhi4Duan3Yu3.cjs --single-proc=true --port=5080

说明:--single-proc=true 会强制关闭 --group-proc--infer-mp

场景 4:多核吞吐(每个 group 一个进程)

适用于并发请求较多、单次请求较重、且 CPU 核数充足的机器;如果请求很轻或 IPC 开销占比过高,可能“更慢”。

cd "079Project/"
$env:AI_AUTH_ENABLED="false"
node .\mainFailedOfJing1Xi4Hua4Zhi4Duan3Yu3.cjs --group-proc=true --group-count=6 --group-size=3 --port=5080

场景 5:多核加速(推理多进程池,仅用于 Spark 汇聚的 respond 分发)

适用于不启用 group-proc 的情况下,想让 SparkArray/BigSparkArray 的分发利用多核:

cd "079Project/"
node .\mainFailedOfJing1Xi4Hua4Zhi4Duan3Yu3.cjs --infer-mp=true --infer-workers=6 --port=5080

说明:启用 group-proc 时会自动禁用 infer-mp(避免双层多进程)。


后端启动参数(常用)

main.cjs 支持部分 CLI/环境变量(这里只列近期常用的):

  • --gateway-host / AI_GATEWAY_HOST:网关监听地址(默认 127.0.0.1)。
  • --port / CONTROLLER_PORT:网关端口(默认 5080)。
  • --disable-memebarrier:启动时禁用 MemeBarrier(仍可运行时通过 API 重新开启)。
  • --disable-learning:启动时禁用学习模块(仍可运行时通过 API 重新开启)。
  • --disable-rl:启动时禁用 RL(仍可运行时通过 API 重新开启)。
  • --disable-adv:启动时禁用 ADV(仍可运行时通过 API 重新开启)。
  • --export-dir / AI_EXPORT_DIR/api/export/graph 默认导出目录。

示例:监听 0.0.0.0:5080

node .\main.cjs --gateway-host=0.0.0.0 --port=5080

mainFailedOfJing1Xi4Hua4Zhi4Duan3Yu3.cjs 额外支持(并发/性能实验):

  • --single-proc / AI_SINGLE_PROC:强制单进程(关闭 group-procinfer-mp)。
  • --group-proc / AI_GROUP_PROC:每个 group 一个进程。
  • --group-proc-timeout-ms / AI_GROUP_PROC_TIMEOUT_MS:group RPC 超时。
  • --infer-mp / AI_INFER_MP:推理多进程池(仅分发 Spark 汇聚推理)。
  • --infer-workers / AI_INFER_WORKERS:推理子进程数量。

身份系统(SQLite + JWT)

身份系统存储:默认 079Project/runtime_store/auth.sqlite

环境变量(auth_frontend_server.cjs):

  • AUTH_PORT:默认 5081
  • AUTH_HOST:默认 127.0.0.1
  • AUTH_DB_PATH:默认 079Project/runtime_store/auth.sqlite
  • AUTH_JWT_SECRET:JWT 密钥(必须与主 AI 的 AI_AUTH_JWT_SECRET 一致)
  • AI_API_BASE:主 AI 地址(默认 http://127.0.0.1:5080

环境变量(main.cjs):

  • AI_AUTH_ENABLED:默认开启(设为 false 可临时关闭鉴权)
  • AI_AUTH_JWT_SECRET:用于验证 Token

前端功能

左侧栏:

  • Chat:基础对话。
  • Config:运行时开关与运维面板(MemeBarrier / RL / ADV、阈值、tests 刷新、robots 重训)。

HTTP API(精选)

Chat

  • POST /api/chat:单模型聊天。
  • POST /api/array/chat:SparkArray 多 AI/多层调度聊天。

运行时开关(Config 页使用)

  • GET /api/runtime/features:读取当前开关状态与对话触发阈值。
  • PATCH /api/runtime/features:运行时修改开关/阈值。
    • 例:{ "rlEnabled": true, "advEnabled": true, "memebarrierEnabled": true, "rlEvery": 20, "advEvery": 30 }

MemeBarrier

  • POST /api/memebarrier/start
  • POST /api/memebarrier/stop
  • GET /api/memebarrier/stats

学习模块

  • POST /api/learn/reinforce / GET /api/learn/reinforce/latest
  • POST /api/learn/adversarial / GET /api/learn/adversarial/latest
  • POST /api/learn/thresholds(对话触发频率)

Tests(运行时新增与刷新)

  • GET /api/tests/list:列出 tests/*.txt
  • POST /api/tests/case:写入/覆盖一个测试用例文件
    • 请求:{ "name": "case_001", "content": "..." }
  • POST /api/tests/refresh:刷新 RL 的 tests 词表(必要时会重建 RL 实例指向 tests/

Robots(运行时重训/重新 ingest)

  • GET /robots/list
  • POST /robots/ingest
  • POST /api/robots/retrain:运行时触发 robots 语料重新 ingest(可选 enqueueStudy)
    • 请求示例:{ "limit": 50, "shuffle": true, "files": ["wikitext-something.txt"], "enqueueStudy": true }

导出(供 Go 等外部分析)

  • POST /api/export/graph:导出当前窗口图为 JSON 文件,并返回 content 便于直接复制。

快照/系统

  • GET /api/snapshots / POST /api/snapshots/create / POST /api/snapshots/restore/:id / DELETE /api/snapshots/:id
  • GET /api/system/status
  • GET /api/shards

常见问题

1) 访问 5080/ 看不到 UI?

这是预期行为:UI 已迁移到身份+前端进程(默认 http://127.0.0.1:5081/)。

2) LMDB 打不开

日志出现回落提示时会自动改用 JSON 存储,仍可运行;若要启用 LMDB,请检查目录权限与依赖环境。


许可证

LGPL-3.0(见 LICENSE)。