datahub-cli 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/CHANGELOG.md +8 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/PKG-INFO +116 -5
- datahub_cli-0.2.1/README.md +199 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/pyproject.toml +5 -3
- datahub_cli-0.2.1/src/datahub/archive.py +349 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/catalog.py +234 -157
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/cli.py +103 -4
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/config.py +56 -19
- datahub_cli-0.2.1/src/datahub/discover.py +196 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/hardware.py +99 -17
- datahub_cli-0.2.1/src/datahub/mcp_server.py +155 -0
- datahub_cli-0.2.1/src/datahub/preview.py +218 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/providers.py +141 -3
- datahub_cli-0.2.1/src/datahub/remotes.py +161 -0
- datahub_cli-0.2.1/src/datahub/runner.py +90 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/tui.py +234 -12
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/tests/test_config.py +15 -0
- datahub_cli-0.2.1/tests/test_dataset_stats.py +77 -0
- datahub_cli-0.2.1/tests/test_discovery.py +84 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/tests/test_scoring.py +30 -3
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/tests/test_tui.py +53 -0
- datahub_cli-0.2.1/tests/test_v03_commands.py +153 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/uv.lock +112 -2
- datahub_cli-0.2.0/README.md +0 -94
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/.github/workflows/ci.yml +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/.github/workflows/publish.yml +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/.gitignore +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/LICENSE +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/__init__.py +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/ollama_search.py +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/progress.py +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/py.typed +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/src/datahub/scoring.py +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/tests/test_ollama.py +0 -0
- {datahub_cli-0.2.0 → datahub_cli-0.2.1}/tests/test_progress.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- Resolve Hugging Face dataset sizes and format exact row counts and scale ranges. Enrich visible rows asynchronously in the terminal UI.
|
|
6
|
+
- Scan multiple roots recursively, discover local cache stores in place, register external paths, and retain offline items with their cached schemas.
|
|
7
|
+
- Detect Windows RAM through the native API and expand Windows and Linux GPU detection to AMD and Intel devices.
|
|
8
|
+
- Add a read-only stdio MCP server, dataset previews and DuckDB queries, and local model launch with dry-run commands.
|
|
9
|
+
- Add content verification, duplicate reports, verified archive and restore, and remote transfers with manifests.
|
|
10
|
+
|
|
3
11
|
## 0.2.0
|
|
4
12
|
|
|
5
13
|
- Show pull progress, transfer speed, ETA, and indexing status in the CLI and TUI when the provider supplies progress details.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datahub-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Local data catalog and hardware-aware model discovery
|
|
5
5
|
Project-URL: Homepage, https://github.com/tyler-ungerman/data-hub
|
|
6
6
|
Project-URL: Repository, https://github.com/tyler-ungerman/data-hub
|
|
@@ -23,15 +23,21 @@ Requires-Dist: rich>=13.3.3
|
|
|
23
23
|
Requires-Dist: textual>=0.80.0
|
|
24
24
|
Requires-Dist: tqdm>=4.42.1
|
|
25
25
|
Provides-Extra: all
|
|
26
|
+
Requires-Dist: duckdb>=1.1.0; extra == 'all'
|
|
26
27
|
Requires-Dist: kaggle>=1.6.0; extra == 'all'
|
|
27
28
|
Requires-Dist: onnxruntime>=1.18.0; extra == 'all'
|
|
28
29
|
Requires-Dist: pyarrow>=15.0.0; extra == 'all'
|
|
30
|
+
Requires-Dist: zstandard>=0.22; extra == 'all'
|
|
31
|
+
Provides-Extra: duckdb
|
|
32
|
+
Requires-Dist: duckdb>=1.1.0; extra == 'duckdb'
|
|
29
33
|
Provides-Extra: kaggle
|
|
30
34
|
Requires-Dist: kaggle>=1.6.0; extra == 'kaggle'
|
|
31
35
|
Provides-Extra: onnx
|
|
32
36
|
Requires-Dist: onnxruntime>=1.18.0; extra == 'onnx'
|
|
33
37
|
Provides-Extra: parquet
|
|
34
38
|
Requires-Dist: pyarrow>=15.0.0; extra == 'parquet'
|
|
39
|
+
Provides-Extra: zstandard
|
|
40
|
+
Requires-Dist: zstandard>=0.22; extra == 'zstandard'
|
|
35
41
|
Description-Content-Type: text/markdown
|
|
36
42
|
|
|
37
43
|
# DataHub CLI
|
|
@@ -40,7 +46,7 @@ DataHub is a terminal tool for finding models and datasets, estimating which mod
|
|
|
40
46
|
|
|
41
47
|
## Install
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
Install DataHub CLI from PyPI. Use `dhub` if Acryl Data’s `acryl-datahub` package already provides a `datahub` command on your PATH.
|
|
44
50
|
|
|
45
51
|
```sh
|
|
46
52
|
uv tool install datahub-cli
|
|
@@ -48,9 +54,9 @@ uvx datahub-cli
|
|
|
48
54
|
pip install datahub-cli
|
|
49
55
|
```
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
DataHub requires Python 3.11 or newer. `uv tool install` makes both `dhub` and `datahub` available from any terminal without activating an environment.
|
|
52
58
|
|
|
53
|
-
Optional extras
|
|
59
|
+
Optional extras include `parquet` and `onnx` for schema inspection, `kaggle` for Kaggle transfers, `duckdb` for SQL and Parquet previews, and `zstandard` for compressed archives. Install several with `uv tool install 'datahub-cli[duckdb,zstandard]'`, or use `datahub-cli[all]`.
|
|
54
60
|
|
|
55
61
|
## Quickstart
|
|
56
62
|
|
|
@@ -80,7 +86,8 @@ Use `--one-page` for a JSON page with a `next_cursor`, then pass it to `--cursor
|
|
|
80
86
|
| `Enter` in a search field | Search and focus results |
|
|
81
87
|
| `Esc` | Close a dialog or return focus to results |
|
|
82
88
|
| `m` | Load another page |
|
|
83
|
-
| `p` or Enter on a result | Open the pull dialog |
|
|
89
|
+
| `p` or Enter on a remote result | Open the pull dialog |
|
|
90
|
+
| Enter on a local item | Preview a dataset or open the model launch dialog |
|
|
84
91
|
| `c`, `v` | Mark a model and compare marked models |
|
|
85
92
|
| `x` | Open the seven-tier quantization plan |
|
|
86
93
|
| `q` | Quit |
|
|
@@ -107,6 +114,110 @@ datahub scan --deps
|
|
|
107
114
|
|
|
108
115
|
`init` creates the standard directories and database and prints optional shell settings for `DATA_ROOT`, `HF_HOME`, `TORCH_HOME`, and `OLLAMA_MODELS`. Catalog commands also initialize a missing database on first use. Set a project root before running a dependency scan.
|
|
109
116
|
|
|
117
|
+
### Storage roots, cache adapters, and remotes
|
|
118
|
+
|
|
119
|
+
Scan configured roots recursively, or register an existing file or folder in place. The managed `datasets/` and `models/` under `data_root` remain the default locations for new downloads. Existing SQLite catalogs migrate on first open.
|
|
120
|
+
|
|
121
|
+
```toml
|
|
122
|
+
data_root = "~/data"
|
|
123
|
+
projects_root = "~/work"
|
|
124
|
+
dataset_roots = ["/mnt/bulk/datasets", "~/research/data"]
|
|
125
|
+
model_roots = ["/mnt/bulk/models"]
|
|
126
|
+
archive_root = "/mnt/cold/datahub"
|
|
127
|
+
|
|
128
|
+
[discovery]
|
|
129
|
+
enabled = true
|
|
130
|
+
hf_cache = true
|
|
131
|
+
ollama = true
|
|
132
|
+
lmstudio = true
|
|
133
|
+
llamacpp = true
|
|
134
|
+
torch = true
|
|
135
|
+
kagglehub = true
|
|
136
|
+
|
|
137
|
+
[remotes.gpu-box]
|
|
138
|
+
type = "ssh"
|
|
139
|
+
target = "user@ubuntu-box:/mnt/data"
|
|
140
|
+
|
|
141
|
+
[remotes.r2]
|
|
142
|
+
type = "s3"
|
|
143
|
+
target = "s3://my-bucket/datahub"
|
|
144
|
+
endpoint_url = "https://example.r2.cloudflarestorage.com"
|
|
145
|
+
|
|
146
|
+
[remotes.modal-vol]
|
|
147
|
+
type = "modal"
|
|
148
|
+
target = "my-training-volume:/data"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`[discovery].enabled` adds cache discovery to `scan`. `dhub discover` explicitly indexes enabled cache adapters without modifying their files. Switch individual adapters off with their boolean options. Hugging Face and Ollama cache locations follow `HF_HOME` and `OLLAMA_MODELS` when set. Missing roots appear as `[offline]` while their cached schemas and metadata remain searchable.
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
dhub sd --use-case vision -n 10
|
|
155
|
+
dhub sd --min-gb 0.1 --max-gb 4 -n 10
|
|
156
|
+
dhub discover
|
|
157
|
+
dhub register ./existing-data --id research/examples --type dataset --tags training
|
|
158
|
+
dhub ls datasets --tag training
|
|
159
|
+
dhub ls --status offline
|
|
160
|
+
dhub ls --adapter ollama
|
|
161
|
+
dhub unregister research/examples
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Hugging Face dataset sizes use card metadata, the Dataset Viewer, and Hub metadata. Exact row counts take precedence over size buckets. A `+` marks partial data and an upper size limit excludes unresolved or partial sizes.
|
|
165
|
+
|
|
166
|
+
### Preview, query, and launch
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
dhub peek research/examples --rows 5
|
|
170
|
+
dhub peek research/examples --file train.csv --json
|
|
171
|
+
dhub query research/examples 'SELECT count(*) FROM data'
|
|
172
|
+
dhub run models/example.gguf --dry-run
|
|
173
|
+
dhub serve models/example.gguf --ctx-size 4096 --dry-run
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Preview statistics describe the sampled rows. With DuckDB installed, a local dataset’s preview also accepts a read-only SQL query. `data` refers to the primary file. Other supported files are available by normalized filename stem with numeric suffixes if names collide. Model launch uses a local Ollama, llama.cpp, or MLX-LM executable. For GGUF, the generated context size and GPU offload are estimates.
|
|
177
|
+
|
|
178
|
+
### Verify, archive, and transfer
|
|
179
|
+
|
|
180
|
+
```sh
|
|
181
|
+
dhub verify research/examples
|
|
182
|
+
dhub verify research/examples --update
|
|
183
|
+
dhub dedup --json
|
|
184
|
+
dhub archive research/examples
|
|
185
|
+
dhub restore research/examples
|
|
186
|
+
dhub remotes
|
|
187
|
+
dhub push research/examples gpu-box --dry-run
|
|
188
|
+
dhub pull-remote research/examples gpu-box --destination ./restored-data
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The first verification records a SHA-256 baseline. Later checks report missing or changed files. Deduplication reports candidates and space savings. An archive verifies its compressed contents and then removes the original files, retaining the indexed schema. Referenced items and third-party caches cannot be archived. Archive compression uses zstd when available and gzip otherwise.
|
|
192
|
+
|
|
193
|
+
Remote transfers use rsync over SSH, the AWS CLI or a configured `rclone_remote` for S3, or the Modal CLI. A push uploads a content manifest. A pull stages the files and verifies that manifest before putting them at the requested destination.
|
|
194
|
+
|
|
195
|
+
### MCP clients
|
|
196
|
+
|
|
197
|
+
`dhub mcp` runs the built-in read-only stdio server. It exposes catalog listing and details, hardware detection, model and dataset search, and dataset previews.
|
|
198
|
+
|
|
199
|
+
For **Claude Code**, put this in the project’s `.mcp.json`. For **Cursor**, use the same JSON in `.cursor/mcp.json` or `~/.cursor/mcp.json`.
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"mcpServers": {
|
|
204
|
+
"datahub": {"command": "dhub", "args": ["mcp"]}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
For **Codex**, add this to `~/.codex/config.toml`.
|
|
210
|
+
|
|
211
|
+
```toml
|
|
212
|
+
[mcp_servers.datahub]
|
|
213
|
+
command = "dhub"
|
|
214
|
+
args = ["mcp"]
|
|
215
|
+
startup_timeout_sec = 10
|
|
216
|
+
tool_timeout_sec = 90
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
If the client launches with a different PATH, use the absolute path to the `dhub` executable.
|
|
220
|
+
|
|
110
221
|
## Python API
|
|
111
222
|
|
|
112
223
|
```python
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# DataHub CLI
|
|
2
|
+
|
|
3
|
+
DataHub is a terminal tool for finding models and datasets, estimating which models fit your hardware, and tracking local data. It indexes local files in SQLite, caches schemas, and can find project references to catalog items.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Install DataHub CLI from PyPI. Use `dhub` if Acryl Data’s `acryl-datahub` package already provides a `datahub` command on your PATH.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
uv tool install datahub-cli
|
|
11
|
+
uvx datahub-cli
|
|
12
|
+
pip install datahub-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
DataHub requires Python 3.11 or newer. `uv tool install` makes both `dhub` and `datahub` available from any terminal without activating an environment.
|
|
16
|
+
|
|
17
|
+
Optional extras include `parquet` and `onnx` for schema inspection, `kaggle` for Kaggle transfers, `duckdb` for SQL and Parquet previews, and `zstandard` for compressed archives. Install several with `uv tool install 'datahub-cli[duckdb,zstandard]'`, or use `datahub-cli[all]`.
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
datahub init
|
|
23
|
+
datahub
|
|
24
|
+
datahub sm
|
|
25
|
+
datahub sm "qwen" --source ollama --fits -n 10
|
|
26
|
+
datahub sd --use-case finance -n 5
|
|
27
|
+
datahub scan
|
|
28
|
+
datahub ls
|
|
29
|
+
datahub info category/dataset-name --json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Use an ID from `datahub ls` with `datahub info` or `datahub path`. For model estimates on another memory budget, run `datahub --memory 16G --max-context 4096 sm --fits`. Estimates depend on the runtime and architecture. A quantization plan describes possible configurations. A pull downloads the provider's published artifact.
|
|
33
|
+
|
|
34
|
+
Ollama search uses the public model catalog without credentials. The selected size and pull tag appear in the TUI inspector and JSON results. DataHub estimates Ollama model sizes at Q4 and embeddings at FP16 when the catalog does not report weights or quantization. Ollama downloads need the `ollama` executable and its local service. Ollama manages the weights, and DataHub records a reference. Setting `OLLAMADB_API_KEY` enables an API fallback if the public search fails. Hugging Face can use `HF_TOKEN` or an existing login for gated downloads. Kaggle needs its CLI and credentials.
|
|
35
|
+
|
|
36
|
+
Use `--one-page` for a JSON page with a `next_cursor`, then pass it to `--cursor` with the same filters. `--sort newest` orders Ollama results by recency.
|
|
37
|
+
|
|
38
|
+
| Key | Action |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `1`, `2`, `3` | Switch between Models, Datasets, and Local Catalog |
|
|
41
|
+
| `/` | Focus the active tab’s search or filter input |
|
|
42
|
+
| ↑ / ↓ | Move between results or options in an open dropdown |
|
|
43
|
+
| `Tab` / `Shift+Tab` | Move between controls |
|
|
44
|
+
| `Enter` in a search field | Search and focus results |
|
|
45
|
+
| `Esc` | Close a dialog or return focus to results |
|
|
46
|
+
| `m` | Load another page |
|
|
47
|
+
| `p` or Enter on a remote result | Open the pull dialog |
|
|
48
|
+
| Enter on a local item | Preview a dataset or open the model launch dialog |
|
|
49
|
+
| `c`, `v` | Mark a model and compare marked models |
|
|
50
|
+
| `x` | Open the seven-tier quantization plan |
|
|
51
|
+
| `q` | Quit |
|
|
52
|
+
|
|
53
|
+
Press Enter on a result to open its pull dialog. Use the arrow keys in the category dropdown and Tab to edit the fields. Enter on a text field submits the pull.
|
|
54
|
+
|
|
55
|
+
Both the CLI pull commands and the TUI show download and indexing status. Size, speed, and ETA appear when the provider exposes transfer totals. Downloads with unknown totals show activity until the provider reports completion.
|
|
56
|
+
|
|
57
|
+
## Configuration
|
|
58
|
+
|
|
59
|
+
DataHub resolves each path from its CLI flag, environment variable, TOML setting, then default.
|
|
60
|
+
|
|
61
|
+
| Path | Flag | Environment | TOML | Default |
|
|
62
|
+
| --- | --- | --- | --- | --- |
|
|
63
|
+
| Data and catalog | `--data-root` | `DATA_ROOT` | `data_root` | `~/data` |
|
|
64
|
+
| Project scan root | `--projects-root` | `PROJECTS_ROOT` | `projects_root` | Disabled |
|
|
65
|
+
|
|
66
|
+
The config file lives at `~/.config/datahub/config.toml`, under `$XDG_CONFIG_HOME/datahub` if set, or under `%APPDATA%\datahub` on Windows. Values can use `~` for the home directory.
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
datahub init --data-root ~/data --projects-root ~/work --save-config
|
|
70
|
+
datahub scan --deps
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`init` creates the standard directories and database and prints optional shell settings for `DATA_ROOT`, `HF_HOME`, `TORCH_HOME`, and `OLLAMA_MODELS`. Catalog commands also initialize a missing database on first use. Set a project root before running a dependency scan.
|
|
74
|
+
|
|
75
|
+
### Storage roots, cache adapters, and remotes
|
|
76
|
+
|
|
77
|
+
Scan configured roots recursively, or register an existing file or folder in place. The managed `datasets/` and `models/` under `data_root` remain the default locations for new downloads. Existing SQLite catalogs migrate on first open.
|
|
78
|
+
|
|
79
|
+
```toml
|
|
80
|
+
data_root = "~/data"
|
|
81
|
+
projects_root = "~/work"
|
|
82
|
+
dataset_roots = ["/mnt/bulk/datasets", "~/research/data"]
|
|
83
|
+
model_roots = ["/mnt/bulk/models"]
|
|
84
|
+
archive_root = "/mnt/cold/datahub"
|
|
85
|
+
|
|
86
|
+
[discovery]
|
|
87
|
+
enabled = true
|
|
88
|
+
hf_cache = true
|
|
89
|
+
ollama = true
|
|
90
|
+
lmstudio = true
|
|
91
|
+
llamacpp = true
|
|
92
|
+
torch = true
|
|
93
|
+
kagglehub = true
|
|
94
|
+
|
|
95
|
+
[remotes.gpu-box]
|
|
96
|
+
type = "ssh"
|
|
97
|
+
target = "user@ubuntu-box:/mnt/data"
|
|
98
|
+
|
|
99
|
+
[remotes.r2]
|
|
100
|
+
type = "s3"
|
|
101
|
+
target = "s3://my-bucket/datahub"
|
|
102
|
+
endpoint_url = "https://example.r2.cloudflarestorage.com"
|
|
103
|
+
|
|
104
|
+
[remotes.modal-vol]
|
|
105
|
+
type = "modal"
|
|
106
|
+
target = "my-training-volume:/data"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`[discovery].enabled` adds cache discovery to `scan`. `dhub discover` explicitly indexes enabled cache adapters without modifying their files. Switch individual adapters off with their boolean options. Hugging Face and Ollama cache locations follow `HF_HOME` and `OLLAMA_MODELS` when set. Missing roots appear as `[offline]` while their cached schemas and metadata remain searchable.
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
dhub sd --use-case vision -n 10
|
|
113
|
+
dhub sd --min-gb 0.1 --max-gb 4 -n 10
|
|
114
|
+
dhub discover
|
|
115
|
+
dhub register ./existing-data --id research/examples --type dataset --tags training
|
|
116
|
+
dhub ls datasets --tag training
|
|
117
|
+
dhub ls --status offline
|
|
118
|
+
dhub ls --adapter ollama
|
|
119
|
+
dhub unregister research/examples
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Hugging Face dataset sizes use card metadata, the Dataset Viewer, and Hub metadata. Exact row counts take precedence over size buckets. A `+` marks partial data and an upper size limit excludes unresolved or partial sizes.
|
|
123
|
+
|
|
124
|
+
### Preview, query, and launch
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
dhub peek research/examples --rows 5
|
|
128
|
+
dhub peek research/examples --file train.csv --json
|
|
129
|
+
dhub query research/examples 'SELECT count(*) FROM data'
|
|
130
|
+
dhub run models/example.gguf --dry-run
|
|
131
|
+
dhub serve models/example.gguf --ctx-size 4096 --dry-run
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Preview statistics describe the sampled rows. With DuckDB installed, a local dataset’s preview also accepts a read-only SQL query. `data` refers to the primary file. Other supported files are available by normalized filename stem with numeric suffixes if names collide. Model launch uses a local Ollama, llama.cpp, or MLX-LM executable. For GGUF, the generated context size and GPU offload are estimates.
|
|
135
|
+
|
|
136
|
+
### Verify, archive, and transfer
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
dhub verify research/examples
|
|
140
|
+
dhub verify research/examples --update
|
|
141
|
+
dhub dedup --json
|
|
142
|
+
dhub archive research/examples
|
|
143
|
+
dhub restore research/examples
|
|
144
|
+
dhub remotes
|
|
145
|
+
dhub push research/examples gpu-box --dry-run
|
|
146
|
+
dhub pull-remote research/examples gpu-box --destination ./restored-data
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The first verification records a SHA-256 baseline. Later checks report missing or changed files. Deduplication reports candidates and space savings. An archive verifies its compressed contents and then removes the original files, retaining the indexed schema. Referenced items and third-party caches cannot be archived. Archive compression uses zstd when available and gzip otherwise.
|
|
150
|
+
|
|
151
|
+
Remote transfers use rsync over SSH, the AWS CLI or a configured `rclone_remote` for S3, or the Modal CLI. A push uploads a content manifest. A pull stages the files and verifies that manifest before putting them at the requested destination.
|
|
152
|
+
|
|
153
|
+
### MCP clients
|
|
154
|
+
|
|
155
|
+
`dhub mcp` runs the built-in read-only stdio server. It exposes catalog listing and details, hardware detection, model and dataset search, and dataset previews.
|
|
156
|
+
|
|
157
|
+
For **Claude Code**, put this in the project’s `.mcp.json`. For **Cursor**, use the same JSON in `.cursor/mcp.json` or `~/.cursor/mcp.json`.
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"mcpServers": {
|
|
162
|
+
"datahub": {"command": "dhub", "args": ["mcp"]}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
For **Codex**, add this to `~/.codex/config.toml`.
|
|
168
|
+
|
|
169
|
+
```toml
|
|
170
|
+
[mcp_servers.datahub]
|
|
171
|
+
command = "dhub"
|
|
172
|
+
args = ["mcp"]
|
|
173
|
+
startup_timeout_sec = 10
|
|
174
|
+
tool_timeout_sec = 90
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
If the client launches with a different PATH, use the absolute path to the `dhub` executable.
|
|
178
|
+
|
|
179
|
+
## Python API
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
from datahub import detect_hardware, evaluate_model, get_dataset_dir, get_model_path
|
|
183
|
+
|
|
184
|
+
dataset = get_dataset_dir("category/dataset-name")
|
|
185
|
+
checkpoint = get_model_path("weights/my-model")
|
|
186
|
+
hardware = detect_hardware(memory="16G")
|
|
187
|
+
fit = evaluate_model("example-7B", hardware, max_context=4096)
|
|
188
|
+
print(fit.quant, fit.total_gb, fit.verdict)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The path helpers resolve indexed IDs or unique names and raise `KeyError` if the item is missing or ambiguous. Each accepts a `data_root` override.
|
|
192
|
+
|
|
193
|
+
## Development
|
|
194
|
+
|
|
195
|
+
```sh
|
|
196
|
+
uv run ruff check
|
|
197
|
+
uv run pytest
|
|
198
|
+
uv build
|
|
199
|
+
```
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "datahub-cli"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.1"
|
|
8
8
|
description = "Local data catalog and hardware-aware model discovery"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -33,7 +33,9 @@ dependencies = [
|
|
|
33
33
|
parquet = ["pyarrow>=15.0.0"]
|
|
34
34
|
onnx = ["onnxruntime>=1.18.0"]
|
|
35
35
|
kaggle = ["kaggle>=1.6.0"]
|
|
36
|
-
|
|
36
|
+
duckdb = ["duckdb>=1.1.0"]
|
|
37
|
+
zstandard = ["zstandard>=0.22"]
|
|
38
|
+
all = ["pyarrow>=15.0.0", "onnxruntime>=1.18.0", "kaggle>=1.6.0", "duckdb>=1.1.0", "zstandard>=0.22"]
|
|
37
39
|
|
|
38
40
|
[project.urls]
|
|
39
41
|
Homepage = "https://github.com/tyler-ungerman/data-hub"
|
|
@@ -49,7 +51,7 @@ dhub = "datahub.cli:main"
|
|
|
49
51
|
packages = ["src/datahub"]
|
|
50
52
|
|
|
51
53
|
[dependency-groups]
|
|
52
|
-
dev = ["pytest>=8", "ruff>=0.8"]
|
|
54
|
+
dev = ["pytest>=8", "ruff>=0.8", "duckdb>=1.1.0"]
|
|
53
55
|
|
|
54
56
|
[tool.pytest.ini_options]
|
|
55
57
|
testpaths = ["tests"]
|