Jasika Logo Jasika AI
V2.0 Active Part of MSMEdu Python FastAPI Backend

Jasika AI — India's own Tutor/Teacher AI

Jasika AI is an advanced virtual learning tutor and educator from MSM Classes (Maa Saraswati Mentors) and MSMEdu. Built with dynamic region-based prompt adjustment, automatic document scanning, RAG embeddings search, and advanced Workers AI capabilities.

Jasika Tutor
Detected Client Region Ohio (US)
Detected Timezone America/New_York
Detected Language en-IN
Injected Clock Reference 6 July 2026 at 06:21:44 pm
Client IP 216.73.217.2

🌍 Context Injected Routing

Worker auto-extracts visitor timezone, region, and language. It injects a real-time clock references and custom educational rules, feeding them as context instructions to the backend LLM seamlessly.

cf-region cf-timezone cf-language Realtime Clock

🤖 Smart Auto Router

Exposed at /api/v2/auto, this endpoint runs a lightweight classifier to detect request intent (drawing, translations, general conversation) and maps it dynamically.

Intent Classifier Gateway Access Inquire Access

🎨 V2 Image Engine

Generate images via Stable Diffusion models. Supports customizable aspect ratios (16:9, 9:16, 1:1, etc.), SVG vector graphics generation, background transparency, and binary/base64 outputs.

Aspect Ratios SVG XML Code Transparency

📄 Multi-Format File Extractor

Send documents (PDF, CSV, JSON, TXT) directly through the standard chat completions request. The parser processes files at edge speeds using native streams and provides text embeddings for RAG.

PDF Text Scan CSV Parser Whisper/Resnet

About Jasika AI — India's own Tutor/Teacher AI

Developed by MSM Education, Jasika AI is a customized virtual learning agent tailored for Indian classrooms. It is trained to assist students in understanding core school subjects (such as CBSE boards, NCERT/ICSE curriculum, and state syllabi) and extracurricular modules (piano, zumba, coding, dance, drawing).

Operating at the edge via Cloudflare Workers, Jasika AI provides instant answers, processes complex files (extracting text from PDFs and CSVs), and automatically adjusts replies based on the visiting user's region, timezone, and local time. This makes the tutor highly personalized, real-time, and accessible in Hinglish, Hindi, English, Sanskrit, and all major Indian languages.

High-Level Design (HLD) Diagram

Represents the macroscopic request processing pipeline from clients to backend LLM models hosted in FastAPI through Cloudflare AI Gateway.

Client App Browser / Mobile Cloudflare Worker Auth & Parser Context Injection Workers AI LLM Completions Workers AI Local GPU Engine CF AI Gateway Metrics, Cache & Proxy FastAPI Jasika LLM Python Backend

Low-Level Design (LLD) Sequential Flow

nstrates the step-by-step logic execution for a complete request lifetime within the worker lifecycle.

Client App CF Worker Proxy Context Injected FastAPI Backend 1. POST /chat/completions 2. Verify Token 3. Extract Headers 4. Calculate Time & Location & Append educational rules 5. Forward Proxy (Via CF Gateway) 6. Stream response chunks / JSON 7. SSE / JSON responses
POST /api/v2/auto Contact Us

Classifies intent automatically and routes to chat completions, image generation, translation, sentiment, or entity recognition seamlessly.

prompt
POST /api/v2/images/generations Contact Us

Dynamic prompt-enhanced image generation. Supports various aspect ratios, SVG code export, transparency, and base64 payloads.

prompt aspect_ratio extension transparent response_format
POST /api/v2/chat/completions Contact Us

Streaming chat completion with geolocation injection, real-time timezone adaptation, and supportive educational tutor rules.

model messages stream temperature
POST /api/v1/chat/completions Contact Us

Legacy and backward-compatible chat endpoint. Parses attached files (PDF, CSV, JSON, TXT) automatically.

model messages use_rag rag_query
POST /api/v1/rag/upload Contact Us

Upload course material or files to KV storage. The content is parsed and indexed immediately for retrieval-augmented workflows.

