File size: 5,875 Bytes
c8378d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
"""
Devrayog AI - Gradio Web App
Deployed on Hugging Face Spaces
"""

import gradio as gr
import requests
import json
import os
import time

# API endpoint (will be updated after deployment)
API_URL = os.environ.get("API_URL", "https://devrayog-ai.hf.space")

def chat_with_devrayog(message, model_name, system_prompt):
    """Send chat request to Devrayog AI API"""
    
    if not message.strip():
        return "Please enter a message."
    
    # For now, provide a working demo response
    # In production, this will call the actual model API
    
    model_responses = {
        "Devrayog Agni (Fast)": f"๐Ÿ”ฅ [Agni - Fast Response]\n\nThank you for your message: '{message}'\n\nI'm Devrayog Agni, the fast model optimized for quick responses. I can help you with:\n- Quick answers\n- Coding help\n- Daily tasks\n- SSB preparation\n\nHow can I assist you further?",
        
        "Devrayog Vayu (Creative)": f"๐ŸŒŠ [Vayu - Creative Response]\n\nYour message: '{message}'\n\nI'm Devrayog Vayu, the creative model. I excel at:\n- Storytelling and creative writing\n- Brainstorming ideas\n- Content generation\n- Imaginative responses\n\nLet me craft something special for you!",
        
        "Devrayog Akash (Powerful)": f"๐ŸŒŒ [Akash - Deep Response]\n\nAnalyzing your message: '{message}'\n\nI'm Devrayog Akash, the most powerful model. I specialize in:\n- Complex reasoning\n- Deep analysis\n- Research tasks\n- Multi-step problem solving\n\nLet me provide a comprehensive response."
    }
    
    response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])
    
    if system_prompt:
        response = f"[System: {system_prompt}]\n\n{response}"
    
    return response

def get_model_info():
    """Get information about available models"""
    return """
## Devrayog AI Models

### ๐Ÿ”ฅ Devrayog Agni (Fast)
- **Parameters:** 3.8B
- **Base:** Phi-3-mini-4k-instruct
- **Best for:** Quick responses, coding, daily tasks

### ๐ŸŒŠ Devrayog Vayu (Creative)
- **Parameters:** 9B
- **Base:** Gemma-2-9b-it
- **Best for:** Storytelling, brainstorming, content

### ๐ŸŒŒ Devrayog Akash (Powerful)
- **Parameters:** 8B
- **Base:** Llama-3.1-8B-Instruct
- **Best for:** Complex reasoning, analysis, research

---

**Founder:** Devanshu Sharma (Hermes), Age 18, Neem Ka Thana, Rajasthan

**Tagline:** India's First Solo-Built AI
"""

# Create Gradio interface
with gr.Blocks(
    title="Devrayog AI - India's First Solo-Built AI",
    theme=gr.themes.Soft(),
    css="""
    .gradio-container {font-family: 'Segoe UI', sans-serif;}
    .main-title {text-align: center; color: #FF6B35;}
    """
) as demo:
    
    gr.Markdown("# ๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI", elem_classes=["main-title"])
    gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Neem Ka Thana, Rajasthan*")
    
    with gr.Tab("๐Ÿ’ฌ Chat"):
        with gr.Row():
            with gr.Column(scale=3):
                chat_input = gr.Textbox(
                    label="Your Message",
                    placeholder="Type your message here...",
                    lines=3
                )
                
                model_select = gr.Dropdown(
                    choices=[
                        "Devrayog Agni (Fast)",
                        "Devrayog Vayu (Creative)",
                        "Devrayog Akash (Powerful)"
                    ],
                    value="Devrayog Agni (Fast)",
                    label="Select Model"
                )
                
                system_prompt_input = gr.Textbox(
                    label="System Prompt (Optional)",
                    placeholder="Set a custom system prompt...",
                    lines=2
                )
                
                chat_btn = gr.Button("Send ๐Ÿš€", variant="primary")
            
            with gr.Column(scale=2):
                chat_output = gr.Textbox(
                    label="Response",
                    lines=10,
                    interactive=False
                )
        
        chat_btn.click(
            fn=chat_with_devrayog,
            inputs=[chat_input, model_select, system_prompt_input],
            outputs=chat_output
        )
    
    with gr.Tab("๐Ÿ“š Model Info"):
        gr.Markdown(get_model_info())
    
    with gr.Tab("๐ŸŽฏ SSB Prep"):
        gr.Markdown("""
## SSB Interview Preparation

### 5-Day SSB Process
1. **Day 1 - Screening:** OIR Test + PPDT
2. **Day 2 - Psychology:** TAT, WAT, SRT, SD
3. **Day 3-4 - GTO Tasks:** GD, GPE, PGT, HGT, Command Task, FGT
4. **Day 5 - Conference:** Final Result

### 15 Officer-Like Qualities (OLQs)
1. Effective Intelligence
2. Reasoning Ability
3. Organizing Ability
4. Power of Expression
5. Social Adaptability
6. Cooperation
7. Sense of Responsibility
8. Initiative
9. Self Confidence
10. Speed of Decision
11. Ability to Influence the Group
12. Liveliness
13. Determination
14. Courage
15. Stamina

### Quick Tips
- Be yourself, don't fake
- Practice OIR daily
- Write 6 TAT stories daily
- Stay updated with current affairs
- Maintain physical fitness
- Be confident but humble
        """)
    
    with gr.Tab("โ„น๏ธ About"):
        gr.Markdown("""
## About Devrayog AI

**Devrayog AI** is India's first solo-built AI company, founded by **Devanshu Sharma (Hermes)**, an 18-year-old from Neem Ka Thana, Rajasthan.

### Mission
To build India's most accessible and powerful AI, created by a young Indian founder from a small town.

### Models
- **Devrayog Agni** - Fast and sharp (3.8B)
- **Devrayog Vayu** - Creative and flowing (9B)
- **Devrayog Akash** - Most powerful (8B)

### Contact
- Hugging Face: https://huggingface.co/dev2089
- Founder: Devanshu Sharma (Hermes)

---

*Built with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ*
        """)

# Launch the app
if __name__ == "__main__":
    demo.launch(server_name="0.0.0.0", server_port=7860)