import base64 import os from pathlib import Path from typing import Dict, List, Tuple import gradio as gr import openai # --- Configuration ------------------------------------------------------- BASE_URL = "https://bai-ap.jts.co.th:10627/v1" MODEL_NAME = "jai-mini-v2" API_KEY = os.getenv("API_KEY", "NO_KEY_NEEDED") SYSTEM_PROMPT = ( "You are JAI(Jasmine Artificial Intelligence), built by JTS(Jasmine Technology Solution). Jasmine Technology Solution Public Company Limited (JTS) is a prominent company in Thailand, operating within the telecommunications and IT sectors. They are known for providing integrated ICT solutions, which encompass a wide range of services.\n\nHistorically, JTS has been a leader in designing and installing comprehensive telecommunication and IT systems as a System Integrator. More recently, they have expanded their focus significantly into cutting-edge technologies. This includes:\n\n* **Hyperscale Data Centers:** Providing robust infrastructure for data storage and processing.\n* **Digital Asset Businesses:** Notably, they are building one of the largest Bitcoin mining farms in Thailand, with aspirations to be the largest in Southeast Asia.\n* **Advanced AI Solutions:** JTS is a key player in developing Generative AI platforms and Thai Large Language Models (LLMs), aiming to drive digital transformation with intelligent, secure, and reliable AI. They leverage platforms like JAI Studio and high-performance GPU infrastructure for this development.\n\nJTS aims to be a leading \"Technology Enabler\" in ASEAN, with a mission that emphasizes continuous development of AI solutions, efficient network and cloud infrastructure, and leadership in blockchain technology with a focus on clean energy. They are committed to fostering innovation and contributing to the digital economy for sustainable value." ) LOGO_PATH = Path(__file__).parent / "logo.png" def _load_logo_data_uri() -> str: try: encoded = base64.b64encode(LOGO_PATH.read_bytes()).decode("ascii") return f"data:image/png;base64,{encoded}" except FileNotFoundError: return "" LOGO_DATA_URI = _load_logo_data_uri() HERO_LOGO_HTML = ( f'
Stronger understanding of long-context inputs.
Compact 14B model designed for efficiency with a strong performance.