Repository navigation
fix(studio): enable local tool calling for OAI-compat remote models - #7330
Closed
Souravrajvi0 wants to merge 39 commits into
Closed
Souravrajvi0 wants to merge 39 commits into
Souravrajvi0 wants to merge 39 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7282 — Search, Code, and MCP were greyed out for remote Ollama / llama.cpp / vLLM / Custom Connections because Studio forced
supportsTools: falsefor every external model.Those tools still execute on the Studio host. This PR:
providerSupportsLocalToolRuntime)stream_external_local_tool_loop)enable_tools/enabled_tools/mcp_enabled/ permission fields from the chat adaptersupportsBuiltin*pathMotivation
Remote models already speak
/v1/chat/completionswith tools. Unsloth's Search / Code / MCP run locally, so any Connection with a correct OpenAI-compatible interface should be able to use them. The UI and backend were incorrectly treating “external” as “no local tools”.Test plan
studio/backend/tests/test_external_local_tool_loop.py(loop + Ollama proxy attaches local tools; OpenAI stays passthrough)test_confirm_tool_calls_allowed_for_oai_compat_local_tool_runtime/ existing hosted reject testtests/studio/test_chat_response_details_ui_contract.pytool_start/tool_end→ final answerollama/llama_cpp/vllm/customlight Search/Code/MCP viasupportsTools; Docs/RAG stay hidden for remotes127.0.0.1:11434reachable (/api/tags,/v1/models); installed models are tiny/non-tool-tuned, so the tool loop was exercised end-to-end through_proxy_to_external_providerwith an OAI-compat mock remote (provider_type=ollama) that emittedweb_searchtool_calls → localexecute_tool→tool_start/tool_endSSE → final answertools=Noneandenabled_toolsforwarded as hosted builtins onlyweb_search/web_fetch/code_execution/image_generationonly;python/terminalonly under the local-runtime arm