Skip to content

Ollama Turbo (Cloud) Compatibility #80

@gbsierra

Description

@gbsierra

Ollama Turbo Compatibility Fix Plan

Issue

Users cannot use Ollama Turbo (cloud service) with BrowserOS because:

  • ollama type forces localhost and lacks cloud API key support
  • openai_compatible and custom types force /v1 path and use wrong client
  • No existing provider handles Ollama Turbo's requirements properly

Current State

Provider Type Client Base URL API Key Works for Ollama Turbo?
ollama ChatOllama localhost:11434 ❌ No ❌ (localhost only)
openai_compatible ChatOpenAI forces /v1 ✅ Yes ❌ (wrong client/format)
custom ChatOpenAI forces /v1 ✅ Yes ❌ (same as above)

Proposed Solution

Nothing changes for existing users. Only when users select ollama type and set a non-localhost base URL, then API key support is enabled.

Detection Logic

private _isLocalOllama(baseUrl: string): boolean {
  if (!baseUrl) return true // Default is local (localhost:11434)

  return baseUrl.includes('localhost') ||
         baseUrl.includes('127.0.0.1') ||
         baseUrl.includes('0.0.0.0') ||
         !baseUrl.includes('://') // relative URLs like 'localhost:8080'
}

// Usage:
if (this._isLocalOllama(provider.baseUrl)) {
  // Local Ollama - current behavior (no API key needed)
} else {
  // Cloud Ollama - add API key support
}

Detection Examples:

Base URL Detected As Behavior
"" (blank) Local Uses localhost:11434, no API key
"localhost:11434" Local No API key
"127.0.0.1:8080" Local No API key
"https://ollama.com" Cloud 🚀 Enables API key support
"https://api.ollama.com" Cloud 🚀 Enables API key support
"192.168.1.100:11434" Cloud 🚀 Enables API key support

Implementation

  • Existing local users: Zero changes to workflow
  • New cloud users: Set non-localhost URL + API key
  • Smart detection: Automatic based on URL
  • Backward compatibility: 100%

User Experience

Local Ollama (unchanged):

Type: ollama
Base URL: http://localhost:11434 (or blank)
API Key: (not required)

Ollama Turbo (new capability):

Type: ollama
Base URL: https://ollama.com
API Key: [user's Ollama Turbo key]

Benefits

  • ✅ No new provider types needed
  • ✅ Backward compatible with existing local Ollama users
  • ✅ Clear, intuitive user experience
  • ✅ Extensible for other cloud Ollama services
  • ✅ Fixes Ollama Turbo compatibility

Implementation Steps

  1. Add localhost detection logic to _createOllamaLLM
  2. Add API key header support for cloud services
  3. Test with both local and cloud Ollama endpoints
  4. Update documentation for users

Risks

  • Edge cases with local network Ollama instances
  • API format differences between local and cloud Ollama
  • Need to verify Ollama Turbo's exact auth requirements

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions