Skip to content

Conversation

@laterya
Copy link

@laterya laterya commented Nov 23, 2025

Summary

Adds support for Ollama Cloud integration in Spring AI by enabling API key-based authentication and allowing configuration of remote Ollama endpoints (e.g., https://ollama.com/api). This enables users to seamlessly use Ollama’s cloud-hosted large language models—such as gpt-oss:120b-cloud or qwen3-coder:480b-cloud—within Spring AI applications without requiring local GPU resources.

See Ollama Cloud documentation for details on available cloud models and authentication requirements.

Changes

  • Added spring.ai.ollama.api-key configuration property
  • Extended [OllamaConnectionDetails] interface with [getApiKey()] method (default null)
  • Modified [OllamaApiAutoConfiguration] to inject Authorization: Bearer header when API key is present

Configuration Example

spring:
  ai:
    ollama:
      base-url: https://ollama.com/api
      api-key: ${OLLAMA_API_KEY}

@laterya laterya force-pushed the feature/ollama-api-key-support branch from 9af468d to b773fe2 Compare November 23, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant