|
|
""" |
|
|
NullAI - HuggingFace Spaces Demo |
|
|
Lightweight demo application for NullAI knowledge system |
|
|
""" |
|
|
import gradio as gr |
|
|
import requests |
|
|
import json |
|
|
|
|
|
|
|
|
def query_nullai(question, domain="general"): |
|
|
""" |
|
|
Query NullAI system with a question |
|
|
""" |
|
|
try: |
|
|
|
|
|
|
|
|
|
|
|
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." |
|
|
|
|
|
|
|
|
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() |
|
|
|