Downloads · 30 days
21
11% of all-time downloads
kofdai/nullai-phi-4-14b-v2
nullai-phi-4-14b-v2 is a machine learning model from kofdai. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
⚠️ ARCHIVED — Historical / Experimental Project This repository is kept for historical and educational purposes only. What was wrong This project was built on the incorrect assumption that an LLM's reasoning engine an…
Downloads · 30 days
21
11% of all-time downloads
All-time downloads
187
Public
Repo size
29.3 GB
Likes
0
Public
Click a slice to open those files.
.gguf29.3 GB · 100%
From the Hugging Face model README
⚠️ ARCHIVED — Historical / Experimental Project
This repository is kept for historical and educational purposes only.
What was wrong
This project was built on the incorrect assumption that an LLM's reasoning engine and its knowledge structure could be cleanly separated and independently trained as a database. This turned out to be a fundamental misunderstanding of how knowledge and reasoning are entangled in transformer architectures.
What I learned
The failure of this approach directly led to the development of Verantyx — an LLM-free symbolic reasoning engine that takes a completely different path: instead of trying to restructure LLM internals, it builds reasoning from first principles using Cross-structure grammars, atom-based fact extraction, and formal verification.
Current work
- Verantyx V6: github.com/Ag3497120/verantyx-v6 — LLM-free symbolic reasoning engine, scoring on HLE benchmark
- HLE Results: huggingface.co/datasets/kofdai/verantyx-hle-2.6
Do not use this repository as a reference for current architecture. The ideas here were an important step in the exploration, but the approach was wrong. See Verantyx for the updated direction.
🌟 A paradigm shift in AI knowledge management combining spatial memory, expert verification, and multi-stage reasoning with Microsoft's Phi-4 foundation.
→ Launch Dendritic Memory Editor - Create and edit .iath knowledge tiles directly in your browser!
→ Try NullAI Knowledge System on HuggingFace Spaces - Full-stack application with knowledge management interface!
→ Direct App Link - Access the live application instantly!
Perfect for:
No account needed. Start creating immediately.
<a name="english"></a>
NullAI is not just another fine-tuned language model—it's a comprehensive knowledge orchestration system that revolutionizes how AI stores, retrieves, and verifies information across multiple specialized domains.
Unlike traditional LLMs that treat all knowledge uniformly, NullAI implements:
NullAI stores knowledge as structured, self-contained tiles rather than linear text:
class KnowledgeTile:
tile_id: str # Unique identifier
domain: str # medical|legal|programming|science|general
topic: str # Tile subject
content: str # The actual knowledge
coordinates: {
x: float, # Abstraction axis (concrete ← → abstract)
y: float, # Expertise axis (basic ← → advanced)
z: float # Temporality axis (timeless ← → current)
}
certainty_score: float # 0.0 - 1.0 (confidence level)
reasoning_chain: List[Step] # How this knowledge was derived
citations: List[Source] # Evidence and references
orcid_verified: bool # Expert authentication status
expert_id: Optional[str] # ORCID identifier
created_at: datetime
last_verified: datetime
Why "Fallen Tree"? Just as a fallen tree in a forest becomes a foundation for new life, each Knowledge Tile serves as a foundation for building more complex understanding.
Knowledge is organized in a 3-dimensional conceptual space:
Z (Temporality)
↑
| ╱ Universal Facts
| ╱
| ╱______ Latest Research
|╱
O────────→ Y (Expertise)
╱| Basic → Advanced
╱ |
╱ ↓
X (Abstraction)
Concrete → Abstract
How it works:
Example:
Query: "Latest treatment for atrial fibrillation"
→ Maps to: X=0.6 (moderately abstract), Y=0.8 (advanced), Z=0.9 (very recent)
→ Retrieves tiles within radius of 0.2 units
→ Finds: direct oral anticoagulants, catheter ablation, left atrial appendage closure
→ Assembles evidence-based response with reasoning chain
Every answer goes through a three-tier verification process:
def alpha_lobe_verification(reasoning_chain):
"""
Checks basic logical soundness
- No contradictions in premises
- Valid inference steps
- Proper use of quantifiers
- Absence of logical fallacies
"""
checks = {
"contradictions": detect_contradictions(reasoning_chain),
"inference_validity": validate_inference_steps(reasoning_chain),
"fallacies": detect_logical_fallacies(reasoning_chain)
}
return LogicScore(0.0 - 1.0)
def beta_basic_verification(answer, domain):
"""
Verifies domain-specific accuracy
- Terminology correctness
- Standard protocol compliance
- Common practice alignment
- Domain axiom consistency
"""
domain_kb = load_domain_knowledge_base(domain)
checks = {
"terminology": verify_technical_terms(answer, domain_kb),
"protocols": check_standard_protocols(answer, domain),
"axioms": validate_domain_axioms(answer, domain_kb)
}
return DomainConsistencyScore(0.0 - 1.0)
def beta_advanced_verification(answer, meta_knowledge):
"""
Evaluates reasoning depth and quality
- Multi-hop reasoning validity
- Causal chain accuracy
- Edge case consideration
- Alternative perspective analysis
"""
checks = {
"reasoning_depth": analyze_reasoning_depth(answer),
"causal_validity": verify_causal_relationships(answer),
"edge_cases": check_edge_case_coverage(answer),
"alternatives": evaluate_alternative_viewpoints(answer)
}
return ReasoningQualityScore(0.0 - 1.0)
Judge Score Aggregation:
Final Certainty = (
0.3 × Alpha_Score +
0.4 × Beta_Basic_Score +
0.3 × Beta_Advanced_Score
)
NullAI maintains separate, specialized databases for each domain:
NullAI Database Architecture:
├── medical_knowledge.db
│ ├── clinical_guidelines
│ ├── diagnostic_criteria
│ ├── treatment_protocols
│ └── drug_interactions
├── legal_knowledge.db
│ ├── statutes
│ ├── case_law
│ ├── legal_precedents
│ └── regulatory_frameworks
├── programming_knowledge.db
│ ├── algorithms
│ ├── design_patterns
│ ├── best_practices
│ └── language_specifics
├── science_knowledge.db
│ ├── research_methods
│ ├── statistical_techniques
│ ├── experimental_designs
│ └── peer_reviewed_findings
└── general_knowledge.db
├── common_facts
├── general_reasoning
└── cross_domain_connections
Benefits:
NullAI integrates with the ORCID (Open Researcher and Contributor ID) system to verify expert-contributed knowledge:
class ExpertVerification:
def verify_knowledge_tile(self, tile, orcid_id):
"""
Authenticates knowledge against expert credentials
"""
expert = orcid_api.get_researcher(orcid_id)
# Verify expert qualifications
credentials = {
"field_match": expert.field in tile.domain,
"publication_count": len(expert.publications),
"h_index": expert.h_index,
"institutional_affiliation": expert.institution,
"peer_review_score": expert.peer_review_score
}
# Calculate expert authority score
authority_score = calculate_authority(credentials)
# Update tile with verification
tile.orcid_verified = True
tile.expert_id = orcid_id
tile.authority_score = authority_score
tile.expert_credentials = credentials
return VerificationResult(tile, authority_score)
Expert Authority Levels:
Frequently accessed knowledge tiles are kept in a high-speed cache with priority scoring:
cache_priority = (
access_frequency × 0.4 +
certainty_score × 0.3 +
expert_authority × 0.2 +
recency × 0.1
)
Real-time monitoring for knowledge generation:
def detect_hallucination(generated_text, knowledge_tiles):
checks = {
"fact_grounding": all_facts_traced_to_tiles(generated_text),
"citation_validity": all_citations_verified(generated_text),
"confidence_calibration": confidence_matches_evidence(generated_text)
}
if not all(checks.values()):
flag_for_manual_review()
reduce_certainty_score()
Every answer includes a traceable reasoning chain:
Question: "What's the first-line treatment for hypertension?"
Reasoning Chain:
1. [medical_tile_4829] Current JNC-8 guidelines (2014, ORCID-verified)
↓
2. [medical_tile_5103] First-line agents: Thiazides, ACE-I, ARBs, CCBs
↓
3. [medical_tile_6284] Patient-specific factors (age, race, comorbidities)
↓
4. [medical_tile_7451] Evidence: Thiazides reduce CV events by 15-20%
↓
5. [synthesis] Recommendation: Thiazide diuretic (e.g., HCTZ 12.5-25mg)
Certainty: 0.92 (Alpha: 0.95, Beta-Basic: 0.94, Beta-Advanced: 0.88)
Expert Authority: 0.91 (Cardiology, h-index: 47)
Microsoft's Phi-4 achieves state-of-the-art performance in reasoning tasks while maintaining a compact size:
Initial Validation Loss: 2.854
Final Validation Loss: 0.628 (78.0% improvement)
Training Iterations: 2,500
Fine-tuning Method: LoRA (r=16, alpha=32)
Training Time: ~4 hours (Apple Silicon M3 Max)
Peak Memory: 24.2GB
NullAI's architecture enables rapid creation of domain-specific LLMs:
Traditional Approach:
NullAI Approach:
A powerful browser-based tool for creating, editing, and managing .iath knowledge tiles without any installation.
📝 Visual Tile Creation
🎯 3D Coordinate Visualizer
📤 Import/Export .iath Files
🔍 Tile Inspector & Validator
🧪 Testing & Prototyping
| User Type | Use Case |
|---|---|
| Domain Experts | Create verified knowledge tiles without coding |
| Researchers | Document findings with proper citations and ORCID |
| Educators | Build educational content with spatial organization |
| Developers | Prototype tile structures before API integration |
| Learners | Understand the NullAI knowledge format interactively |
1. Open https://dendritic-memory-editor.pages.dev
2. Create a new tile or import existing .iath file
3. Fill in: Topic, Content, Domain, Coordinates
4. Visualize in 3D space
5. Export as .iath file
6. Import into NullAI via API or setup.sh
🎓 Tutorial Available: The editor includes an interactive tutorial guiding you through creating your first knowledge tile.
# Clone and setup NullAI
curl -sSL https://huggingface.co/kofdai/nullai-phi-4-14b-v2/raw/main/setup.sh | bash
# Or manual installation:
git clone https://huggingface.co/kofdai/nullai-phi-4-14b-v2
cd nullai-phi-4-14b-v2
chmod +x setup.sh
./setup.sh
from llama_cpp import Llama
# Load model
llm = Llama(
model_path="phi-4-f16.gguf",
n_ctx=16384, # Context window
n_threads=8, # CPU threads
n_gpu_layers=0 # Set to -1 for full GPU offload
)
# Run inference
prompt = """You are NullAI, an expert system with access to verified knowledge tiles.
Question: Explain the treatment options for atrial fibrillation.
Please provide:
1. Available treatment modalities
2. Evidence-based recommendations
3. Patient-specific considerations
4. Reasoning chain with certainty scores
"""
response = llm(
prompt,
max_tokens=1000,
temperature=0.7,
top_p=0.9,
repeat_penalty=1.1
)
print(response['choices'][0]['text'])
# Start the NullAI API server
cd backend
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000
# Access at: http://localhost:8000/docs
# Start the frontend
cd frontend
npm install
npm run dev
# Access at: http://localhost:5173
# Download and run setup script
curl -sSL https://huggingface.co/kofdai/nullai-phi-4-14b-v2/raw/main/setup.sh | bash
# This will:
# 1. Download the model (phi-4-f16.gguf)
# 2. Install Python dependencies
# 3. Set up database with sample knowledge tiles
# 4. Configure environment variables
# 5. Start the API server and web interface
# 1. Clone the repository
git clone https://huggingface.co/kofdai/nullai-phi-4-14b-v2
cd nullai-phi-4-14b-v2
# 2. Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Download the model
# (Already included in the repository)
# 5. Initialize database
python init_db.py
# 6. Start backend
cd backend
python -m uvicorn app.main:app --reload
# 7. In a new terminal, start frontend
cd frontend
npm install
npm run dev
| Feature | Traditional LLMs | NullAI |
|---|---|---|
| Reasoning Transparency | ❌ Black box | ✅ Full chain visible |
| Expert Verification | ❌ None | ✅ ORCID-authenticated |
| Domain Specialization | ⚠️ Requires massive retraining | ✅ Hours with LoRA |
| Knowledge Updates | ❌ Months of retraining | ✅ Add tiles in minutes |
| Hallucination Control | ⚠️ Prompt engineering only | ✅ Built-in detection + judges |
| Certainty Scoring | ❌ No confidence metrics | ✅ Calibrated scores |
| Audit Trails | ❌ No logging | ✅ Complete reasoning logs |
| Multi-Domain Integration | ⚠️ Limited | ✅ Seamless cross-domain |
| Educational Use | ⚠️ Answer-focused | ✅ Teaches critical thinking |
| Privacy | ❌ Cloud-only | ✅ On-premise deployment |
| Cost | 💰💰💰 High API costs | 💰 One-time setup |
# Import knowledge tiles from .iath file
curl -X POST http://localhost:8000/api/knowledge/import/iath \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@medical_tiles.iath"
# Export all tiles to .iath format
curl http://localhost:8000/api/knowledge/export/iath?domain_id=medical \
-H "Authorization: Bearer YOUR_TOKEN" \
-o exported_tiles.iath
# Export to JSON
curl http://localhost:8000/api/knowledge/export/json?domain_id=medical \
-H "Authorization: Bearer YOUR_TOKEN" \
-o exported_tiles.json
import requests
# Create a new knowledge tile
tile = {
"domain": "medical",
"topic": "Hypertension Management",
"content": "First-line treatment for hypertension includes...",
"coordinates": {"x": 0.6, "y": 0.8, "z": 0.9},
"verification_type": "expert",
"orcid_id": "0000-0002-1234-5678" # Optional: Expert ORCID
}
response = requests.post(
"http://localhost:8000/api/knowledge/",
json=tile,
headers={"Authorization": f"Bearer {YOUR_TOKEN}"}
)
print(response.json())
We welcome contributions to NullAI! Here's how you can help:
This project is licensed under the MIT License - see the LICENSE file for details.
If you use NullAI in your research or project, please cite:
@misc{nullai-phi4-v2,
title={NullAI Phi-4 14B (v2): Revolutionary Multi-Domain Knowledge System},
author={KofDai and Contributors},
year={2025},
publisher={HuggingFace},
url={https://huggingface.co/kofdai/nullai-phi-4-14b-v2},
note={Based on Microsoft Phi-4}
}
<a name="japanese"></a>
NullAIは単なるファインチューニング済み言語モデルではありません。複数の専門領域にわたって情報を保存、検索、検証する方法を革新する包括的な知識統合システムです。
すべての知識を均一に扱う従来のLLMとは異なり、NullAIは以下を実装しています:
インストール不要で、ブラウザ上で.iath知識タイルを作成、編集、管理できる強力なツールです。
📝 ビジュアルタイル作成
🎯 3D座標ビジュアライザー
📤 .iathファイルのインポート/エクスポート
🔍 タイル検査 & バリデーター
🧪 テスト & プロトタイピング
| ユーザータイプ | 使用例 |
|---|---|
| ドメインエキスパート | コーディング不要で検証済み知識タイルを作成 |
| 研究者 | 適切な引用とORCIDで研究成果を文書化 |
| 教育者 | 空間的に整理された教育コンテンツの構築 |
| 開発者 | API統合前のタイル構造プロトタイピング |
| 学習者 | NullAI知識形式をインタラクティブに理解 |
1. https://dendritic-memory-editor.pages.dev を開く
2. 新しいタイルを作成、または既存の.iathファイルをインポート
3. トピック、コンテンツ、ドメイン、座標を入力
4. 3D空間で可視化
5. .iathファイルとしてエクスポート
6. APIまたはsetup.sh経由でNullAIにインポート
🎓 チュートリアル利用可能: エディターには、最初の知識タイル作成をガイドするインタラクティブチュートリアルが含まれています。
# NullAIをクローンしてセットアップ
curl -sSL https://huggingface.co/kofdai/nullai-phi-4-14b-v2/raw/main/setup.sh | bash
# または手動インストール:
git clone https://huggingface.co/kofdai/nullai-phi-4-14b-v2
cd nullai-phi-4-14b-v2
chmod +x setup.sh
./setup.sh
from llama_cpp import Llama
# モデルをロード
llm = Llama(
model_path="phi-4-f16.gguf",
n_ctx=16384, # コンテキストウィンドウ
n_threads=8, # CPUスレッド
n_gpu_layers=0 # GPU完全オフロードには-1を設定
)
# 推論を実行
prompt = """あなたはNullAI、検証済み知識タイルにアクセス可能なエキスパートシステムです。
質問: 心房細動の治療選択肢について説明してください。
以下を提供してください:
1. 利用可能な治療方法
2. エビデンスに基づく推奨事項
3. 患者固有の考慮事項
4. 確実性スコア付き推論チェーン
"""
response = llm(
prompt,
max_tokens=1000,
temperature=0.7,
top_p=0.9,
repeat_penalty=1.1
)
print(response['choices'][0]['text'])
このプロジェクトはMITライセンスの下でライセンスされています。
⭐ If you find this project helpful, please star it on GitHub! / このプロジェクトが役立ったら、GitHubでスターをお願いします!