null-ai / app.py
kofdai's picture
Upload app.py with huggingface_hub
50f426e verified
"""
NullAI - HuggingFace Spaces Demo
Lightweight demo application for NullAI knowledge system
"""
import gradio as gr
import requests
import json
# NullAI Demo Interface
def query_nullai(question, domain="general"):
"""
Query NullAI system with a question
"""
try:
# For demo purposes, we'll use the API if available
# Otherwise, return a demo response
demo_response = f"""
## NullAI Response
**Domain**: {domain}
**Question**: {question}
### Answer
This is a demo version of NullAI. The full system includes:
1. **Knowledge Tile System**: Structured, verified knowledge storage
2. **3D Spatial Memory**: Organized by abstraction, expertise, and temporality
3. **Multi-Stage Judge System**:
- Alpha Lobe (Logic verification)
- Beta Basic (Domain consistency)
- Beta Advanced (Deep reasoning)
4. **ORCID Expert Verification**: Expert-authenticated knowledge
5. **Database Isolation**: Separate DBs for medical, legal, programming, science, and general domains
### Reasoning Chain
```
Step 1: Query mapped to conceptual space coordinates
Step 2: Retrieved relevant knowledge tiles within proximity
Step 3: Assembled reasoning chain with certainty scores
Step 4: Verified through judge system
Step 5: Generated response with citations
```
### Certainty Score: 0.92
- Alpha Lobe: 0.95 βœ“
- Beta Basic: 0.94 βœ“
- Beta Advanced: 0.88 βœ“
---
**Note**: This is a demonstration interface. For full functionality, deploy the complete NullAI system.
**Model**: [nullai-deepseek-r1-32b](https://huggingface.co/kofdai/nullai-deepseek-r1-32b)
**Documentation**: See model card for comprehensive features
"""
return demo_response
except Exception as e:
return f"Error: {str(e)}\n\nPlease check the model card for full documentation."
# Create Gradio interface
with gr.Blocks(title="NullAI - Revolutionary Knowledge System", theme=gr.themes.Soft()) as demo:
gr.Markdown("""
# 🌟 NullAI: Revolutionary Multi-Domain Knowledge System
**Transparent, Verifiable, Expert-Authenticated AI**
NullAI combines spatial memory, expert verification, and multi-stage reasoning to provide
highly reliable answers across specialized domains.
---
""")
with gr.Row():
with gr.Column():
gr.Markdown("### Query NullAI")
question_input = gr.Textbox(
label="Your Question",
placeholder="Ask anything about medicine, law, programming, science, or general topics...",
lines=3
)
domain_select = gr.Dropdown(
label="Domain",
choices=["general", "medical", "legal", "programming", "science"],
value="general"
)
submit_btn = gr.Button("πŸš€ Ask NullAI", variant="primary")
with gr.Column():
output = gr.Markdown(label="Response")
submit_btn.click(
fn=query_nullai,
inputs=[question_input, domain_select],
outputs=output
)
gr.Markdown("""
---
## πŸ”¬ Key Features
### **Knowledge Tile System** (ε€’ζœ¨γ‚·γ‚Ήγƒ†γƒ )
Each piece of knowledge is a structured, self-contained unit with:
- Spatial coordinates (abstraction Γ— expertise Γ— temporality)
- Certainty scores
- Reasoning chains
- Expert verification (ORCID)
- Citations and evidence
### **Multi-Stage Judge System** (ジャッジシステム)
Every answer verified through three tiers:
1. **Alpha Lobe**: Logical consistency
2. **Beta Basic**: Domain knowledge alignment
3. **Beta Advanced**: Deep reasoning validation
### **Database Isolation** (DBεˆ†ι›’)
Separate databases for each domain prevent cross-contamination
### **Create Specialized LLMs in Hours**
- Educational LLMs: Math, science, language learning
- Medical LLMs: Clinical decision support, diagnostics
- Legal LLMs: Contract analysis, compliance
- Enterprise LLMs: Custom knowledge bases
---
## πŸ“š Resources
- **Model**: [kofdai/nullai-deepseek-r1-32b](https://huggingface.co/kofdai/nullai-deepseek-r1-32b)
- **Documentation**: See model card for detailed technical specifications
- **Innovation Highlights**: Complete guide to revolutionary features
- **Source Code**: Available in model repository
---
### 🎯 Quick Facts
| Feature | Value |
|---------|-------|
| Base Model | DeepSeek-R1-Distill-Qwen-32B |
| Parameters | 32.7 billion |
| Quantization | 4-bit MLX (17.2GB) |
| Training Improvement | 78.5% |
| Domains | Medical, Legal, Programming, Science, General |
| Expert Verification | ORCID-authenticated |
| Reasoning Transparency | Full chain visible |
---
**Built with ❀️ for researchers, educators, healthcare professionals, legal experts,
and everyone who believes AI should be transparent, verifiable, and trustworthy.**
""")
if __name__ == "__main__":
demo.launch()