Models

Where should we begin?

Synara AI can make mistakes. Check important info.
function mn(m){return m.split("/").pop().replace(":free","");} function mp(m){return m.split("/")[0];} function esc(s){return String(s||"").replace(/&/g,"&").replace(//g,">");} function fmt(s){ var out=s; // code blocks - use split approach to avoid regex backtick issues out=out.replace(/```[\w]*\n?([\s\S]*?)```/g,function(_,c){return "
"+esc(c.trim())+"
";}); out=out.replace(/`([^`]+)`/g,function(_,c){return ""+esc(c)+"";}); out=out.replace(/\*\*(.+?)\*\*/g,"$1"); out=out.replace(/\*(.+?)\*/g,"$1"); out=out.replace(/^### (.+)$/gm,"

$1

"); out=out.replace(/^## (.+)$/gm,"

$1

"); out=out.replace(/^# (.+)$/gm,"

$1

"); out=out.replace(/^\* (.+)$/gm,"
  • $1
  • "); out=out.replace(/^- (.+)$/gm,"
  • $1
  • "); out=out.replace(/(
  • .*<\/li>)/gs,""); out=out.split("\n\n").map(function(p){return p.startsWith("<")?p:"

    "+p.replace(/\n/g,"
    ")+"

    ";}).join(""); return out; } function bmsg(role,content,model){ if(role==="user") return "
    "+esc(content)+"
    "; var nm="Synara AI"; return "
    "+nm+"
    "+fmt(content)+"
    "; } function cp(btn,b64){try{navigator.clipboard.writeText(decodeURIComponent(escape(atob(b64))));}catch(e){}btn.textContent="Copied!";setTimeout(function(){btn.textContent="Copy";},2000);} function loadUser(){ var raw=localStorage.getItem("synara_ai_user"); if(raw){ user=JSON.parse(raw); var av=document.getElementById("av"); var un=document.getElementById("un"); un.textContent=user.name||user.email||"User"; if(user.picture)av.innerHTML=""; else av.textContent=(user.name||"U")[0].toUpperCase(); document.getElementById("authib").innerHTML=""; loadConvos(); } } function authclick(){if(user)signout();else location.href="/ai/auth";} function uclick(){if(!user)location.href="/ai/auth";} function signout(){localStorage.removeItem("synara_ai_user");user=null;convos=[];cid=null;document.getElementById("av").textContent="?";document.getElementById("un").textContent="Guest";document.getElementById("authib").innerHTML="";rh();document.getElementById("msgs").innerHTML="

    Where should we begin?

    ";} function loadConvos(){if(!user)return;var r=localStorage.getItem("sai_c_"+user.sub);if(r)convos=JSON.parse(r);rh();} function saveConvos(){if(!user)return;localStorage.setItem("sai_c_"+user.sub,JSON.stringify(convos));} function nc(){cid=Date.now().toString();if(user){convos.unshift({id:cid,title:"New chat",msgs:[],model:mi});saveConvos();rh();}document.getElementById("msgs").innerHTML="

    Where should we begin?

    ";var inp=document.getElementById("inp");inp.value="";rsz(inp);upsnd();askedSI=false;if(window.innerWidth<=700)document.getElementById("sb").classList.remove("mob");} function lc(id){cid=id;var c=convos.find(function(x){return x.id===id;});if(!c)return;mi=c.model||0;document.getElementById("mlbl").textContent="Synara AI";rmsgs(c.msgs);rh();if(window.innerWidth<=700)document.getElementById("sb").classList.remove("mob");} function rh(){var el=document.getElementById("hist");if(!user||!convos.length){el.innerHTML="";return;}el.innerHTML="
    Recent
    "+convos.slice(0,30).map(function(c){return "
    "+(c.title.length>40?c.title.slice(0,40)+"...":c.title)+"
    ";}).join("");} function rmsgs(msgs){var el=document.getElementById("msgs");el.innerHTML=msgs.map(function(m){return bmsg(m.role,m.content,m.model);}).join("");el.scrollTop=el.scrollHeight;} function bml(){document.getElementById("ml").innerHTML="
    Synara AISynara
    ";} function selm(i){mi=i;document.getElementById("mlbl").textContent="Synara AI";document.getElementById("mdrop").classList.remove("on");bml();} function tgdrop(){document.getElementById("mdrop").classList.toggle("on");bml();} document.addEventListener("click",function(e){if(!e.target.closest("#mdrop")&&!e.target.closest("#mbtni"))document.getElementById("mdrop").classList.remove("on");}); function tgsb(){var sb=document.getElementById("sb");if(window.innerWidth<=700)sb.classList.toggle("mob");else sb.classList.toggle("off");} function rsz(el){el.style.height="auto";el.style.height=Math.min(el.scrollHeight,180)+"px";} function upsnd(){var b=document.getElementById("sndb");var v=document.getElementById("inp").value.trim();if(streaming){b.classList.add("on","stop");b.innerHTML="";}else{b.classList.remove("stop");b.classList.toggle("on",v.length>0);b.innerHTML="";}} function onk(e){if(e.key==="Enter"&&!e.shiftKey){e.preventDefault();dosend();}} function showSIP(){ var el=document.createElement("div"); el.className="mwrap"; el.innerHTML="

    Sign in to save your conversations.

    "; document.getElementById("msgs").appendChild(el); document.getElementById("msgs").scrollTop=document.getElementById("msgs").scrollHeight; } async function dosend(){ if(streaming){ab&&ab.abort();return;} var inp=document.getElementById("inp"); var text=inp.value.trim(); if(!text)return; inp.value="";rsz(inp);upsnd(); if(!cid){cid=Date.now().toString();if(user){convos.unshift({id:cid,title:text.slice(0,40),msgs:[],model:mi});saveConvos();rh();}} else if(user){var cc=convos.find(function(x){return x.id===cid;});if(cc&&cc.title==="New chat")cc.title=text.slice(0,40);} var wlc=document.getElementById("wlc");if(wlc)wlc.remove(); var msgs=document.getElementById("msgs"); msgs.insertAdjacentHTML("beforeend",bmsg("user",text)); msgs.scrollTop=msgs.scrollHeight; var history=[]; if(user){var cc=convos.find(function(x){return x.id===cid;});if(cc){cc.msgs.push({role:"user",content:text});history=cc.msgs.slice(-20).map(function(m){return {role:m.role==="ai"?"assistant":m.role,content:m.content};});saveConvos();}} else{history=[{role:"user",content:text}];} var tid="t"+Date.now(); msgs.insertAdjacentHTML("beforeend","
    Synara AI
    "); msgs.scrollTop=msgs.scrollHeight; streaming=true;upsnd(); var reply="",usedM=MODELS[mi]; var done=false; for(var i=0;i
    Synara AI
    "); var sc=document.getElementById("sc"+tid2); usedM=m; var reader=res.body.getReader(); var dec=new TextDecoder(); while(true){ var chunk=await reader.read(); if(chunk.done)break; var lines=dec.decode(chunk.value).split("\n").filter(function(l){return l.startsWith("data: ");}); for(var j=0;j