minichat-studio 0.3.0__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.
- minichat_studio-0.3.0/LICENSE +7 -0
- minichat_studio-0.3.0/PKG-INFO +363 -0
- minichat_studio-0.3.0/README.md +320 -0
- minichat_studio-0.3.0/pyproject.toml +87 -0
- minichat_studio-0.3.0/setup.cfg +4 -0
- minichat_studio-0.3.0/src/minichat_studio.egg-info/PKG-INFO +363 -0
- minichat_studio-0.3.0/src/minichat_studio.egg-info/SOURCES.txt +75 -0
- minichat_studio-0.3.0/src/minichat_studio.egg-info/dependency_links.txt +1 -0
- minichat_studio-0.3.0/src/minichat_studio.egg-info/entry_points.txt +2 -0
- minichat_studio-0.3.0/src/minichat_studio.egg-info/requires.txt +21 -0
- minichat_studio-0.3.0/src/minichat_studio.egg-info/top_level.txt +1 -0
- minichat_studio-0.3.0/src/minics/__init__.py +33 -0
- minichat_studio-0.3.0/src/minics/__main__.py +8 -0
- minichat_studio-0.3.0/src/minics/cli.py +421 -0
- minichat_studio-0.3.0/src/minics/core/__init__.py +53 -0
- minichat_studio-0.3.0/src/minics/core/config.py +259 -0
- minichat_studio-0.3.0/src/minics/core/db.py +325 -0
- minichat_studio-0.3.0/src/minics/core/events.py +128 -0
- minichat_studio-0.3.0/src/minics/core/jobs.py +329 -0
- minichat_studio-0.3.0/src/minics/core/paths.py +114 -0
- minichat_studio-0.3.0/src/minics/core/repository.py +229 -0
- minichat_studio-0.3.0/src/minics/core/schema.py +185 -0
- minichat_studio-0.3.0/src/minics/core/utils.py +80 -0
- minichat_studio-0.3.0/src/minics/desktop.py +126 -0
- minichat_studio-0.3.0/src/minics/documents/__init__.py +25 -0
- minichat_studio-0.3.0/src/minics/documents/convert.py +277 -0
- minichat_studio-0.3.0/src/minics/domain/__init__.py +41 -0
- minichat_studio-0.3.0/src/minics/domain/entities.py +289 -0
- minichat_studio-0.3.0/src/minics/llm/__init__.py +77 -0
- minichat_studio-0.3.0/src/minics/llm/client.py +323 -0
- minichat_studio-0.3.0/src/minics/llm/enhance.py +378 -0
- minichat_studio-0.3.0/src/minics/llm/prompts.py +93 -0
- minichat_studio-0.3.0/src/minics/llm/structured.py +194 -0
- minichat_studio-0.3.0/src/minics/rag/__init__.py +30 -0
- minichat_studio-0.3.0/src/minics/rag/chunking.py +117 -0
- minichat_studio-0.3.0/src/minics/rag/entities.py +120 -0
- minichat_studio-0.3.0/src/minics/rag/fusion.py +93 -0
- minichat_studio-0.3.0/src/minics/rag/graph.py +463 -0
- minichat_studio-0.3.0/src/minics/rag/indexer.py +213 -0
- minichat_studio-0.3.0/src/minics/rag/retriever.py +247 -0
- minichat_studio-0.3.0/src/minics/rag/vectorstore.py +187 -0
- minichat_studio-0.3.0/src/minics/server/__init__.py +7 -0
- minichat_studio-0.3.0/src/minics/server/api/__init__.py +41 -0
- minichat_studio-0.3.0/src/minics/server/api/chat.py +137 -0
- minichat_studio-0.3.0/src/minics/server/api/collections.py +123 -0
- minichat_studio-0.3.0/src/minics/server/api/datasets.py +92 -0
- minichat_studio-0.3.0/src/minics/server/api/documents.py +233 -0
- minichat_studio-0.3.0/src/minics/server/api/entries.py +214 -0
- minichat_studio-0.3.0/src/minics/server/api/jobs.py +69 -0
- minichat_studio-0.3.0/src/minics/server/api/retrieval.py +83 -0
- minichat_studio-0.3.0/src/minics/server/api/system.py +136 -0
- minichat_studio-0.3.0/src/minics/server/app.py +88 -0
- minichat_studio-0.3.0/src/minics/server/deps.py +85 -0
- minichat_studio-0.3.0/src/minics/server/sse.py +42 -0
- minichat_studio-0.3.0/src/minics/server/static/css/app.css +521 -0
- minichat_studio-0.3.0/src/minics/server/static/js/api.js +115 -0
- minichat_studio-0.3.0/src/minics/server/static/js/app.js +150 -0
- minichat_studio-0.3.0/src/minics/server/static/js/ui.js +286 -0
- minichat_studio-0.3.0/src/minics/server/static/js/views.js +1186 -0
- minichat_studio-0.3.0/src/minics/server/templates/index.html +87 -0
- minichat_studio-0.3.0/src/minics/services/__init__.py +17 -0
- minichat_studio-0.3.0/src/minics/services/authoring.py +267 -0
- minichat_studio-0.3.0/src/minics/services/base.py +66 -0
- minichat_studio-0.3.0/src/minics/services/chat.py +334 -0
- minichat_studio-0.3.0/src/minics/services/collections.py +180 -0
- minichat_studio-0.3.0/src/minics/services/context.py +255 -0
- minichat_studio-0.3.0/src/minics/services/datasets.py +118 -0
- minichat_studio-0.3.0/src/minics/services/documents.py +316 -0
- minichat_studio-0.3.0/src/minics/services/entries.py +272 -0
- minichat_studio-0.3.0/src/minics/services/export.py +120 -0
- minichat_studio-0.3.0/src/minics/services/repositories.py +255 -0
- minichat_studio-0.3.0/tests/test_api.py +129 -0
- minichat_studio-0.3.0/tests/test_cli.py +82 -0
- minichat_studio-0.3.0/tests/test_core.py +87 -0
- minichat_studio-0.3.0/tests/test_llm.py +165 -0
- minichat_studio-0.3.0/tests/test_rag.py +98 -0
- minichat_studio-0.3.0/tests/test_services.py +98 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2026 Jason Jiménez Cruz
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: minichat-studio
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: MiniCS Lite (Mini ChatML Studio Lite) — a local-first studio for building high quality LLM datasets with RAG + graph grounding.
|
|
5
|
+
Author-email: Jason Jimenez Cruz <jasonjimenezcruz@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jasonjimnz/minics
|
|
8
|
+
Project-URL: Repository, https://github.com/jasonjimnz/minics
|
|
9
|
+
Project-URL: Issues, https://github.com/jasonjimnz/minics/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/jasonjimnz/minics/releases
|
|
11
|
+
Keywords: llm,dataset,rag,graph,chromadb,ladybug,flask,pywebview
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Framework :: Flask
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: flask>=3.0
|
|
23
|
+
Requires-Dist: pywebview>=5.0
|
|
24
|
+
Requires-Dist: pydantic>=2.6
|
|
25
|
+
Requires-Dist: openai>=1.40
|
|
26
|
+
Requires-Dist: langchain>=0.3
|
|
27
|
+
Requires-Dist: langchain-core>=0.3
|
|
28
|
+
Requires-Dist: langchain-openai>=0.2
|
|
29
|
+
Requires-Dist: langchain-community>=0.3
|
|
30
|
+
Requires-Dist: langchain-text-splitters>=0.3
|
|
31
|
+
Requires-Dist: chromadb<2,>=0.5
|
|
32
|
+
Requires-Dist: ladybug<0.19,>=0.17
|
|
33
|
+
Requires-Dist: pypdf>=4.2
|
|
34
|
+
Requires-Dist: python-docx>=1.1
|
|
35
|
+
Requires-Dist: mammoth>=1.8
|
|
36
|
+
Requires-Dist: markdownify>=0.12
|
|
37
|
+
Requires-Dist: pylatexenc>=2.10
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
41
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# MiniCS Lite
|
|
45
|
+
|
|
46
|
+
**Mini ChatML Studio Lite** — a local-first studio for building high quality
|
|
47
|
+
LLM datasets. MiniCS combines a ChatML-aware dataset library, a hybrid RAG +
|
|
48
|
+
knowledge-graph grounding engine, an LLM authoring toolbox and a markdown
|
|
49
|
+
editor into a single desktop application (Flask + PyWebView). Everything lives
|
|
50
|
+
inside your own `~/.minics` folder — no cloud, no accounts, no lock-in.
|
|
51
|
+
|
|
52
|
+
> **MiniCS is a mixed project.** It combines two sibling codebases: **ChatML
|
|
53
|
+
> Studio**, a platform for handling datasets and entries, and **Tyness**, a
|
|
54
|
+
> *tiny documental harness* for enhancing LLM capabilities with embed
|
|
55
|
+
> databases. MiniCS Lite distills both into one small, local-first tool — the
|
|
56
|
+
> root projects will keep growing with more capabilities.
|
|
57
|
+
>
|
|
58
|
+
> **MiniCS is OpenAI-protocol first.** Any OpenAI-compatible endpoint works:
|
|
59
|
+
> OpenAI, Azure-style gateways, vLLM, llama.cpp (`llama-server`), LM Studio,
|
|
60
|
+
> Ollama's OpenAI shim, or anything else speaking `/v1/chat/completions` and
|
|
61
|
+
> `/v1/embeddings`.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Highlights
|
|
66
|
+
|
|
67
|
+
| Area | What you get |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| **Dataset library** | Datasets, ChatML entries with system/user/assistant roles, draft → review → approved workflow, automatic versioning on every message edit, structural ChatML validation. |
|
|
70
|
+
| **Grounding engine** | Import **PDF, DOCX, TXT, Markdown, LaTeX** — every file is converted to cleaned markdown (optionally repaired by the LLM), then chunked and indexed. |
|
|
71
|
+
| **Hybrid retrieval** | ChromaDB vector search **plus** Ladybug graph topology, fused with Reciprocal Rank Fusion (RRF). Each side degrades gracefully when the other is unavailable. |
|
|
72
|
+
| **LLM everywhere** | Enhance fields, suggest tags, evaluate entries against 6 quality dimensions, generate grounded new entries, clean markdown, extract graph entities. Structured output with 3 fallback strategies. |
|
|
73
|
+
| **Background-first** | Long operations (import, indexing, evaluation) run on a worker thread pool with live progress streamed to the UI over **Server-Sent Events**, backed by a concurrency-safe SQLite writer thread. |
|
|
74
|
+
| **Chat with switches** | Per-conversation toggles for RAG, graph and grounding — retrieval and injection are separate, so you can *preview* what would be used without forcing it into the prompt. |
|
|
75
|
+
| **Export anywhere** | ChatML, JSONL, Alpaca, ShareGPT and Markdown — byte-identical from UI, CLI or Python. |
|
|
76
|
+
| **Themable UI** | 15 hand-tuned themes — System, Light, Dark, Ocean, Forest, Sunset, Nord, Rose, Midnight, Paper, Mono, Grape, Dracula, Catppuccin Mocha and Solarized — with native dark form controls, tinted shadows and themed scrollbars. Themes are pure CSS-variable swaps. |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## A walkthrough of the web app
|
|
81
|
+
|
|
82
|
+
The screenshots below (from [`docs/screenshots/`](docs/screenshots/)) follow a
|
|
83
|
+
real end-to-end session against two local model servers: a **llama.cpp
|
|
84
|
+
`llama-server`** instance serving the chat model and an **Ollama** instance
|
|
85
|
+
serving the embedding model — exactly the split-endpoint setup MiniCS is
|
|
86
|
+
designed for.
|
|
87
|
+
|
|
88
|
+
### 1. Home / Dashboard
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
The landing screen. Live counters for datasets, entries, approved entries,
|
|
93
|
+
documents, indexed chunks and graph entities, a *Getting started* checklist
|
|
94
|
+
that ticks itself off as you complete each step, and a recent-activity feed.
|
|
95
|
+
Everything in the sidebar — Datasets, Entries, Collections, Documents, Chat,
|
|
96
|
+
Graph, Activity, Settings — is one click away.
|
|
97
|
+
|
|
98
|
+
### 2. Settings — wiring up the endpoints
|
|
99
|
+
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+
Here the app is pointed at the two local servers: the **LLM endpoint** is a
|
|
103
|
+
`llama-server` instance (`qwen-3-8` on `:8000/v1`) and the **embeddings
|
|
104
|
+
endpoint** is Ollama (`bge-m3:latest` on `:11434/v1`, 1024 dimensions — hit
|
|
105
|
+
*Detect* to sniff it automatically, since it drives the Chroma vector store).
|
|
106
|
+
The Retrieval panel tunes the hybrid search defaults (Top K, RRF k, graph
|
|
107
|
+
hops), and the Application panel picks one of the 15 themes (Catppuccin Mocha
|
|
108
|
+
here) and the background-worker pool size. *Test connection* validates both
|
|
109
|
+
endpoints before *Finish setup* locks them in.
|
|
110
|
+
|
|
111
|
+
### 3. Creating a dataset
|
|
112
|
+
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
Datasets are the top-level containers for training examples. Give one a name,
|
|
116
|
+
a short description and optional comma-separated tags — that's all it takes.
|
|
117
|
+
|
|
118
|
+
### 4. Creating an entry
|
|
119
|
+
|
|
120
|
+

