http://localhost:5000
Endpoint: GET /api/connection
Description: Checks the connection to the local Ollama server.
Response:
- 200 OK - Server is reachable.
- 404 ERROR - Server is unreachable.
Example Response:
{
"host": "localhost",
"port": 11434,
"status": "OK"
}Endpoint: GET /api/connection/stats
Description: Returns available and active AI models.
Response:
- 200 OK - Returns list of models.
- 404 ERROR - No models found.
Example Response:
{
"available": ["model1", "model2"],
"active": ["model1"]
}Endpoint: POST /api/chat
Description: Sends a chat request to the AI model and returns a response. Ensure that the selected model is available before making a request.
Request Body:
{
"model": "model_name",
"prompt": "Hello AI!"
}Response:
- 200 OK - Successful response from AI.
- 400 ERROR - Invalid request data.
Example Response:
{
"response": "Hello, how can I assist you today?"
}- The Ollama server is expected to be running on
http://localhost:11434. - Requests to
/api/chatare processed asynchronously using a queue.