Instructions to use ninacatcoin/nina-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ninacatcoin/nina-model with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ninacatcoin/nina-model", filename="nina-3b-nina-ft-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ninacatcoin/nina-model with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ninacatcoin/nina-model:Q4_K_M # Run inference directly in the terminal: llama cli -hf ninacatcoin/nina-model:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ninacatcoin/nina-model:Q4_K_M # Run inference directly in the terminal: llama cli -hf ninacatcoin/nina-model:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ninacatcoin/nina-model:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ninacatcoin/nina-model:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ninacatcoin/nina-model:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ninacatcoin/nina-model:Q4_K_M
Use Docker
docker model run hf.co/ninacatcoin/nina-model:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ninacatcoin/nina-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ninacatcoin/nina-model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ninacatcoin/nina-model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ninacatcoin/nina-model:Q4_K_M
- Ollama
How to use ninacatcoin/nina-model with Ollama:
ollama run hf.co/ninacatcoin/nina-model:Q4_K_M
- Unsloth Studio
How to use ninacatcoin/nina-model with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ninacatcoin/nina-model to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ninacatcoin/nina-model to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ninacatcoin/nina-model to start chatting
- Pi
How to use ninacatcoin/nina-model with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ninacatcoin/nina-model:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ninacatcoin/nina-model:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ninacatcoin/nina-model with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ninacatcoin/nina-model:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default ninacatcoin/nina-model:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use ninacatcoin/nina-model with Docker Model Runner:
docker model run hf.co/ninacatcoin/nina-model:Q4_K_M
- Lemonade
How to use ninacatcoin/nina-model with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ninacatcoin/nina-model:Q4_K_M
Run and chat with the model
lemonade run user.nina-model-Q4_K_M
List all available models
lemonade list
- NINA โ NinaCatCoin AI Model (v3)
- How it works
- Complete NINA AI System (34 modules)
- Core Intelligence (LLM + Decision Engine)
- Safety & Constitution
- Network Security (Tier 1-2)
- Governance & Tuning (Tier 3)
- Explainability & Transparency (Tier 4)
- Learning & Adaptation (Tier 5)
- Human Collaboration (Tier 6)
- Privacy Enhancement
- Transaction & Mempool Intelligence
- Network Optimization
- Persistence & Auditability
- Data Collection & Auto-Update
- Orchestration
- Model Details
- Integration Architecture
- Training Data
- Download & Usage
- Safety
- Limitations
- Links
- Version History
- How it works
NINA โ NinaCatCoin AI Model (v3)
NINA (NinaCatCoin Intelligent Node Assistant) is a fine-tuned Llama 3.2 3B model that runs directly inside the NinaCatCoin daemon binary. The daemon links against libllama (llama.cpp) at compile time, loads the GGUF model into RAM, and performs inference in-process โ no external server, no HTTP, no child process.
NINA is the central intelligence of a 34-module AI system embedded in the daemon, organized in 6 tiers of autonomous learning and decision-making.
How it works
- On startup, the daemon downloads the GGUF model (if missing) and verifies its SHA-256 hash.
- It calls
llama_model_load_from_file()to load the model into RAM (~2 GB). - During operation, the
NinaLLMEnginetokenizes events, runsllama_decode()+llama_sampler_sample()in-process, and parses the output. - For consensus-critical decisions, it uses greedy sampling (temp=0.0) so every node produces the same output.
- The model is linked into the daemon binary via
libllamaandlibggml(linked at build time).
// From src/daemon/CMakeLists.txt:
target_link_libraries(daemon PRIVATE ... llama ggml ...)
// From src/daemon/nina_llm_engine.cpp:
#include "llama.h"
m_model = llama_model_load_from_file(path, params);
m_ctx = llama_init_from_model(m_model, ctx_params);
llama_token t = llama_sampler_sample(m_sampler, m_ctx, -1);
Complete NINA AI System (34 modules)
Core Intelligence (LLM + Decision Engine)
| Module | What it does |
|---|---|
| NinaLLMEngine | Loads and runs this GGUF model in-process via llama.cpp C API. Three modes: active (always in RAM), lazy (load on demand), disabled (embedded ML only). |
| NinaDecisionEngine | The "brain" โ evaluates network events and decides actions via the LLM. Pipeline: NinaEvent โ evaluate() โ vector<NinaAction>. Uses temp=0.0 (greedy) for deterministic consensus. Rare events go to LLM; frequent events go to embedded ML. |
| NinaLLMBridge | Connects all existing NINA modules to the LLM. Methods like enhance_* take module output and return LLM-enriched versions. Non-blocking: if LLM unavailable, modules work as before. |
| NinaLLMFirewall | Hardcoded security filter for all LLM I/O. Blocks prompt injection attacks on input. Sanitizes output to strip wallet addresses, private keys, transfer instructions. No config, no bypass โ only recompilation. |
Safety & Constitution
| Module | What it does |
|---|---|
| NinaConstitution | Immutable governance constraints enforced at compile time via static_assert. Article 0: NINA cannot create/sign transactions, access wallets, or move funds. Also: no censorship, no history rewrite, user autonomy always respected. |
| NinaModelValidator | Validates GGUF model integrity via SHA-256 hash at startup. Chunk-based hashing (4 MB). Sanity checks file size. Hash injected into coinbase tag 0xCA. |
| NinaModelDownloader | Auto-downloads the model on first run using libcurl with resume support, retries (up to 3), and progress display. Primary: HuggingFace. Fallback: GitHub Releases. Atomic rename after validation. |
Network Security (Tier 1-2)
| Module | What it does |
|---|---|
| NinaNodeProtector | Immune system โ detects, isolates, diagnoses, recovers, and reintegrates attacked nodes. State machine: HEALTHY โ UNDER_ATTACK โ ISOLATED โ RECOVERING โ REINTEGRATING. Handles: Sybil flood, output poisoning, eclipse, difficulty manipulation, mempool flood, block withholding. |
| NinaSybilDetector | Identifies coordinated Sybil peers via temporal correlation, latency analysis, response timing, and block propagation patterns. Clusters statistically similar peers and flags excessive correlation. |
| NinaSpyCountermeasures | Active countermeasures against spy nodes (based on "Friend or Foe" 2025 paper). 5 techniques: selective TX relay, delayed relay, peer list cloaking, spy-aware Dandelion++ routing, coordinated banning. Destroys timing analysis. |
| NinaNetworkHealthMonitor | Monitors network condition: latency, connectivity, orphaned blocks, reorgs, propagation, throughput, hashrate. Diagnoses: OPTIMAL / DEGRADED / STRESSED / CRITICAL. Produces trust score 0.0โ1.0. |
Governance & Tuning (Tier 3)
| Module | What it does |
|---|---|
| NinaGovernanceEngine | Generates governance proposals with justification, expected impact, and affected systems. Status tracking: PROPOSED โ VOTING โ APPROVED/REJECTED. NINA suggests, humans decide. |
| NinaConsensusTuner | Analyzes network conditions and proposes consensus adjustments with confidence scores and rationale. Continuous monitoring loop with configurable conservatism level (1-5). |
| NinaParameterAdjustor | Dynamic adjustment of: quorum %, block time, difficulty multiplier, pool size, block size limit, peer timeout (10 parameter types total). Each adjustment includes old/new value, confidence, and reason. |
| NinaSuggestionEngine | Generates typed security recommendations (attack mitigation, peer isolation, consensus protection, optimization, hardening). Every suggestion requires human approval. |
Explainability & Transparency (Tier 4)
| Module | What it does |
|---|---|
| NinaExplanationEngine | Every NINA decision is justified and traceable. Generates DecisionExplanation with reasoning, evidence, constraints applied, and escalation level. Builds trust through total transparency. |
Learning & Adaptation (Tier 5)
| Module | What it does |
|---|---|
| NinaAdaptiveLearning | Tracks attack patterns with feature vectors, confidence, and threat levels. Generates predictions about future network conditions with accuracy tracking. Learns progressively while maintaining constitutional alignment. |
| NinaLearningModule | Statistical learning: metrics with running mean, variance, std deviation, min/max, sample count. Statistical anomaly detection with configurable thresholds. Serializable for LMDB persistence. |
| NinaMemorySystem | Long-term memory for attack patterns and peer behavior. AttackPattern: name, occurrences, confidence, severity, first/last seen. PeerBehavior: IP, interactions, suspicion count, reputation score. |
Human Collaboration (Tier 6)
| Module | What it does |
|---|---|
| NinaHumanCollaboration | Human-AI interface for critical decisions. EscalationRequest with options, NINA's recommendation, and urgency level. Callback-based: registers handlers for human input. Blocks until response on critical issues. |
Privacy Enhancement
| Module | What it does |
|---|---|
| NinaRingEnhancer | Intelligent decoy selection for ring signatures. Adaptive Spending Model (ASM) replaces static gamma distribution. Ring Quality Score (RQS) 0.0โ1.0; wallet retries if below threshold. Poison avoidance and cross-TX independence. |
| NinaRingController | Active ring parameter control post-v18. Threat-based sizing: NORMALโ16, ELEVATEDโ21, HIGHโ26, CRITICALโ31 ring members. Deterministic across nodes via blockchain inputs; verified via coinbase tag 0xCB. |
Transaction & Mempool Intelligence
| Module | What it does |
|---|---|
| NinaSmartMempool | Intelligent mempool analysis: priority scoring (fee/byte), spam vs legitimate bot detection, health monitoring, source reputation tracking. Never rejects transactions โ only re-orders priority. |
Network Optimization
| Module | What it does |
|---|---|
| NinaNetworkOptimizer | Intelligent P2P connection management. Peer quality scoring (latency, reliability, version, chain height). Auto-adjusts peer count based on available bandwidth. Prioritizes full-chain nodes during sync. |
Persistence & Auditability
| Module | What it does |
|---|---|
| NinaPersistenceEngine | Long-term storage: DecisionRecord, GovernanceProposalRecord, LearningPatternRecord. On-chain support post-v18 via BlockchainDB. Full audit trail (timestamp, reasoning, evidence, outcome). |
| NinaPersistentMemory | ACID-compliant LMDB storage, crash-safe. Dual-mode: pre-v18 โ separate LMDB in ~/.ninacatcoin/nina_state/; post-v18 โ blockchain's data.mdb. Auto-routes to correct backend by height. |
| NinaPersistenceAPI | Simplified high-level API: log_block_validation_decision(), log_checkpoint_validation_decision(). Creates complete DecisionRecord with evidence, reasoning, confidence. |
Data Collection & Auto-Update
| Module | What it does |
|---|---|
| NinaBlockDataLogger | Logs real block data to CSV for ML training: height, timestamp, solve_time, difficulty, tx_count, block_size. Output: ~/.ninacatcoin/ml_training_data.csv. Thread-safe append. |
| NinaIAAutoUpdate | Autonomous daemon updates: monitors GitHub, classifies changes (hard fork, security fix, performance), decides when to update (immediate/scheduled/pre-fork), compiles, installs, and restarts without human intervention. |
Orchestration
| Module | What it does |
|---|---|
| NinaAdvancedInline | Main entry point โ creates global g_nina_advanced_ai coordinator at daemon startup. Includes and orchestrates all 6 tiers. Handles model download and all subsystem initialization. |
| NinaAdvancedService | Integration example showing how the 6 tiers work together. Feeds block data to modules, queries network intelligence, sends alerts to Discord. |
| NinaCompleteEvolution | Unified framework orchestrating all 6 tiers. Tracks: predictions accuracy, anomalies detected, attacks prevented, governance proposals, human escalations. |
| NinaMLClient | C++ client communicating with Python ML service via JSON/TCP sockets. Phase 1: block validation, Phase 2: LWMA difficulty, Phase 3: Sybil detection, Phase 4: gas optimization. |
Model Details
| Field | Value |
|---|---|
| Base model | Llama-3.2-3B-Instruct (via unsloth) |
| Fine-tuning | QLoRA r=32, alpha=64, dropout=0.05, 7 target modules |
| Epochs | 3 (1,419 steps) |
| Dataset | 3,980 blockchain-specific Q&A pairs (multilingual: EN/ES/FR/DE/PT) |
| Quantization | Q4_K_M (4.5 bits per weight) |
| File size | 1.89 GB (2,030,731,360 bytes) |
| SHA-256 | 416ef260f5f2607d990c92c5517ef0cf60a3e296c02421e4fba8ff34385e7438 |
| Training date | 2026-03-11 |
| Training hardware | NVIDIA GTX 1080 Ti (11 GB VRAM) |
| Training time | 2h 43min |
| Final training loss | 0.5416 |
| Final token accuracy | 89.0% |
| Eval loss | 0.7032 |
Integration Architecture
ninacatcoind (single binary, ~34 AI modules compiled in)
โ
โโ Blockchain Core (validation, sync, consensus)
โโ P2P Network (peer management, Dandelion++)
โ
โโ NINA AI System (in-process, 6 tiers)
โ
โโ NinaLLMEngine โ libllama + libggml (linked at build time)
โ โโ nina_model.gguf (loaded into RAM at startup)
โ
โโ NinaDecisionEngine (event โ LLM โ action)
โโ NinaLLMFirewall (I/O security filter)
โโ NinaConstitution (compile-time safety)
โ
โโ TIER 1-2: Security
โ โโ NinaNodeProtector (immune system)
โ โโ NinaSybilDetector (coordinated peer detection)
โ โโ NinaSpyCountermeasures (anti-surveillance)
โ โโ NinaNetworkHealthMonitor (diagnostics)
โ
โโ TIER 3: Governance
โ โโ NinaGovernanceEngine (proposals)
โ โโ NinaConsensusTuner (dynamic adjustment)
โ โโ NinaParameterAdjustor (10 network params)
โ โโ NinaSuggestionEngine (recommendations)
โ
โโ TIER 4: Explainability
โ โโ NinaExplanationEngine (decision justification)
โ
โโ TIER 5: Learning
โ โโ NinaAdaptiveLearning (pattern tracking)
โ โโ NinaLearningModule (statistical anomalies)
โ โโ NinaMemorySystem (attack memory)
โ
โโ TIER 6: Human Collaboration
โ โโ NinaHumanCollaboration (escalation interface)
โ
โโ Privacy: NinaRingEnhancer + NinaRingController
โโ Mempool: NinaSmartMempool
โโ Network: NinaNetworkOptimizer
โโ Persistence: LMDB (pre-v18) / on-chain (post-v18)
โโ Auto-update: NinaIAAutoUpdate (GitHub monitoring)
Training Data
The dataset covers 8 specialized domains built from real NinaCatCoin blockchain telemetry:
- Checkpoint validation โ accept/reject/quarantine logic with real block hashes
- Peer classification โ spy node patterns, Sybil clusters, honest peer profiles
- X2/X200 events โ reward multiplier activation, multi-hash seed evaluation
- Network defense โ eclipse attacks, selfish mining, timestamp attacks
- Mining strategy โ fee optimization, block template decisions
- Protocol rules โ emission curve (900M supply), unlock times, dust thresholds
- Node operations โ sync issues, fork resolution, ban scoring
- General blockchain โ RandomX PoW, CryptoNote privacy, ring signatures
All training examples use the Llama 3 chat template with system/user/assistant turns. Multilingual coverage: English, Spanish, French, German, Portuguese.
Download & Usage
# Download the GGUF
wget https://huggingface.co/ninacatcoin/nina-model/resolve/main/nina-3b-nina-ft-Q4_K_M.gguf
# Place in NinaCatCoin data directory
mv nina-3b-nina-ft-Q4_K_M.gguf ~/.ninacatcoin/nina_model.gguf
# The daemon loads it automatically on startup and validates SHA-256
Safety
The NINA Constitution enforces at compile time (via static_assert) that the model:
- CANNOT create or sign transactions
- CANNOT access wallets or private keys
- CANNOT move funds
- CANNOT output transaction commands
The LLM Firewall filters all input (blocks prompt injection) and all output (strips addresses, keys, transfer instructions). It is hardcoded โ no config, no RPC, no CLI args can disable it.
Limitations
- Optimized exclusively for NinaCatCoin blockchain decisions; not a general-purpose chatbot.
- Requires ~2 GB additional RAM when loaded (Q4_K_M quantization).
- Best results with the specific system prompt used during training (hardcoded in daemon source).
- 3B parameter model โ fast inference on consumer CPU but limited reasoning depth on novel scenarios.
Links
Version History
| Version | Date | Dataset | LoRA | Notes |
|---|---|---|---|---|
| v1.5 | 2026-03-01 | 208 pairs | r64/a128 | Initial release (removed) |
| v2 | 2026-03-02 | 3,074 pairs | r32/a64 | 14.8x more data, optimized LoRA, 34-module integration |
| v3 | 2026-03-11 | 3,980 pairs | r32/a64 | Multilingual (5 langs), 24 JSONL files combined, identity/personality, deep modules, loss 0.54 |
- Downloads last month
- -
4-bit