This commit is contained in:
Dalton Alexandre 2025-12-23 15:41:56 +08:00 committed by GitHub
commit b0efa2f221
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 0 deletions

View file

@ -276,6 +276,7 @@ export const AuthLoginCommand = cmd({
google: 4,
openrouter: 5,
vercel: 6,
"ollama-cloud": 7,
}
let provider = await prompts.autocomplete({
message: "Select provider",
@ -297,6 +298,10 @@ export const AuthLoginCommand = cmd({
}[x.id],
})),
),
{
value: "ollama-cloud",
label: "Ollama Cloud",
},
{
value: "other",
label: "Other",
@ -341,6 +346,12 @@ export const AuthLoginCommand = cmd({
return
}
if (provider === "ollama-cloud") {
prompts.log.info("1. Go to https://ollama.com/ and sign in")
prompts.log.info("2. Navigate to Settings > Keys and generate a new API key")
prompts.log.info("3. Copy the API key and paste it below")
}
if (provider === "opencode") {
prompts.log.info("Create an api key at https://opencode.ai/auth")
}

View file

@ -271,6 +271,13 @@ export namespace Provider {
},
}
},
"ollama-cloud": async () => {
const hasKey = await Auth.get("ollama-cloud")
return {
autoload: Boolean(hasKey),
options: {},
}
},
"google-vertex": async () => {
const project = Env.get("GOOGLE_CLOUD_PROJECT") ?? Env.get("GCP_PROJECT") ?? Env.get("GCLOUD_PROJECT")
const location = Env.get("GOOGLE_CLOUD_LOCATION") ?? Env.get("VERTEX_LOCATION") ?? "us-east5"
@ -532,6 +539,18 @@ export namespace Provider {
const configProviders = Object.entries(config.provider ?? {})
// Add Ollama Cloud provider
if (!database["ollama-cloud"]) {
database["ollama-cloud"] = {
id: "ollama-cloud",
name: "Ollama Cloud",
env: [],
npm: "@ai-sdk/openai-compatible",
api: "https://api.ollama.com/v1",
models: {},
}
}
// Add GitHub Copilot Enterprise provider that inherits from GitHub Copilot
if (database["github-copilot"]) {
const githubCopilot = database["github-copilot"]