file (multipart)
curl -X POST https://ai.msmclass.in/api/v2/chat/completions \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "cf-timezone: America/New_York" \
  -H "cf-region: Ohio" \
  -H "cf-language: en-IN" \
  -d '{
    "model": "jasika",
    "stream": true,
    "messages": [
      {
        "role": "user",
        "content": "Hello Jasika, what is photosynthesis?"
      }
    ]
  }'
// JavaScript Fetch Example for Auto Routing
const response = await fetch('https://ai.msmclass.in/api/v2/chat/completions', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
    'cf-timezone': 'America/New_York',
    'cf-region': 'Ohio',
    'cf-language': 'en-IN'
  },
  body: JSON.stringify({
    model: 'jasika',
    stream: false,
    messages: [
      { role: 'user', content: 'Hello Jasika, what is photosynthesis?' }
    ]
  })
});

const data = await response.json();
console.log(data.choices[0].message.content);
import requests

url = "https://ai.msmclass.in/api/v2/chat/completions"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "cf-timezone": "America/New_York",
    "cf-region": "Ohio",
    "cf-language": "en-IN"
}

payload = {
    "model": "jasika",
    "messages": [
        {"role": "user", "content": "Hello Jasika, what is photosynthesis?"}
    ]
}

response = requests.post(url, json=payload, headers=headers)
print(response.json()['choices'][0]['message']['content'])
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class JasikaClient {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        String jsonPayload = """
            {
              "model": "jasika",
              "stream": false,
              "messages": [
                {"role": "user", "content": "Hello Jasika, what is photosynthesis?"}
              ]
            }
            """;

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://ai.msmclass.in/api/v2/chat/completions"))
            .header("Authorization", "Bearer YOUR_TOKEN")
            .header("Content-Type", "application/json")
            .header("cf-timezone", "America/New_York")
            .header("cf-region", "Ohio")
            .header("cf-language", "en-IN")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
)

func main() {
	url := "https://ai.msmclass.in/api/v2/chat/completions"
	payload := []byte("{"model": "jasika", "stream": false, "messages": [{"role": "user", "content": "Hello Jasika, what is photosynthesis?"}]}")

	req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
	req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("cf-timezone", "America/New_York")
	req.Header.Set("cf-region", "Ohio")
	req.Header.Set("cf-language", "en-IN")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://ai.msmclass.in/api/v2/chat/completions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);

$payload = [
    'model' => 'jasika',
    'stream' => false,
    'messages' => [
        ['role' => 'user', 'content' => 'Hello Jasika, what is photosynthesis?']
    ]
];

curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));

curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_TOKEN',
    'Content-Type: application/json',
    'cf-timezone: America/New_York',
    'cf-region: Ohio',
    'cf-language: en-IN'
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("https://ai.msmclass.in/api/v2/chat/completions")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer YOUR_TOKEN"
request["Content-Type"] = "application/json"
request["cf-timezone"] = "America/New_York"
request["cf-region"] = "Ohio"
request["cf-language"] = "en-IN"

request.body = JSON.dump({
  "model" => "jasika",
  "stream" => false,
  "messages" => [
    { "role" => "user", "content" => "Hello Jasika, what is photosynthesis?" }
  ]
})

req_options = {
  use_ssl: uri.scheme == "https",
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_TOKEN");
        client.DefaultRequestHeaders.Add("cf-timezone", "America/New_York");
        client.DefaultRequestHeaders.Add("cf-region", "Ohio");
        client.DefaultRequestHeaders.Add("cf-language", "en-IN");

        var json = @"{
            ""model"": ""jasika"",
            ""stream"": false,
            ""messages"": [
                {""role"": ""user"", ""content"": ""Hello Jasika, what is photosynthesis?""}
            ]
        }";

        var content = new StringContent(json, Encoding.UTF8, "application/json");
        var response = await client.PostAsync("https://ai.msmclass.in/api/v2/chat/completions", content);
        var responseString = await response.Content.ReadAsStringAsync();
        
        Console.WriteLine(responseString);
    }
}