devrayog-api / app.py
dev2089's picture
Upload app.py with huggingface_hub
6b255bb verified
Raw History Blame
4.22 kB
"""
Devrayog AI - Gradio Web App
Deployed on Hugging Face Spaces
"""
import gradio as gr
import json
import time
def chat_with_devrayog(message, model_name, system_prompt):
"""Send chat request to Devrayog AI"""
if not message.strip():
return "Please enter a message."
model_responses = {
"Devrayog Agni (Fast)": f"๐Ÿ”ฅ [Devrayog 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"๐ŸŒŠ [Devrayog 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"๐ŸŒŒ [Devrayog 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():
return """
## Devrayog AI Models
### ๐Ÿ”ฅ Devrayog Agni (Fast) - 3.8B parameters
Best for: Quick responses, coding, daily tasks
### ๐ŸŒŠ Devrayog Vayu (Creative) - 9B parameters
Best for: Storytelling, brainstorming, content generation
### ๐ŸŒŒ Devrayog Akash (Powerful) - 8B parameters
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") as demo:
gr.Markdown("# ๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI")
gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan*")
with gr.Tab("๐Ÿ’ฌ Chat"):
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")
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("๐Ÿ“š Models"):
gr.Markdown(get_model_info())
with gr.Tab("๐ŸŽฏ SSB Prep"):
gr.Markdown("""
## SSB Interview Preparation
### 5-Day Process
- **Day 1:** Screening (OIR + PPDT)
- **Day 2:** Psychology (TAT, WAT, SRT, SD)
- **Day 3-4:** GTO Tasks (GD, GPE, PGT, HGT, Command Task, FGT)
- **Day 5:** Conference
### Quick Tips
- Be yourself, don't fake
- Practice OIR daily
- Write 6 TAT stories daily
- Stay updated with current affairs
- Maintain physical fitness
""")
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)
### Links
- Hugging Face: https://huggingface.co/dev2089
- Founder: Devanshu Sharma (Hermes), Age 18, Rajasthan
---
*Built with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ*
""")
if __name__ == "__main__":
demo.launch(server_name="0.0.0.0", server_port=7860)