Skip to content

Commit 3145ea4

Browse files
committed
feat: mindsdb service
1 parent 3f34c58 commit 3145ea4

File tree

10 files changed

+203
-2
lines changed

10 files changed

+203
-2
lines changed

app/src/serviceMetadata.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,5 +594,9 @@ export const serviceMetadata: Record<string, Partial<HarborService>> = {
594594
tags: [HST.satellite],
595595
wikiUrl: `${wikiUrl}/2.3.56-Satellite-Drawio`,
596596
tooltip: 'AI-powered diagram creation tool - generate draw.io diagrams from natural language.'
597-
},
598-
};
597+
}, mindsdb: {
598+
name: 'MindsDB',
599+
tags: [HST.satellite, HST.api],
600+
wikiUrl: `${wikiUrl}/2.3.57-Satellite-MindsDB`,
601+
tooltip: 'AI platform for integrating ML models with data sources via HTTP and MySQL APIs.',
602+
},};

compose.mindsdb.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
services:
2+
mindsdb:
3+
container_name: ${HARBOR_CONTAINER_PREFIX}.mindsdb
4+
image: ${HARBOR_MINDSDB_IMAGE}:${HARBOR_MINDSDB_VERSION}
5+
env_file:
6+
- ./.env
7+
- ./mindsdb/override.env
8+
volumes:
9+
- ${HARBOR_MINDSDB_WORKSPACE}:/root/mdb_storage
10+
ports:
11+
- ${HARBOR_MINDSDB_HOST_PORT}:47334
12+
- ${HARBOR_MINDSDB_MYSQL_HOST_PORT}:47335
13+
environment:
14+
- MINDSDB_APIS=${HARBOR_MINDSDB_APIS}
15+
- MINDSDB_USERNAME=${HARBOR_MINDSDB_USERNAME}
16+
- MINDSDB_PASSWORD=${HARBOR_MINDSDB_PASSWORD}
17+
- MKL_SERVICE_FORCE_INTEL=1
18+
healthcheck:
19+
test: ["CMD", "curl", "-f", "http://localhost:47334/api/status"]
20+
interval: 30s
21+
timeout: 10s
22+
retries: 3
23+
start_period: 60s
24+
networks:
25+
- harbor-network

compose.x.mindsdb.llamacpp.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
mindsdb:
3+
environment:
4+
- LLM_FUNCTION_BASE_URL=http://llamacpp:8080/v1
5+
- OPENAI_API_KEY=sk-llamacpp

compose.x.mindsdb.ollama.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
mindsdb:
3+
environment:
4+
- LLM_FUNCTION_BASE_URL=${HARBOR_OLLAMA_INTERNAL_URL}/v1
5+
- LLM_FUNCTION_MODEL=${HARBOR_MINDSDB_OLLAMA_MODEL}
6+
- OPENAI_API_KEY=sk-ollama

compose.x.mindsdb.vllm.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
mindsdb:
3+
environment:
4+
- LLM_FUNCTION_BASE_URL=http://vllm:8000/v1
5+
- OPENAI_API_KEY=sk-vllm