|
|
121
|
+
|
|
122
|
+
Each entry is a ChatML conversation: **system**, **user** and **assistant**
|
|
123
|
+
messages. Fill them by hand, or type a topic into *Generate with LLM
|
|
124
|
+
(grounded)* and let the model draft the whole entry using your imported
|
|
125
|
+
documents as context.
|
|
126
|
+
|
|
127
|
+
### 5. The entry editor
|
|
128
|
+
|
|
129
|
+

|
|
130
|
+
|
|
131
|
+
The generated entry lands in the editor. Messages can be reordered, deleted
|
|
132
|
+
and switched between roles; a *Valid ChatML* banner confirms the structure in
|
|
133
|
+
real time. The LLM helpers are one click away — *Enhance assistant*, *Suggest
|
|
134
|
+
tags* (in action here) and *Evaluate* against the six quality dimensions —
|
|
135
|
+
and every message edit bumps the entry version automatically.
|
|
136
|
+
|
|
137
|
+
### 6. Importing a markdown document
|
|
138
|
+
|
|
139
|
+

|
|
140
|
+
|
|
141
|
+
Dropping a markdown file (or PDF/DOCX/TXT/LaTeX — it gets converted) opens the
|
|
142
|
+
document viewer: a split-pane markdown editor with live preview and formatting
|
|
143
|
+
toolbar. This one has been chunked into **127 chunks**, ready to index. From
|
|
144
|
+
here you can *Clean with LLM*, *Enrich graph* and *Reindex* without leaving
|
|
145
|
+
the dialog.
|
|
146
|
+
|
|
147
|
+
### 7. Querying the knowledge graph
|
|
148
|
+
|
|
149
|
+

|
|
150
|
+
|
|
151
|
+
The Graph screen shows the entity topology extracted from your documents —
|
|
152
|
+
923 entities, 1492 mentions and 4779 co-occurrences from a single import.
|
|
153
|
+
Type a query (`Sorting` here) and hit *Explore* to render the matching
|
|
154
|
+
sub-graph; *Rebuild* regenerates the whole topology from the index.
|
|
155
|
+
|
|
156
|
+
### 8. Testing the LLM
|
|
157
|
+
|
|
158
|
+

|
|
159
|
+
|
|
160
|
+
Chat is where the model gets smoke-tested. Each conversation carries its own
|
|
161
|
+
**RAG**, **Graph** and **Grounding** toggles — you can preview what retrieval
|
|
162
|
+
*would* inject without forcing it into the prompt. This call is a plain
|
|
163
|
+
sanity-check prompt with all toggles off.
|
|
164
|
+
|
|
165
|
+
### 9. Creating a collection
|
|
166
|
+
|
|
167
|
+

|
|
168
|
+
|
|
169
|
+
Collections are curated sets of entries destined for export — a name and a
|
|
170
|
+
description and you're in.
|
|
171
|
+
|
|
172
|
+
### 10. Curating and exporting
|
|
173
|
+
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+
Search your entries and *Add* them to the collection, then download the whole
|
|
177
|
+
set in one click — **ChatML, JSONL, Alpaca, ShareGPT or Markdown** —
|
|
178
|
+
byte-identical whether exported from the UI, the CLI or Python.
|
|
179
|
+
|
|
180
|
+
That's the full loop: **configure → create → author → import → ground → chat
|
|
181
|
+
→ curate → export.**
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Quick start
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
pip install -e ".[dev]"
|
|
189
|
+
|
|
190
|
+
minics init # create ~/.minics
|
|
191
|
+
minics setup # interactive LLM + embedding wizard
|
|
192
|
+
minics # launch the desktop app (default command)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Point the wizard at any OpenAI-compatible chat endpoint and any embedding
|
|
196
|
+
endpoint (they may be different servers). The embedding dimension is detected
|
|
197
|
+
automatically and required — Chroma collections are created with it.
|
|
198
|
+
|
|
199
|
+
Other entry points:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
minics serve --port 8800 # Flask only, opened in a browser
|
|
203
|
+
minics models # list models from the endpoint
|
|
204
|
+
minics search "what is RRF?" # hybrid retrieval from the terminal
|
|
205
|
+
minics export <collection> -o out.jsonl --format jsonl
|
|
206
|
+
minics documents --import paper.pdf --index
|
|
207
|
+
minics reindex # rebuild the vector index + graph
|
|
208
|
+
python -m minics --help # everything else
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Run as a server (Docker)
|
|
212
|
+
|
|
213
|
+
The repo ships a server container that keeps the whole store in a volume and
|
|
214
|
+
auto-creates it on first start — no setup steps on the host:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
docker compose up -d --build # or: docker build -t minics-lite . && docker run -d -p 8765:8765 -v minics-data:/data minics-lite
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Open `http://localhost:8765`, finish setup in the UI. Details in
|
|
221
|
+
[docs/docker.md](docs/docker.md).
|
|
222
|
+
|
|
223
|
+
### Use it as a library
|
|
224
|
+
|
|
225
|
+
MiniCS is a library first; the Flask API and the desktop shell are thin layers
|
|
226
|
+
on top of a single application context (`minics.services.context.AppContext`).
|
|
227
|
+
|
|
228
|
+
```python
|
|
229
|
+
from minics.services.context import get_context
|
|
230
|
+
|
|
231
|
+
ctx = get_context()
|
|
232
|
+
dataset = ctx.datasets.create("Support QA", tags=["support"])
|
|
233
|
+
entry = ctx.entries.create(dataset.id, user="What is RRF?", assistant="A fusion method.")
|
|
234
|
+
ctx.indexer.index_document(ctx.documents.import_file("handbook.pdf").id)
|
|
235
|
+
result = ctx.retriever.retrieve("how does fusion work?")
|
|
236
|
+
print(result.context_text())
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## What's inside
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
~/.minics/
|
|
245
|
+
├── config.json # LLM / embedding / retrieval / app settings
|
|
246
|
+
├── minics.sqlite3 # datasets, entries, collections, documents, chats (WAL)
|
|
247
|
+
├── vectordb/ # ChromaDB persistent store (cosine space)
|
|
248
|
+
├── graphdb/ # Ladybug graph database (minics.graph)
|
|
249
|
+
├── documents/
|
|
250
|
+
│ ├── originals/ # untouched uploads, kept for provenance/re-extraction
|
|
251
|
+
│ └── markdown/ # cleaned markdown used for chunking + grounding
|
|
252
|
+
├── logs/
|
|
253
|
+
└── cache/
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Override the location with the `MINICS_HOME` environment variable (used by the
|
|
257
|
+
test suite to run against throwaway homes).
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Architecture
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
CLI / PyWebView ──► Flask API ──► services (library API) ──┬─► SQLite (single writer thread)
|
|
265
|
+
├─► ChromaDB (vectors)
|
|
266
|
+
├─► Ladybug (graph)
|
|
267
|
+
└─► OpenAI-compatible LLM + embeddings
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
- **`minics.core`** — paths, config, SQLite (WAL + serialised writer thread),
|
|
271
|
+
in-process event bus, background job manager, generic pydantic repository.
|
|
272
|
+
- **`minics.domain`** — pydantic entities (Dataset, Entry, Collection, Document,
|
|
273
|
+
Conversation, …). Storage-agnostic: serialised to rows *and* to JSON.
|
|
274
|
+
- **`minics.llm`** — OpenAI/LangChain client factory, embeddings, structured
|
|
275
|
+
output with fallbacks, all authoring helpers and prompts.
|
|
276
|
+
- **`minics.rag`** — markdown-aware chunking, heuristic entity extraction,
|
|
277
|
+
Chroma store, Ladybug graph, RRF fusion, hybrid retriever.
|
|
278
|
+
- **`minics.documents`** — PDF/DOCX/TXT/Markdown/LaTeX → clean markdown.
|
|
279
|
+
- **`minics.services`** — the library API: datasets, entries, collections,
|
|
280
|
+
documents, authoring, chat, export.
|
|
281
|
+
- **`minics.server`** — Flask app factory, REST API blueprints, SSE event
|
|
282
|
+
stream, and the no-build static SPA.
|
|
283
|
+
- **`minics.desktop` / `minics.cli`** — the PyWebView desktop shell and the CLI.
|
|
284
|
+
|
|
285
|
+
Every layer is documented in depth in [`docs/`](docs/index.md):
|
|
286
|
+
|
|
287
|
+
| Document | Contents |
|
|
288
|
+
| --- | --- |
|
|
289
|
+
| [Documentation index](docs/index.md) | Reading order and full map of the docs. |
|
|
290
|
+
| [Architecture](docs/architecture.md) | Layers, request lifecycle, threading model, design decisions. |
|
|
291
|
+
| [Libraries](docs/libraries.md) | Every dependency, why it's there and where it's used. |
|
|
292
|
+
| [Configuration](docs/configuration.md) | Every config key, the setup wizard, `MINICS_HOME`, secrets masking. |
|
|
293
|
+
| [Core & backend](docs/backend.md) | SQLite writer, event bus, job manager, repositories, services, CLI, desktop shell. |
|
|
294
|
+
| [LLM layer](docs/llm.md) | OpenAI protocol client, embeddings, structured output + truncation handling, prompts, authoring helpers. |
|
|
295
|
+
| [RAG & graph](docs/rag.md) | Conversion, chunking, entity extraction, Ladybug schema, Chroma, indexing pipeline, RRF hybrid retrieval. |
|
|
296
|
+
| [HTTP API](docs/api.md) | Full REST reference, SSE event stream, job workflow, error mapping. |
|
|
297
|
+
| [Docker](docs/docker.md) | Server container: build, run, Compose, volumes, first-run setup, troubleshooting. |
|
|
298
|
+
| [Frontend](docs/frontend.md) | The no-build SPA: modules, hash routing, SSE, themes, markdown, graph view, every screen. |
|
|
299
|
+
| [Development](docs/development.md) | Environment, tests, fixtures, style, migrations, how to contribute. |
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## The 60-second tour
|
|
304
|
+
|
|
305
|
+
1. **Settings** → point MiniCS at your chat + embedding endpoints, hit
|
|
306
|
+
*Test connection*, *Finish setup*.
|
|
307
|
+
2. **Documents** → drop a PDF/DOCX/TXT/MD/TeX file. It is converted to markdown,
|
|
308
|
+
cleaned (heuristically, plus the LLM if enabled), chunked along headings,
|
|
309
|
+
embedded into Chroma, and wired into the entity graph.
|
|
310
|
+
3. **Datasets / Entries** → author ChatML entries by hand or generate them from
|
|
311
|
+
a topic grounded in your documents. Enhance, tag and evaluate with the LLM;
|
|
312
|
+
every message edit bumps the entry version.
|
|
313
|
+
4. **Collections** → curate approved entries and export to ChatML / JSONL /
|
|
314
|
+
Alpaca / ShareGPT / Markdown.
|
|
315
|
+
5. **Chat** → talk to your model. Toggle RAG / graph / grounding per
|
|
316
|
+
conversation; answers cite the chunks they used as `[n]` references.
|
|
317
|
+
6. **Graph** → explore the entity topology extracted from your documents.
|
|
318
|
+
7. **Activity** → every long operation is a background job with live progress,
|
|
319
|
+
cancellable at any time.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Development
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
pip install -e ".[dev]"
|
|
327
|
+
pytest -q # tests (no model server required — embeddings are faked)
|
|
328
|
+
ruff check src tests
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
The test suite runs against an isolated `MINICS_HOME` with deterministic fake
|
|
332
|
+
embeddings, so it needs no network access. See
|
|
333
|
+
[docs/development.md](docs/development.md).
|
|
334
|
+
|
|
335
|
+
## Contributing
|
|
336
|
+
|
|
337
|
+
Contributions are welcome! MiniCS is a small project maintained in tiny,
|
|
338
|
+
versioned increments, so keep pull requests focused. Contributors must follow
|
|
339
|
+
the project's core principles:
|
|
340
|
+
|
|
341
|
+
- **Runs everywhere.** The application must work on any OS — Linux, macOS and
|
|
342
|
+
Windows — using **Python 3.12 or newer**. Avoid OS-specific code paths
|
|
343
|
+
unless they are guarded and tested.
|
|
344
|
+
- **Local-first.** No cloud, no accounts, no telemetry; everything stays in
|
|
345
|
+
`~/.minics`.
|
|
346
|
+
- **OpenAI-protocol only.** Talk to models exclusively through the
|
|
347
|
+
OpenAI-compatible HTTP protocol.
|
|
348
|
+
- **Lite by design.** MiniCS Lite is the compact edition: the root projects
|
|
349
|
+
(ChatML Studio and Tyness) are the ones that will grow bigger and gain more
|
|
350
|
+
capabilities over time.
|
|
351
|
+
|
|
352
|
+
See [docs/development.md](docs/development.md) for environment setup, tests
|
|
353
|
+
and style conventions.
|
|
354
|
+
|
|
355
|
+
## Status
|
|
356
|
+
|
|
357
|
+
**Version 0.3.0 is ready.** The project is still a **beta** and intentionally
|
|
358
|
+
a **small project** — a lite blend of ChatML Studio and Tyness — built in
|
|
359
|
+
small, versioned increments (see `git log`).
|
|
360
|
+
|
|
361
|
+
## License
|
|
362
|
+
|
|
363
|
+
MIT — see [pyproject.toml](pyproject.toml).
|