ai: fix user option, clean up models

This commit is contained in:
end-4
2025-04-06 01:37:38 +02:00
parent 4f8a0738b4
commit ca73b05c70
4 changed files with 102 additions and 51 deletions
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Layer_1"
version="1.1"
viewBox="0 0 56.202442 56.202035"
sodipodi:docname="DeepSeek_logo.svg"
width="20.000145"
height="20"
inkscape:version="1.4.1 (93de688d07, 2025-03-30)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview2"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="15.999999"
inkscape:cx="6.5625003"
inkscape:cy="7.1875003"
inkscape:window-width="1181"
inkscape:window-height="1028"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<!-- Generator: Adobe Illustrator 29.2.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 116) -->
<defs
id="defs1">
<style
id="style1">
.st0 {
fill: #4d6bfe;
}
</style>
</defs>
<path
class="st0"
d="m 55.612804,10.892579 c -0.5953,-0.2917 -0.8517,0.2642 -1.1998,0.5466 -0.1191,0.0911 -0.2198,0.2095 -0.3206,0.3188 -0.8701,0.9292 -1.8867,1.5398 -3.2148,1.4668 -1.9417,-0.1094 -3.5995,0.5012 -5.065,1.9863 -0.3114,-1.8313 -1.3463,-2.9248 -2.9217,-3.6262 -0.8242,-0.3645 -1.6577,-0.729 -2.2348,-1.5217 -0.403,-0.5646998 -0.5129,-1.1933998 -0.7144,-1.8129998 -0.1283,-0.3735 -0.2565,-0.7563 -0.687,-0.8201 -0.4671,-0.0728 -0.6503,0.3188 -0.8335,0.647 -0.7327,1.3394 -1.0166,2.8153998 -0.9892,4.3095998 0.0641,3.3621 1.4838,6.0406 4.3047,7.9449 0.3206,0.2187 0.403,0.4372 0.3023,0.7563 -0.1924,0.656 -0.4214,1.2937 -0.6228,1.9497 -0.1283,0.4192 -0.3207,0.5103 -0.7694,0.3279 -1.5479,-0.6467 -2.8852,-1.6035 -4.0667,-2.7605 -2.0058,-1.9407 -3.8193,-4.0818 -6.0815,-5.7583 -0.5312,-0.3918 -1.0625,-0.7561 -1.6121,-1.1025 -2.3081,-2.2412 0.3023,-4.0817998 0.9068,-4.3002998 0.6319,-0.2278 0.2198,-1.0115 -1.8227,-1.0022 -2.0425,0.009 -3.9109,0.6924 -6.2922,1.6034998 -0.348,0.1367 -0.7145,0.2368 -1.09,0.3188 -2.1615,-0.4098998 -4.4055,-0.5011998 -6.7502,-0.2368 -4.4147001,0.4919 -7.9408001,2.5784 -10.5328001,6.1409 -3.11399997,4.2822 -3.84669997,9.1474 -2.94909997,14.2224 0.94339997,5.3481 3.67269997,9.7761 7.86759997,13.2385 4.3506001,3.5896 9.3606001,5.3481 15.0758001,5.011 3.4713,-0.2004 7.3364,-0.665 11.6961,-4.355 1.099,0.5467 2.2531,0.7652 4.1674,0.9292 1.4746,0.1367 2.8943,-0.0728 3.9933,-0.3005 1.7219,-0.3645 1.6029,-1.959 0.9801,-2.2505 -5.0466,-2.3506 -3.9385,-1.394 -4.9459,-2.1685 2.5645,-3.0339 6.4297,-6.1865 7.9409,-16.4001 0.119,-0.8108 0.0183,-1.3211 0,-1.9771 -0.0092,-0.4008 0.0824,-0.5556 0.5404,-0.6013 1.2639,-0.1458 2.4912,-0.4919 3.6178,-1.1115 3.2698,-1.7857 4.5886,-4.7195 4.9,-8.2364 0.0459,-0.5376 -0.0091,-1.0935 -0.577,-1.3757 z m -28.4938,31.6518 c -4.8909,-3.8447 -7.263,-5.1113 -8.2431,-5.0566 -0.9159,0.0547 -0.751,1.1025 -0.5496,1.7859 0.2107,0.6741 0.4855,1.1389 0.8701,1.731 0.2656,0.3918 0.4489,0.9748 -0.2655,1.4123 -1.5754,0.9749 -4.314,-0.3281 -4.4423,-0.3918 -3.1872,-1.877 -5.8525001,-4.3553 -7.7302001,-7.7444 -1.8135,-3.262 -2.8667,-6.7605 -3.0408,-10.4961 -0.0458,-0.9019 0.2198,-1.221 1.1174,-1.3848 1.1815,-0.2187 2.3997,-0.2644 3.5812,-0.0913 4.9918001,0.729 9.2415001,2.9612 12.8043001,6.4963 2.0333,2.0135 3.572,4.419 5.1566,6.7696 1.6852,2.4963 3.4987,4.8745 5.8068,6.8242 0.8151,0.6833 1.4654,1.2026 2.0882,1.5854 -1.8775,0.2095 -5.01,0.2552 -7.1532,-1.4397 z m 2.3447,-15.0788 c 0,-0.4009 0.3206,-0.7197 0.7237,-0.7197 0.0916,0 0.174,0.018 0.2473,0.0453 0.1008,0.0366 0.1924,0.0913 0.2656,0.1731 0.1283,0.1277 0.2015,0.3098 0.2015,0.5012 0,0.4009 -0.3205,0.7197 -0.7234,0.7197 -0.4029,0 -0.7145,-0.3188 -0.7145,-0.7197 z m 7.2815,3.7356 c -0.4671,0.1914 -0.9342,0.3552 -1.383,0.3735 -0.6961,0.0364 -1.4563,-0.2461 -1.8684,-0.5923 -0.6411,-0.5376 -1.0991,-0.8381 -1.2914,-1.7766 -0.0825,-0.4009 -0.0367,-1.0205 0.0367,-1.3757 0.1648,-0.7654 -0.0184,-1.2573 -0.5587,-1.7039 -0.4397,-0.3645 -0.9984,-0.4646 -1.6121,-0.4646 -0.229,0 -0.4395,-0.1003 -0.5953,-0.1823 -0.2565,-0.1275 -0.467,-0.4464 -0.2656,-0.8382 0.0641,-0.1274 0.3756,-0.4373 0.4489,-0.4919 0.8335,-0.4739 1.7952,-0.3189 2.6836,0.0364 0.8244,0.3371 1.4472,0.9567 2.3447,1.8313 0.9159,1.0568 1.0807,1.3486 1.6028,2.1411 0.4123,0.6196 0.7878,1.2573 1.0442,1.9863 0.1557,0.4556 -0.0458,0.8291 -0.5862,1.0569 z"
id="path1"
style="stroke-width:1.0004;stroke-dasharray:none;fill:#000000" />
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

