index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <!DOCTYPE html>
  2. <html lang="en" data-framework="javascript">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0">
  7. <meta name="description" content="A conversational AI system that listens, learns, and challenges">
  8. <meta property="og:title" content="ChatGPT">
  9. <meta property="og:image" content="https://openai.com/content/images/2022/11/ChatGPT.jpg">
  10. <meta property="og:description" content="A conversational AI system that listens, learns, and challenges">
  11. <meta property="og:url" content="https://g4f.ai">
  12. <link rel="stylesheet" href="/static/css/style.css">
  13. <link rel="apple-touch-icon" sizes="180x180" href="/static/img/apple-touch-icon.png">
  14. <link rel="icon" type="image/png" sizes="32x32" href="/static/img/favicon-32x32.png">
  15. <link rel="icon" type="image/png" sizes="16x16" href="/static/img/favicon-16x16.png">
  16. <link rel="manifest" href="/static/img/site.webmanifest">
  17. <script src="/static/js/icons.js"></script>
  18. <script src="/static/js/highlightjs-copy.min.js"></script>
  19. <script src="/static/js/chat.v1.js" defer></script>
  20. <script src="https://cdn.jsdelivr.net/npm/markdown-it@13.0.1/dist/markdown-it.min.js"></script>
  21. <link rel="stylesheet" href="/static/css/dracula.min.css">
  22. <script>
  23. MathJax = {
  24. chtml: {
  25. scale: 1,
  26. displayAlign: 'left'
  27. }
  28. };
  29. </script>
  30. <script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
  31. <script type="module" src="https://cdn.jsdelivr.net/npm/mistral-tokenizer-js" async>
  32. import mistralTokenizer from "mistral-tokenizer-js"
  33. </script>
  34. <script type="module" src="https://cdn.jsdelivr.net/gh/belladoreai/llama-tokenizer-js@master/llama-tokenizer.js" async>
  35. import llamaTokenizer from "llama-tokenizer-js"
  36. </script>
  37. <script src="https://cdn.jsdelivr.net/npm/gpt-tokenizer/dist/cl100k_base.js" async></script>
  38. <script src="/static/js/text_to_speech/index.js" async></script>
  39. <!--
  40. <script src="/static/js/whisper-web/index.js" async></script>
  41. -->
  42. <script>
  43. const user_image = '<img src="/static/img/user.png" alt="your avatar">';
  44. const gpt_image = '<img src="/static/img/gpt.png" alt="your avatar">';
  45. </script>
  46. <script src="/static/js/highlight.min.js"></script>
  47. <script>window.conversation_id = "{{chat_id}}"</script>
  48. <title>g4f - gui</title>
  49. </head>
  50. <body>
  51. <div class="gradient"></div>
  52. <div class="row">
  53. <div class="box conversations">
  54. <div class="top">
  55. <button class="new_convo" onclick="new_conversation()">
  56. <i class="fa-regular fa-plus"></i>
  57. <span>New Conversation</span>
  58. </button>
  59. </div>
  60. <div class="bottom_buttons">
  61. <!--
  62. <button onclick="open_album();">
  63. <i class="fa-solid fa-toolbox"></i>
  64. <span>Images Album</span>
  65. </button>
  66. -->
  67. <button onclick="open_settings();">
  68. <i class="fa-solid fa-toolbox"></i>
  69. <span>Open Settings</span>
  70. </button>
  71. <div class="info">
  72. <i class="fa-brands fa-discord"></i>
  73. <span class="convo-title">discord ~ <a href="https://discord.gg/6yrm7H4B" target="_blank">discord.gg/6yrm7H4B</a>
  74. </span>
  75. </div>
  76. <div class="info">
  77. <i class="fa-brands fa-github"></i>
  78. <span class="convo-title">github ~ <a href="https://github.com/xtekky/gpt4free" target="_blank">@xtekky/gpt4free</a>
  79. </span>
  80. </div>
  81. <div class="info">
  82. <i class="fa-solid fa-star"></i>
  83. <span id="version_text" class="convo-title"></span>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="images hidden">
  88. </div>
  89. <div class="settings hidden">
  90. <div class="paper">
  91. <h3>Settings</h3>
  92. <div class="field">
  93. <span class="label">Enable Dark Mode</span>
  94. <input type="checkbox" id="darkMode" checked />
  95. <label for="darkMode" class="toogle" title=""></label>
  96. </div>
  97. <div class="field">
  98. <span class="label">Web Access with DuckDuckGo</span>
  99. <input type="checkbox" id="switch" />
  100. <label for="switch" class="toogle" title="Add the pages of the first 5 search results to the query."></label>
  101. </div>
  102. <div class="field">
  103. <span class="label">Disable Conversation History</span>
  104. <input type="checkbox" id="history" />
  105. <label for="history" class="toogle" title="To improve the reaction time or if you have trouble with large conversations."></label>
  106. </div>
  107. <div class="field">
  108. <span class="label">Hide System-prompt</span>
  109. <input type="checkbox" id="hide-systemPrompt" />
  110. <label for="hide-systemPrompt" class="toogle" title="For more space on phones"></label>
  111. </div>
  112. <div class="field">
  113. <span class="label">Download generated images</span>
  114. <input type="checkbox" id="download_images" checked/>
  115. <label for="download_images" class="toogle" title="Download and save generated images to /generated_images"></label>
  116. </div>
  117. <div class="field">
  118. <span class="label">Auto continue in ChatGPT</span>
  119. <input id="auto_continue" type="checkbox" name="auto_continue" checked/>
  120. <label for="auto_continue" class="toogle" title="Continue large responses in OpenaiChat"></label>
  121. </div>
  122. <div class="field box">
  123. <label for="message-input-height" class="label" title="">Input max. height</label>
  124. <input type="number" id="message-input-height" value="200"/>
  125. </div>
  126. <div class="field box">
  127. <label for="recognition-language" class="label" title="">Speech recognition lang</label>
  128. <input type="text" id="recognition-language" value="" placeholder="navigator.language"/>
  129. </div>
  130. <div class="field box">
  131. <label for="BingCreateImages-api_key" class="label" title="">Microsoft Designer in Bing:</label>
  132. <textarea id="BingCreateImages-api_key" name="BingCreateImages[api_key]" placeholder="&quot;_U&quot; cookie"></textarea>
  133. </div>
  134. <div class="field box">
  135. <label for="Cerebras-api_key" class="label" title="">Cerebras Inference:</label>
  136. <textarea id="Cerebras-api_key" name="Cerebras[api_key]" placeholder="api_key"></textarea>
  137. </div>
  138. <div class="field box">
  139. <label for="DeepInfra-api_key" class="label" title="">DeepInfra:</label>
  140. <textarea id="DeepInfra-api_key" name="DeepInfra[api_key]" class="DeepInfraImage-api_key" placeholder="api_key"></textarea>
  141. </div>
  142. <div class="field box">
  143. <label for="GeminiPro-api_key" class="label" title="">Gemini API:</label>
  144. <textarea id="GeminiPro-api_key" name="GeminiPro[api_key]" placeholder="api_key"></textarea>
  145. </div>
  146. <div class="field box">
  147. <label for="Groq-api_key" class="label" title="">Groq:</label>
  148. <textarea id="Groq-api_key" name="Groq[api_key]" placeholder="api_key"></textarea>
  149. </div>
  150. <div class="field box">
  151. <label for="HuggingFace-api_key" class="label" title="">HuggingFace:</label>
  152. <textarea id="HuggingFace-api_key" name="HuggingFace[api_key]" class="HuggingFace2-api_key" placeholder="api_key"></textarea>
  153. </div>
  154. <div class="field box">
  155. <label for="Openai-api_key" class="label" title="">OpenAI API:</label>
  156. <textarea id="Openai-api_key" name="Openai[api_key]" placeholder="api_key"></textarea>
  157. </div>
  158. <div class="field box">
  159. <label for="OpenRouter-api_key" class="label" title="">OpenRouter:</label>
  160. <textarea id="OpenRouter-api_key" name="OpenRouter[api_key]" placeholder="api_key"></textarea>
  161. </div>
  162. <div class="field box">
  163. <label for="PerplexityApi-api_key" class="label" title="">Perplexity API:</label>
  164. <textarea id="PerplexityApi-api_key" name="PerplexityApi[api_key]" placeholder="api_key"></textarea>
  165. </div>
  166. <div class="field box">
  167. <label for="Replicate-api_key" class="label" title="">Replicate:</label>
  168. <textarea id="Replicate-api_key" name="Replicate[api_key]" class="ReplicateImage-api_key" placeholder="api_key"></textarea>
  169. </div>
  170. </div>
  171. <div class="bottom_buttons">
  172. <button onclick="delete_conversations()">
  173. <i class="fa-regular fa-trash"></i>
  174. <span>Clear Conversations</span>
  175. </button>
  176. <button onclick="save_storage()">
  177. <i class="fa-solid fa-download"></i>
  178. <a href="" onclick="return false;">Export Conversations</a>
  179. </button>
  180. <button id="showLog">
  181. <i class="fa-solid fa-terminal"></i>
  182. <a href="" onclick="return false;">Show log</a>
  183. </button>
  184. </div>
  185. </div>
  186. <div class="conversation">
  187. <textarea id="systemPrompt" class="box" placeholder="System prompt"></textarea>
  188. <div id="messages" class="box"></div>
  189. <button class="slide-systemPrompt">
  190. <i class="fa-solid fa-angles-up"></i>
  191. </button>
  192. <div class="toolbar">
  193. <div id="input-count" class="">
  194. <button class="hide-input">
  195. <i class="fa-solid fa-angles-down"></i>
  196. </button>
  197. <span class="text"></span>
  198. </div>
  199. <div class="stop_generating stop_generating-hidden">
  200. <button id="cancelButton">
  201. <span>Stop Generating</span>
  202. <i class="fa-solid fa-stop"></i>
  203. </button>
  204. </div>
  205. <div class="regenerate">
  206. <button id="regenerateButton">
  207. <span>Regenerate</span>
  208. <i class="fa-solid fa-rotate"></i>
  209. </button>
  210. </div>
  211. </div>
  212. <div class="user-input">
  213. <div class="box input-box">
  214. <textarea id="message-input" placeholder="Ask a question" cols="30" rows="10"
  215. style="white-space: pre-wrap;resize: none;"></textarea>
  216. <label class="file-label image-label" for="image" title="Works with Bing, Gemini, OpenaiChat and You">
  217. <input type="file" id="image" name="image" accept="image/*" required/>
  218. <i class="fa-regular fa-image"></i>
  219. </label>
  220. <label class="file-label image-label" for="camera">
  221. <input type="file" id="camera" name="camera" accept="image/*" capture="camera" required/>
  222. <i class="fa-solid fa-camera"></i>
  223. </label>
  224. <label class="file-label" for="file">
  225. <input type="file" id="file" name="file" accept="text/plain, text/html, text/xml, application/json, text/javascript, .har, .sh, .py, .php, .css, .yaml, .sql, .log, .csv, .twig, .md" required/>
  226. <i class="fa-solid fa-paperclip"></i>
  227. </label>
  228. <label class="micro-label" for="micro">
  229. <i class="fa-solid fa-microphone-slash"></i>
  230. </label>
  231. <div id="send-button">
  232. <i class="fa-solid fa-paper-plane-top"></i>
  233. </div>
  234. </div>
  235. </div>
  236. <div class="buttons">
  237. <div class="field">
  238. <select name="model" id="model">
  239. <option value="">Model: Default</option>
  240. <option value="gpt-4">gpt-4</option>
  241. <option value="gpt-4o">gpt-4o</option>
  242. <option value="gpt-4o-mini">gpt-4o-mini</option>
  243. <option value="llama-3.1-70b">llama-3.1-70b</option>
  244. <option value="llama-3.1-70b">llama-3.1-405b</option>
  245. <option value="llama-3.1-70b">mixtral-8x7b</option>
  246. <option value="gemini-pro">gemini-pro</option>
  247. <option value="gemini-flash">gemini-flash</option>
  248. <option value="claude-3-haiku">claude-3-haiku</option>
  249. <option value="claude-3.5-sonnet">claude-3.5-sonnet</option>
  250. <option disabled="disabled">----</option>
  251. </select>
  252. <select name="model2" id="model2" class="hidden"></select>
  253. </div>
  254. <div class="field">
  255. <select name="provider" id="provider">
  256. <option value="">Provider: Auto</option>
  257. <option value="OpenaiChat">OpenAI ChatGPT</option>
  258. <option value="Copilot">Microsoft Copilot</option>
  259. <option value="ChatGpt">ChatGpt</option>
  260. <option value="Gemini">Gemini</option>
  261. <option value="MetaAI">Meta AI</option>
  262. <option value="DeepInfraChat">DeepInfraChat</option>
  263. <option value="Blackbox">Blackbox</option>
  264. <option value="DDG">DuckDuckGo</option>
  265. <option value="Pizzagpt">Pizzagpt</option>
  266. <option disabled="disabled">----</option>
  267. </select>
  268. </div>
  269. </div>
  270. </div>
  271. <div class="log hidden"></div>
  272. </div>
  273. <div class="mobile-sidebar">
  274. <i class="fa-solid fa-bars"></i>
  275. </div>
  276. </body>
  277. </html>