Add local model support via Ollama#44
Conversation
0efa588 to
91944bc
Compare
|
Thank you @statikkkkk for the review. I have addressed the security concerns and the documentation feedback. I also took the opportunity to reapply these features on top of the latest upstream
The branch has been force-pushed with a clean, rebased history. |
|
@claude please review this PR. Focus on correctness, security, LiteLLM/Bedrock routing impact, and whether it's safe to merge against current main. Keep it concise and prefer inline comments where it matters. |
|
Claude finished @akseljoonas's task in 2m 24s —— View job PR Review: Add local model support via Ollama
Verdict: NEEDS CHANGES — The SSRF mitigation in Security[MEDIUM] Backend guard is incomplete —
# POST /api/session — no ollama guard, ollama/qwen3.6 is in valid_ids
valid_ids = {m["id"] for m in AVAILABLE_MODELS} # ← includes ollama/qwen3.6
if model and model not in valid_ids: # passes if model == "ollama/qwen3.6"
raise HTTPException(...)Same gap in [LOW]
Correctness[HIGH] Blocking I/O in async
[MEDIUM] completed = data.get("completed") # can be None
total = data.get("total")
if status != last_status:
if total:
percent = (completed / total) * 100 # ← TypeError if completed is NoneOllama emits [LOW] Unrendered Rich markup in print(f"\n[bold red]Error:[/bold red] Ollama server is not reachable.")
LiteLLM / Bedrock routing impactNo regressions. The The Minor nits
SummaryThe core feature is well-structured and the SSRF concern from the first review was thoughtfully addressed in |
|
I have addressed all the security and correctness concerns in the latest
I have verified these fixes with a regression test suite covering headless execution, interactive mode overrides, |
a21980d to
48e4bb9
Compare
Summary
This PR adds support for running the agent with local models via Ollama. It enables users to use the intern without incurring API costs or requiring external API keys for inference.
Key Changes
tool-calling reliability.
ollama serveis running and if the requested model isavailable locally.
/add-model <id>command to dynamically add new local models during a session.HF_TOKENoptional when using local models (prefixedwith
ollama/).How to test
ollama serve).ml-intern./model ollama/qwen3.6(or use/add-model).