Skip to content

refactor: remove Ollama and add custom provider configuration#546

Merged
echobt merged 5 commits intomasterfrom
feat/remove-ollama-add-custom-config-1769997616
Feb 2, 2026
Merged

refactor: remove Ollama and add custom provider configuration#546
echobt merged 5 commits intomasterfrom
feat/remove-ollama-add-custom-config-1769997616

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Feb 2, 2026

Summary

This PR removes the built-in Ollama provider and adds a flexible custom provider configuration system, allowing users to configure their own LLM providers.

Changes

New Features

  • ExecutionConfig: Runtime behavior settings (max threads, timeouts, streaming)
  • Custom Providers: User-defined LLM providers in config.toml
  • CLI Arguments: Runtime execution configuration overrides

Refactoring

  • Remove cortex-ollama crate entirely
  • Remove Ollama references from backend (engine, common, CLI, app-server)
  • Remove Ollama provider from GUI (frontend and Tauri backend)

Configuration Examples

Execution Config (config.toml)

[execution]
max_agent_threads = 4
max_tool_threads = 8
command_timeout_secs = 30
http_timeout_secs = 60
streaming_enabled = true

Custom Provider (config.toml)

[[providers]]
name = "my-local-llm"
base_url = "http://localhost:8080/v1"
api_type = "openai-compatible"
default_model = "llama3"

CLI Arguments

cortex --max-agent-threads 4 --command-timeout 60 --no-streaming

Testing

  • cargo check passes for all modified crates
  • All changes follow existing code patterns

Migration Notes

Users currently using Ollama can configure it as a custom provider with:

[[providers]]
name = "ollama"
base_url = "http://localhost:11434/v1"
api_type = "openai-compatible"

Add ExecutionConfig struct for controlling runtime execution:
- max_agent_threads: Maximum concurrent agent threads
- max_tool_threads: Maximum concurrent tool executions
- command_timeout_secs: Timeout for shell commands
- http_timeout_secs: Timeout for HTTP requests
- streaming_enabled: Enable/disable streaming responses

This allows users to customize execution behavior via config files.
Add CustomProviderConfig and CustomModelConfig types for user-defined
LLM providers in config.toml:
- base_url: Provider API endpoint
- api_type: openai/anthropic/openai-compatible
- api_key_env: Environment variable for API key
- default_model: Default model for provider
- models: Available models with capabilities
- headers: Custom HTTP headers

Enables users to add their own providers without code changes.
Add CLI arguments for controlling execution behavior:
- --max-agent-threads: Maximum concurrent agent threads
- --max-tool-threads: Maximum concurrent tool executions
- --command-timeout: Timeout for shell commands in seconds
- --http-timeout: Timeout for HTTP requests in seconds
- --no-streaming: Disable streaming responses

These arguments override config file settings at runtime.
Remove Ollama integration from the backend:
- Delete cortex-ollama crate entirely
- Remove from workspace members and dependencies
- Remove Ollama model presets from cortex-common
- Remove OllamaEmbedder from cortex-engine
- Remove Ollama provider references from CLI utilities
- Remove Ollama options from app-server config
- Clean up related imports and references

Users can now add custom local providers via the new
custom providers configuration system.
Remove all Ollama provider references from the GUI:
- Delete OllamaProvider.ts implementation
- Remove Ollama from AIProvider enum (backend)
- Remove Ollama from LLMProviderType union type
- Remove Ollama from provider configuration objects
- Remove Ollama from model selectors and settings
- Remove Ollama from onboarding wizard
- Update package-lock.json dependencies

The custom providers system now allows users to configure
local inference endpoints without built-in Ollama support.
@echobt echobt merged commit ba1993e into master Feb 2, 2026
2 of 4 checks passed
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