fix: update Qwen OAuth URLs from chat.qwen.ai to qwen.ai (closes #572) (#683)

* fix: make version update banner clickable to copy install command (closes #598)

* fix: resolve ollama-local baseUrl from providerSpecificData.baseUrl for remote Ollama hosts (closes #578)

* fix: add Ollama Cloud to usage/quota tracking (closes #681)

* fix: update Qwen OAuth URLs from chat.qwen.ai to qwen.ai per issue #572
This commit is contained in:
Anurag Saxena
2026-04-21 23:32:28 -04:00
committed by GitHub
parent 37f7e97348
commit 94ab0d715d
5 changed files with 67 additions and 6 deletions

View File

@@ -58,6 +58,8 @@ export async function getUsageForProvider(connection) {
return await getQwenUsage(accessToken, providerSpecificData);
case "iflow":
return await getIflowUsage(accessToken);
case "ollama":
return await getOllamaUsage(accessToken);
default:
return { message: `Usage API not implemented for ${provider}` };
}
@@ -719,3 +721,25 @@ async function getIflowUsage(accessToken) {
return { message: "Unable to fetch iFlow usage." };
}
}
/**
* Ollama Cloud Usage
* Ollama Cloud uses an API key from ollama.com/settings/keys
* and has no public usage API — free tier has light usage limits (resets every 5h & 7d).
* This returns an informational message with the plan details.
*/
async function getOllamaUsage(accessToken, providerSpecificData) {
try {
// Ollama Cloud does not expose a public quota/usage API.
// The provider is configured as noAuth with a notice explaining limits.
// We return a graceful message so the UI shows a friendly state instead of an error.
const plan = providerSpecificData?.plan || "Free";
return {
plan,
message: "Ollama Cloud uses a free tier with light usage limits (resets every 5h & 7d). For detailed usage tracking, visit ollama.com/settings/keys.",
quotas: [],
};
} catch (error) {
return { message: "Unable to fetch Ollama Cloud usage." };
}
}