Skip to content

Conversation

@pzabalegui
Copy link
Contributor

…lama

When using OLLAMA_API_BASE, model selection by number was incorrect. /model-show displayed Ollama models with certain numbers, but /model selected different models from LiteLLM instead.

This happened because both commands used separate caches with inconsistent numbering. Now they share a global cache that loads models in consistent order: predefined → LiteLLM → Ollama.

Fixes model number mismatch when selecting Ollama models by number.

…lama

When using OLLAMA_API_BASE, model selection by number was incorrect.
/model-show displayed Ollama models with certain numbers, but /model <number>
selected different models from LiteLLM instead.

This happened because both commands used separate caches with inconsistent
numbering. Now they share a global cache that loads models in consistent order:
predefined → LiteLLM → Ollama.

Fixes model number mismatch when selecting Ollama models by number.
@UnaiAlias UnaiAlias merged commit 7c2267d into aliasrobotics:main Dec 10, 2025
1 check passed
pzabalegui added a commit to pzabalegui/cai that referenced this pull request Dec 10, 2025
- Added support for Ollama Cloud models via AsyncOpenAI
- Models use ollama_cloud/ prefix (e.g., ollama_cloud/gpt-oss:120b)
- Reads OLLAMA_API_KEY and OLLAMA_API_BASE for cloud authentication
- Added predefined Ollama Cloud models to /model-show
- Filtered obsolete ollama/*-cloud models from LiteLLM database
- Updated authentication headers in completer, banner, and toolbar
- Added concise English documentation in docs/providers/
- Adapted to new global model cache architecture from aliasrobotics#371

Modified files:
- src/cai/sdk/agents/models/openai_chatcompletions.py
- src/cai/repl/commands/model.py (adapted to global cache)
- src/cai/util.py
- src/cai/repl/commands/completer.py
- src/cai/repl/ui/banner.py
- src/cai/repl/ui/toolbar.py
- docs/providers/ollama.md
- docs/providers/ollama_cloud.md

All existing functionality preserved (backward compatible).
UnaiAlias pushed a commit that referenced this pull request Dec 10, 2025
* feat: Add Ollama Cloud integration with ollama_cloud/ prefix

- Added support for Ollama Cloud models via AsyncOpenAI
- Models use ollama_cloud/ prefix (e.g., ollama_cloud/gpt-oss:120b)
- Reads OLLAMA_API_KEY and OLLAMA_API_BASE for cloud authentication
- Added predefined Ollama Cloud models to /model-show
- Filtered obsolete ollama/*-cloud models from LiteLLM database
- Updated authentication headers in completer, banner, and toolbar
- Added concise English documentation in docs/providers/
- Adapted to new global model cache architecture from #371

Modified files:
- src/cai/sdk/agents/models/openai_chatcompletions.py
- src/cai/repl/commands/model.py (adapted to global cache)
- src/cai/util.py
- src/cai/repl/commands/completer.py
- src/cai/repl/ui/banner.py
- src/cai/repl/ui/toolbar.py
- docs/providers/ollama.md
- docs/providers/ollama_cloud.md

All existing functionality preserved (backward compatible).

* fix: Add missing Ollama Cloud models and get_ollama_auth_headers

- Added Ollama Cloud models to get_predefined_model_categories()
- Added get_ollama_auth_headers() function to util.py
- Added Ollama Cloud to category_to_provider mapping
- Imported get_ollama_auth_headers in model.py

This fixes the issue where predefined models weren't showing in /model-show.

* fix: Display predefined models first in /model-show

- Added loop to display predefined models (Alias, Claude, OpenAI, DeepSeek, Ollama Cloud) before LiteLLM models
- Models #1-14 now correctly show predefined models
- LiteLLM models start from #15+ as expected
- Added get_ollama_auth_headers() function in util.py for Ollama Cloud auth
- Fixed model numbering to be consistent with global cache

This resolves the issue where predefined models were skipped and only LiteLLM models appeared starting from #15.

* fix: Restore correct import of cai.caibench instead of pentestperf

During rebase, the import was incorrectly changed from 'import cai.caibench as ptt'
to 'import pentestperf as ptt'. This commit restores the correct import.

The original code uses cai.caibench, not an external pentestperf module.
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.

2 participants