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.
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 |