Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions ai-github-copilot-backend/ai-github-copilot-backend.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import QtQml 2.0
import QOwnNotesTypes 1.0

/**
* This script adds GitHub Models to QOwnNotes, allowing you to use AI models
* via your GitHub Copilot subscription through the GitHub Models inference API.
*
* Setup:
* 1. Install this script in QOwnNotes (Settings > Scripting)
* 2. Go to the script settings and enter your GitHub Personal Access Token
* (create one at https://github.com/settings/tokens — fine-grained
* with "Models: Read" permission, or a classic token)
* 3. Once the script is active, you can choose the "GitHub" backend and
* your preferred model
*
*/
Script {
property string githubToken;

property variant settingsVariables: [
{
"identifier": "githubToken",
"name": "GitHub Personal Access Token",
"description": "Enter your GitHub PAT (create at https://github.com/settings/tokens).\nFine-grained: enable 'Models: Read' permission.\nClassic: the 'models' scope is needed.",
"type": "string-secret",
"default": "",
}
];

function openAiBackendsHook() {
if (!githubToken || githubToken === "") {
return [];
}

return [
{
"id": "github-models",
"name": "GitHub",
"baseUrl": "https://models.inference.ai.azure.com/chat/completions",
"apiKey": githubToken,
"models": [
"gpt-4o",
"gpt-4o-mini",
"gpt-4.1",
"gpt-4.1-mini",
"gpt-4.1-nano",
"gpt-5",
"gpt-5-mini",
"gpt-5-nano",
"o4-mini",
"o3",
"o3-mini",
"o1",
"o1-mini",
"deepseek-r1",
"deepseek-r1-0528",
"deepseek-v3-0324",
"llama-4-scout-17b-16e-instruct",
"llama-4-maverick-17b-128e-instruct-fp8",
"llama-3.3-70b-instruct",
"grok-3",
"grok-3-mini",
"mistral-small-2503",
"phi-4",
"phi-4-reasoning",
],
}
];
}
}
10 changes: 10 additions & 0 deletions ai-github-copilot-backend/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "GitHub Models AI backend (via Copilot subscription)",
"identifier": "ai-github-copilot-backend",
"script": "ai-github-copilot-backend.qml",
"version": "0.0.1",
"minAppVersion": "24.6.3",
"authors": ["@nagelp"],
"platforms": ["linux", "macos", "windows"],
"description": "This script adds a <a href=\"https://github.com/marketplace/models\">GitHub</a> AI backend to QOwnNotes, allowing you to use AI models via your GitHub Copilot subscription through the GitHub Models inference API. You'll need a GitHub Personal Access Token (create at <a href=\"https://github.com/settings/tokens\">GitHub Settings</a>) with 'Models: Read' permission."
}
Loading