[FEATURE] Error message when local models are not supported
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I have been playing around with using Ollama with Claude Code, and was left confused when many of the models I was trying didn't work. Tool calling seems unsupported by models other than the one's listed in the documentation for setting up local models with Claude Code. The error for this is unhelpful, it spits out an API error which led me to believe there were API problems when, in fact, it was the model I was using all along causing my issues.
Proposed Solution
An error message clearly stating to choose a different, supported model would be most helpful so that users can clearly diagnose their issue without confusion.
Alternative Solutions
A popup screen when Claude Code starts alerting the user that tool calling is not supported by their model of choice. This would also help users learn of the issue before they even get an error message. This would also allow for a list of currently supported models to be displayed for the user to allow them to choose the right one.
Priority
High - Significant impact on productivity
Feature Category
API and model interactions
Use Case Example
User attempts to load Deepseek-coder-v2:latest on Ollama with Claude Code, a model for which tool calling is unsupported. The user would be alerted to this immediately, and able to exit and switch models without confusion.
Additional Context
_No response_
12 Comments
same here
When using ollama local models to run Claude Code, is anyone else facing this error ?
⚠ Auth conflict: Both a token (CLAUDE_CODE_OAUTH_TOKEN) and an API key (apiKeyHelper) are set. This may
lead to unexpected behavior.
• Trying to use CLAUDE_CODE_OAUTH_TOKEN? Unset the apiKeyHelper setting.
• Trying to use apiKeyHelper? Unset the CLAUDE_CODE_OAUTH_TOKEN environment variable
I think it's ANTHROPIC_API_KEY
@l3afyb0y : I logged out of Anthropic cloud api key and then used ollama running locally with this ENV setting below but i am still getting an error.
ollama pull qwen3-coder
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_BASE_URL=http://localhost:11434
claude --model qwen3-coder
Which size Qwen3 are you using? is it cloud, or is it local? Not all Qwen3-coder's are supported. I don't think they can make the right tool call in Claude Code
Try running "env" in terminal to check all current env variables. Fish has "universal" variables and are a pain to unset for some reason (took me forever to find them).
Wait, I notice you don't seem to have set ANTHROPIC_API_KEY=""
try exporting it.
@l3afyb0y : I am still having the error....any suggestions to install ollama based local model to claude in MACOS ?
I should've asked, what OS were you on before? Did you check with the 'env' command? What's the exact error message you're getting?
MacOS should be the same setup, because it uses zsh which is very similar to bash. I would check Ollama's website.
If you're on windows I don't think what I told you before is going to help, I'm unfamiliar with CMD/Pwsh's env commands, if there are any at all. There is, however, a GUI for Environment Variables on Windows, which you should be able to find either by searching that , or perhaps "Performance" because they are on the same page (Windows search is so finicky I can't remember what I used to look up for the GUI).
If it's Linux, you have an env set somewhere still. Or, the ~/.claude/.credentials.json needs to be reset. Try this
That'll backup your file, then when you restart Claude Code it'll reset, so if there's some Auth left in there that'll be removed, and if you have issues just remove the .bak off the end and replace the existing one.
Let me know which OS you're on and we can nail it in, my Claude Code is now working (no local models). I honestly recommend 3rd-party solutions like claude-code-router for this, because they seem to work better, and converts tool calls so any model can work with claude code.
Yes, i am using MACOS and i did check env. I did unset the env key for Anthropic but still getting the same error. i am following these instructions s://ollama.com/blog/claude
@l3afyb0y : Team, I am still having this error where Ollama based local model is not able to run with claude. is there any specific debugging as I tried many other options to resolve it but no luck so far.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.