@@ -89,15 +89,17 @@
"sidebar": {
"ai": {
"extraGptModels": {
"oxygen3": {
"name": "Oxygen (GPT-3.5)",
"logo_name": "ai-oxygen-symbolic",
"description": "An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key",
"base_url": "https://app.oxyapi.uk/v1/chat/completions",
"key_get_url": "https://discord.com/invite/kM6MaCqGKA",
"key_file": "oxygen_key.txt",
"model": "gpt-3.5-turbo"
}
// Below is an example. Copy to user_options.jsonc and edit it
// The base url is conveniently ollama's btw
// "model_id": {
// "name": "User-added model",
// "logo_name": "ollama-symbolic",
// "description": "A model added by the user",
// "base_url": "http://localhost:11434/v1/chat/completions",
// "key_get_url": "",
// "key_file": "api_key_file.txt",
// "model": "model-name"
// },
}
},
"image": {
@@ -4,7 +4,9 @@ import { parseJSONC } from '../.miscutils/jsonc.js';
function overrideConfigRecursive(userOverrides, configOptions = {}) {
for (const [key, value] of Object.entries(userOverrides)) {
if (typeof value === 'object' && !(value instanceof Array)) {
if (typeof value === 'object'
&& !(value instanceof Array)
&& configOptions[key]) {
overrideConfigRecursive(value, configOptions[key]);
}
else {
+41 -41
View File
@@ -6,51 +6,51 @@ import GLib from 'gi://GLib';
import Soup from 'gi://Soup?version=3.0';
import { fileExists } from '../modules/.miscutils/files.js';
const PROVIDERS = Object.assign({ // There's this list hmm https://github.com/zukixa/cool-ai-stuff/
'openai': {
'name': 'OpenAI',
'logo_name': 'openai-symbolic',
'description': getString('Official OpenAI API.\nPricing: Free for the first $5 or 3 months, whichever is less.'),
'base_url': 'https://api.openai.com/v1/chat/completions',
'key_get_url': 'https://platform.openai.com/api-keys',
'key_file': 'openai_key.txt',
'model': 'gpt-3.5-turbo',
const PROVIDERS = Object.assign({
"openai": {
"name": "OpenAI",
"logo_name": "openai-symbolic",
"description": getString('Official OpenAI API.\nPricing: Free for the first $5 or 3 months, whichever is less.'),
"base_url": "https://api.openai.com/v1/chat/completions",
"key_get_url": "https://platform.openai.com/api-keys",
"key_file": "openai_key.txt",
"model": "gpt-3.5-turbo",
},
'ollama': {
'name': 'Ollama (Llama 3)',
'logo_name': 'ollama-symbolic',
'description': getString('Official Ollama API.\nPricing: Free.'),
'base_url': 'http://localhost:11434/v1/chat/completions',
'key_get_url': 'it\'s just ollama',
'key_file': 'ollama_key.txt',
'model': 'llama3:instruct',
"ollama": {
"name": "Ollama - Llama 3",
"logo_name": "ollama-symbolic",
"description": getString('Ollama - Llama-3'),
"base_url": 'http://localhost:11434/v1/chat/completions',
"key_get_url": "",
"key_file": "ollama_key.txt",
"model": "llama3:instruct",
},
'openrouter': {
'name': 'OpenRouter (Llama-3-70B)',
'logo_name': 'openrouter-symbolic',
'description': getString('A unified interface for LLMs'),
'base_url': 'https://openrouter.ai/api/v1/chat/completions',
'key_get_url': 'https://openrouter.ai/keys',
'key_file': 'openrouter_key.txt',
'model': 'meta-llama/llama-3-70b-instruct',
"ollama_deepseek_r1": {
"name": "Ollama - DeepSeek R1",
"logo_name": "deepseek-symbolic",
"description": getString('That popular Chinese model that thinks thoroughly'),
"base_url": "http://localhost:11434/v1/chat/completions",
"key_get_url": "",
"key_file": "ollama_key.txt",
"model": "deepseek-r1",
},
'oxygen4o': {
'name': 'Oxygen (GPT-4o)',
'logo_name': 'ai-oxygen-symbolic',
'description': getString('An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key'),
'base_url': 'https://app.oxyapi.uk/v1/chat/completions',
'key_get_url': 'https://discord.com/invite/kM6MaCqGKA',
'key_file': 'oxygen_key.txt',
'model': 'gpt-4o',
"ollama_gemma3": {
"name": "Ollama - Gemma 3",
"logo_name": "google-gemini-symbolic",
"description": getString('Gemma 3 from Google. Runs on a single GPU.'),
"base_url": "http://localhost:11434/v1/chat/completions",
"key_get_url": "",
"key_file": "ollama_key.txt",
"model": "gemma3",
},
'zukijourney': {
'name': 'zukijourney (GPT-3.5)',
'logo_name': 'ai-zukijourney',
'description': getString("An API from @zukixa on GitHub.\nNote: Keys are IP-locked so it's buggy sometimes\nPricing: Free: 10/min, 800/day.\nRequires you to join their Discord for a key"),
'base_url': 'https://zukijourney.xyzbot.net/v1/chat/completions',
'key_get_url': 'https://discord.com/invite/Y4J6XXnmQ6',
'key_file': 'zuki_key.txt',
'model': 'gpt-3.5-turbo',
"openrouter": {
"name": "OpenRouter (Llama-3-70B)",
"logo_name": "openrouter-symbolic",
"description": getString('A unified interface for LLMs'),
"base_url": "https://openrouter.ai/api/v1/chat/completions",
"key_get_url": "https://openrouter.ai/keys",
"key_file": "openrouter_key.txt",
"model": "meta-llama/llama-3-70b-instruct",
},
}, userOptions.sidebar.ai.extraGptModels)