docs/2.3.57-Satellite-MindsDB.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
### [MindsDB](https://github.com/mindsdb/mindsdb)
2+
3+
> Handle: `mindsdb`<br/>
4+
> URL: [http://localhost:34581](http://localhost:34581)
5+
6+
![MindsDB Screenshot](./harbor-mindsdb.png)
7+
8+
MindsDB is an AI platform that enables querying AI models using SQL. Harbor integrates MindsDB with local LLM backends (Ollama, llama.cpp, vLLM) so you can build AI-powered applications without external API dependencies.
9+
10+
## Starting
11+
12+
```bash
13+
# Start MindsDB with Ollama
14+
harbor up mindsdb ollama
15+
16+
# Or with other backends
17+
harbor up mindsdb llamacpp
18+
harbor up mindsdb vllm
19+
```
20+
21+
## Configuration
22+
23+
Following options can be set via [`harbor config`](./3.-Harbor-CLI-Reference.md#harbor-config):
24+
25+
```bash
26+
# Ports
27+
HARBOR_MINDSDB_HOST_PORT 34581
28+
HARBOR_MINDSDB_MYSQL_HOST_PORT 34582
29+
30+
# Docker image
31+
HARBOR_MINDSDB_IMAGE mindsdb/mindsdb
32+
HARBOR_MINDSDB_VERSION latest
33+
34+
# Persistent storage
35+
HARBOR_MINDSDB_WORKSPACE ./mindsdb/data
36+
37+
# APIs to expose (http, mysql, postgres)
38+
HARBOR_MINDSDB_APIS http,mysql
39+
40+
# Authentication (optional)
41+
HARBOR_MINDSDB_USERNAME ""
42+
HARBOR_MINDSDB_PASSWORD ""
43+
44+
# Default Ollama model for LLM() function
45+
HARBOR_MINDSDB_OLLAMA_MODEL llama3.1:8b
46+
```
47+
48+
## LLM Integration
49+
50+
When running MindsDB with a Harbor LLM backend, the `LLM()` function is automatically configured:
51+
52+
| Backend | Base URL | Model | API Key |
53+
|---------|----------|-------|---------|
54+
| Ollama | `http://ollama:11434/v1` | `HARBOR_MINDSDB_OLLAMA_MODEL` | `sk-ollama` |
55+
| llama.cpp | `http://llamacpp:8080/v1` | (loaded model) | `sk-llamacpp` |
56+
| vLLM | `http://vllm:8000/v1` | (loaded model) | `sk-vllm` |
57+
58+
### Using LLM() Function
59+
60+
```sql
61+
-- Text generation
62+
SELECT LLM('What is the capital of France?');
63+
64+
-- Process data
65+
SELECT LLM('Summarize: ' || content) FROM articles;
66+
```
67+
68+
### Creating Agents
69+
70+
Agents query data sources using natural language. Specify the Harbor backend configuration:
71+
72+
```sql
73+
CREATE AGENT mindsdb.my_agent
74+
USING
75+
model = {
76+
"provider": "ollama",
77+
"model_name": "llama3.1:8b",
78+
"api_key": "sk-ollama",
79+
"base_url": "http://ollama:11434"
80+
},
81+
data = {
82+
"tables": ["my_database.my_table"]
83+
};
84+
```
85+
86+
### Creating ML Engines
87+
88+
Create ML engines to use Harbor backends in models:
89+
90+
```sql
91+
-- Ollama engine
92+
CREATE ML_ENGINE ollama_engine
93+
FROM ollama
94+
USING
95+
ollama_serve_url = 'http://ollama:11434';
96+
97+
-- llama.cpp (OpenAI-compatible)
98+
CREATE ML_ENGINE llamacpp_engine
99+
FROM openai
100+
USING
101+
openai_api_base = 'http://llamacpp:8080/v1',
102+
openai_api_key = 'sk-llamacpp';
103+
104+
-- vLLM (OpenAI-compatible)
105+
CREATE ML_ENGINE vllm_engine
106+
FROM openai
107+
USING
108+
openai_api_base = 'http://vllm:8000/v1',
109+
openai_api_key = 'sk-vllm';
110+
```
111+
112+
> **Note**: The `LLM()` function configuration is separate from the "Default MindsDB Configuration" UI settings. UI settings (Settings → Models) are for agents/knowledge bases and persist in `./mindsdb/data`.
113+
114+
## Connecting to Harbor Services
115+
116+
Use Docker network hostnames to connect MindsDB to other Harbor services:
117+
118+
```sql
119+
-- Connect to a database running in Harbor
120+
CREATE DATABASE harbor_postgres
121+
WITH ENGINE = 'postgres',
122+
PARAMETERS = {
123+
"host": "postgres",
124+
"port": "5432",
125+
"database": "mydb",
126+
"user": "user",
127+
"password": "password"
128+
};
129+
```
130+
131+
## MySQL API
132+
133+
Connect to MindsDB using MySQL clients for BI tools and integrations:
134+
135+
```bash
136+
mysql -h 127.0.0.1 -P 34582
137+
```

docs/harbor-mindsdb.png

386 KB
Loading

mindsdb/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data/

mindsdb/override.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# MindsDB service environment variables
2+
# Configure APIs to expose (http, mysql, postgres)
3+
# MINDSDB_APIS=http,mysql
4+
5+
# Optional authentication
6+
# MINDSDB_USERNAME=admin
7+
# MINDSDB_PASSWORD=

profiles/default.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,17 @@ HARBOR_DRAWIO_AI_MODEL="qwen3:30b"
774774
HARBOR_DRAWIO_TEMPERATURE=""
775775
HARBOR_DRAWIO_ACCESS_CODE=""
776776

777+
# MindsDB
778+
HARBOR_MINDSDB_HOST_PORT=34581
779+
HARBOR_MINDSDB_MYSQL_HOST_PORT=34582
780+
HARBOR_MINDSDB_IMAGE="mindsdb/mindsdb"
781+
HARBOR_MINDSDB_VERSION="latest"
782+
HARBOR_MINDSDB_WORKSPACE="./mindsdb/data"
783+
HARBOR_MINDSDB_APIS="http,mysql"
784+
HARBOR_MINDSDB_USERNAME=""
785+
HARBOR_MINDSDB_PASSWORD=""
786+
HARBOR_MINDSDB_OLLAMA_MODEL="llama3.1:8b"
787+
777788
# ============================================
778789
# Service Configuration.
779790
# You can specify any of the service's own environment variables here.

0 commit comments

Comments
 (0)