Chat with model
chat_with_modelSend chat completion requests to local AI models on Local AI, MLX, or Llama.cpp backends; returns backend JSON or errors when the service is unavailable.
Instructions
Send a chat completion to a local model on Local AI, MLX or Llama.cpp. Use list_models first if you need names. Use ask_frontier for a cloud model. Calls the local OpenAI-compatible /v1/chat/completions endpoint. Not read-only. Returns the backend JSON or an error when the service is down.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"messages": "<messages>"
},
"name": "chat_with_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model name as listed by list_models for that backend. | |
| backend | No | Inference backend. One of local_ai, mlx, llamacpp. Default local_ai. | local_ai |
| messages | Yes | Chat messages. Each object needs role (system, user or assistant) and content. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |