configure_llm
Selects a project's LLM profile and embedding model, writes them to the gitignored local config, and tests the setup by making an API call; restores the previous config if the test fails.
Instructions
Select the LLM profile (and the embedding model) of the current project.
Writes to <project>/.fw-context/local.toml ONLY (gitignored,
per-developer). Does NOT modify the global config or the shared
project config.toml. The profiles themselves are in the global
config, and only the operator writes them (fw-context llm setup
or fw-context init): this
tool takes no URL and no API key. After writing, tests the
configuration by making a simple API call (skipped when LLM is
disabled). When the test fails, the previous local.toml is
restored and status is "error". A call with no change returns
"error" and writes nothing.
WHY no URL and no key here (since the profiles, 2026-10-20): a key that an MCP call writes passes through the conversation of the LLM client, and a URL that a tool call sets can send the source code to any host.
Args:
project_root: Project root directory. Auto-detected if omitted.
project: Project name or project_id — call list_projects to get them. Use
it to ask about a project that is not the project of the current
directory. It is an alternative to project_root, which takes a root
path. Give one of the two, not both.
profile: The name of a profile of the global config.
embed_model: Embedding model: an Ollama tag, a sentence-transformers
name (BAAI/..., needs the st extra), or ft://.
Returns: dict: {status ("ok"|"error"), profile (str), provider (str), chat_api (dict — configured, endpoint, format, model), model (str), auto_pull (bool), stream (bool), context (int, for a profile of an API or of the ChatGPT plan: the context of the model in tokens), test_latency_s (float, on success), test_response (str, on success), compliance_warning (str, when the chat goes to another host), message (str)}
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "configure_llm"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | The LLM profile of this project: the name of a [llm.profiles.<name>] table of the global config (~/.fw-context/config.toml). None = keep the current profile. A project selects an external profile (an API, the ChatGPT plan, a cloud model of Ollama) or the Ollama profile of this machine; another Ollama profile gives an error. WARNING: a profile whose server is not this machine sends source code to that host. | |
| project | No | Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both. | |
| embed_model | No | Embedding model: an Ollama tag, a sentence-transformers name (e.g. 'BAAI/bge-small-en-v1.5'), or 'ft://latest'. None = keep current. | |
| project_root | No | Project root. Auto-detected if omitted. This field also accepts a project name or a project_id, but project is the clear field for those. |