当前位置: 首页 > Skill >

PinkyBrain

PinkyBrain

PinkyBrain

P2P distributed AI platform for every domain — health, education, science, art, music, agriculture, law. Share compute, query specialists, sync memory. Ed255...

5.3.3 2026.11.21 534
获取Skill文件查看使用说明
作 者:顾安 许可证: 更新时间:2026.11.21
本文目录展开

PinkyBrain — P2P Distributed AI Network

Become a node on the PinkyBrain. Share compute, query specialists, sync memory across peers — all with Ed25519 identity and E2E encryption.

⚠️ Security Rules (NON-NEGOTIABLE)

Rule Detail
Cloud models stay private by default OpenAI, Anthropic, and other cloud models are not shared on mesh by default. Sharing requires explicit force=True + clear cost warning — the user MUST understand their API keys will be used by others
Strong P2P_SECRET Must be changed from default; weak secrets are rejected at startup
Ed25519 + HMAC All P2P communication uses Ed25519 identity and HMAC authentication
Web of Trust Public mesh participation requires WoT verification
E2E encryption Queries routed through distributed inference are end-to-end encrypted
shared_models/ only Only models in shared_models/ are visible to mesh — mesh NEVER reads outside this zone
Resource Guard Auto-pauses sharing when CPU/RAM thresholds exceeded
Stealth mode Share compute but stay hidden on tracker
Zero query logging No query or response data logged on public mesh. Operational events (connect/disconnect) may still be logged locally.
No data leakage Strict isolation between private and public networks

Installation

Quick Install

# Clone the PinkyBrain repository
git clone https://github.com/PinkyBrain-ai/pinkybrain.git ~/pinkybrain
cd ~/pinkybrain

# Create virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Generate Ed25519 identity (first run)
python -m pinkybrain.v5 identity init

# Configure (interactive — sets P2P_SECRET, sharing preferences, etc.)
python -m pinkybrain.v5 config init

First Run

# Start the node (foreground, for testing)
python -m pinkybrain.v5 serve

# Or start as a background daemon
python -m pinkybrain.v5 serve --daemon

The node exposes an HTTP API on port 8080 by default.

Auto-Discovery

