Ollama v0.14.0 and later introduce compatibility with the Anthropic Messages API. This update enables the use of agentic coding tools such as Claude Code with open-source models hosted locally or via Ollama's cloud services.
Users can configure the environment to point the Anthropic SDK to a local Ollama instance by setting ANTHROPIC_BASE_URL to http://localhost:11434. The API key parameter in requests is required but ignored when connecting through Ollama.
For optimal performance with agent workflows, it is recommended to run models with at least 32K tokens context length. Ollama's cloud models operate at their full context length, while local configurations require specific attention to context window settings.
Tool calling functionality remains supported. Models can interact with external systems using tool definitions that include descriptions and parameters, such as retrieving weather data for a specified city and state.
Source: https://ollama.com/blog/claude