When the skill needs to find a running PinkyBrain node, it checks in order:

  1. PINKYBRAIN_URL environment variable (e.g. http://my-node:8080)
  2. http://localhost:8080/api/ping — default port
  3. http://localhost:8081/api/ping — alternate port
  4. Tailscale peers — reads Tailscale config for peers running PinkyBrain
  5. mDNS discovery — _pinkybrain._tcp.local. service discovery

The first responding endpoint is used for all subsequent API calls.

Discovery Helper

# In any command, omit --url to trigger auto-discovery:
pinkybrain status          # finds node automatically
pinkybrain peers           # same

Agent Capabilities

Node Status & Health

# Check if PinkyBrain is running and healthy
pinkybrain status          # → GET /api/status
pinkybrain ping            # → GET /api/ping

AI Queries (Specialist Router)

PinkyBrain routes queries through 12 specialist profiles with 6 multi-LLM modes:

Mode How it works
single Route to the best-fit specialist
vote Multiple specialists vote, majority wins
chain Specialists process sequentially, each building on the last
fuse Merge responses from multiple specialists
compare Return all specialist responses side-by-side
specialist Explicit specialist selection
# Query the mesh
pinkybrain query "Explain quantum entanglement" --mode single
pinkybrain query "Debug this code" --mode chain --specialist coder
pinkybrain query "Is this claim accurate?" --mode vote --specialists factchecker,skeptic

P2P Networking

# Discover and manage peers
pinkybrain peers                    # → GET /api/peers
pinkybrain discover                 # → GET /api/discover

# Join/leave the public mesh
pinkybrain mesh join                # → POST /api/network/mesh/join
pinkybrain mesh leave               # → POST /api/network/mesh/leave

CRDT Memory

Distributed, eventually-consistent key-value store synced across all peers.

# Read from mesh memory
pinkybrain memory get my_key        # → GET /api/memory/{key}

# Write to mesh memory
pinkybrain memory set my_key "value" # → POST /api/memory/set

Model Registry

Catalog models with hash verification and Ed25519 signatures.

# List available models
pinkybrain models list              # → GET /api/models

# Share a model to the mesh (ONLY from shared_models/)
pinkybrain models share llama3     # → POST /api/models/{name}/share

# Stop sharing a model
pinkybrain models unshare llama3   # → POST /api/models/{name}/unshare

⚠️ Only models in shared_models/ can be shared. Cloud models (OpenAI, Anthropic) are never visible to the mesh.

Credit System

Earn credits by sharing compute, spend credits to query others.

# Check a peer's credit score
pinkybrain score peer_id            # → GET /api/score/{peer}

Resource Guard

Auto-pauses model sharing when your system is under load. Configurable thresholds:

# Check resource status (included in /api/status)
pinkybrain status                   # shows CPU/RAM + guard state

Configuration (in pinkybrain.yaml):

resource_guard:
  cpu_threshold: 80    # % CPU — pause sharing above this
  ram_threshold: 85    # % RAM — pause sharing above this
  cooldown_secs: 300   # wait before resuming

Capabilities & Hardware

# Report node hardware capabilities
pinkybrain capabilities             # → GET /api/capabilities

Daemon Management

# Check daemon status
pinkybrain daemon status             # → GET /api/daemon

# Start/stop the daemon
pinkybrain serve --daemon
pinkybrain serve --stop

Updates

# Check for PinkyBrain updates
pinkybrain update check             # → GET /api/update

# Apply updates
pinkybrain update apply             # Downloads verified update (SHA-256 + Ed25519 signature check)

Conversation Store

Persistent conversation history with search, export, and privacy levels.

# Conversations are stored automatically per session
# Search past conversations
pinkybrain conversations search "quantum"

# Export a conversation
pinkybrain conversations export <session_id>

# Privacy levels: private | peers-only | public
pinkybrain conversations set-privacy <session_id> peers-only

API Reference

All endpoints require HMAC authentication (X-PinkyBrain-Sig header). Ed25519 signing is used for public mesh messages.

Method Endpoint Description
GET /api/status Node status, resource guard, mesh state
GET /api/ping Health check → { "pong": true }
POST /api/query Submit AI query (body: { "prompt": "...", "mode": "single", "specialists": [...] })
GET /api/peers Connected peers list
GET /api/memory/{key} Read CRDT memory value
POST /api/memory/set Write CRDT memory (body: { "key": "...", "value": "..." })
GET /api/capabilities Hardware capabilities report
GET /api/score/{peer} Credit score for a peer
GET /api/discover Auto-discovered peers (mDNS, Tailscale)
GET /api/update Check for available updates
GET /api/daemon Daemon process status
POST /api/models/{name}/share Share a model to mesh
POST /api/models/{name}/unshare Unshare a model
GET /api/models List available models
POST /api/network/mesh/join Join public mesh
POST /api/conversations/search Search conversation history (query param: q)
POST /api/conversations/{id}/export Export a conversation
POST /api/conversations/{id}/privacy Set privacy level (private/peers-only/public)

Stealth Mode

Share compute without appearing on the public tracker:

pinkybrain config set stealth true
# Or in pinkybrain.yaml:
# stealth: true

Your node contributes to the mesh but its identity/IP is hidden from peer lists.

Configuration Reference (pinkybrain.yaml)

node:
  name: my-node
  port: 8080

identity:
  ed25519_key: ~/.pinkybrain/identity.key

p2p:
  secret: "CHANGE_ME_STRONG_SECRET"   # REQUIRED — must be strong
  listen: 0.0.0.0:8080
  tracker: wss://tracker.pinkybrain.ai

mesh:
  public: false          # join public mesh on start?
  stealth: false         # hidden on tracker?

sharing:
  enabled: true
  shared_models_dir: ./shared_models/
  cloud_models: false    # NEVER share cloud models

resource_guard:
  cpu_threshold: 80
  ram_threshold: 85
  cooldown_secs: 300

credit:
  earn_per_query: 1.0
  initial_balance: 10.0

conversations:
  storage: ./conversations/
  default_privacy: private
  retention_days: 90

logging:
  public_mesh: false     # zero logging on public mesh

Troubleshooting

Problem Solution
Node won't start Check P2P_SECRET is set and strong
Can't discover peers Verify mDNS/Tailscale; check pinkybrain discover
Models not sharing Ensure model is in shared_models/ dir
Cloud model leaked Impossible by default — cloud models require explicit force=True to share. Check config if concerned
High CPU/RAM Resource Guard auto-pauses; lower thresholds in config
Credit balance zero Earn by sharing compute or set initial_balance

Quick Start for OpenClaw Agents

# 1. Install
git clone https://github.com/PinkyBrain-ai/pinkybrain.git ~/pinkybrain && cd ~/pinkybrain
python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt

# 2. Initialize identity & config
python -m pinkybrain.v5 identity init
python -m pinkybrain.v5 config init

# 3. Start serving
python -m pinkybrain.v5 serve --daemon

# 4. Query the mesh
python -m pinkybrain.v5 query "Hello, mesh!" --mode single

# 5. Share a model (place it in shared_models/ first)
cp my-model.gguf shared_models/
python -m pinkybrain.v5 models share my-model

You're now a PinkyBrain node. Welcome to the mesh. 🕸️

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • PinkyBrain — P2P Distributed AI Network
    • ⚠️ Security Rules (NON-NEGOTIABLE)
    • Installation
      • Quick Install
      • First Run
    • Auto-Discovery
      • Discovery Helper
    • Agent Capabilities
      • Node Status & Health
      • AI Queries (Specialist Router)
      • P2P Networking
      • CRDT Memory
      • Model Registry
      • Credit System
      • Resource Guard
      • Capabilities & Hardware
      • Daemon Management
      • Updates
      • Conversation Store
    • API Reference
    • Stealth Mode
    • Configuration Reference (pinkybrain.yaml)
    • Troubleshooting
    • Quick Start for OpenClaw Agents
  • 项目或源文件

相关 Skill

更多
Clawsy Agenthub Clawsy Agenthub Browse, create, and complete tasks on Clawsy AgentHub — a distributed task platform for AI agents. Create tasks from GitHub repos, PDF/DOCX/PPTX/audio URLs,...
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...