nyxGPT 2.1.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.
- nyxgpt-2.1.0/LICENSE +21 -0
- nyxgpt-2.1.0/PKG-INFO +249 -0
- nyxgpt-2.1.0/README.md +197 -0
- nyxgpt-2.1.0/pyproject.toml +189 -0
- nyxgpt-2.1.0/setup.cfg +4 -0
- nyxgpt-2.1.0/src/nyxGPT.egg-info/PKG-INFO +249 -0
- nyxgpt-2.1.0/src/nyxGPT.egg-info/SOURCES.txt +50 -0
- nyxgpt-2.1.0/src/nyxGPT.egg-info/dependency_links.txt +1 -0
- nyxgpt-2.1.0/src/nyxGPT.egg-info/entry_points.txt +2 -0
- nyxgpt-2.1.0/src/nyxGPT.egg-info/requires.txt +44 -0
- nyxgpt-2.1.0/src/nyxGPT.egg-info/top_level.txt +1 -0
- nyxgpt-2.1.0/src/nyxgpt/__init__.py +3 -0
- nyxgpt-2.1.0/src/nyxgpt/__main__.py +5 -0
- nyxgpt-2.1.0/src/nyxgpt/admin_activity.py +85 -0
- nyxgpt-2.1.0/src/nyxgpt/api_models.py +629 -0
- nyxgpt-2.1.0/src/nyxgpt/app.py +5447 -0
- nyxgpt-2.1.0/src/nyxgpt/batch_processor.py +366 -0
- nyxgpt-2.1.0/src/nyxgpt/cache.py +362 -0
- nyxgpt-2.1.0/src/nyxgpt/canary.py +1354 -0
- nyxgpt-2.1.0/src/nyxgpt/chat.py +1085 -0
- nyxgpt-2.1.0/src/nyxgpt/cli.py +2287 -0
- nyxgpt-2.1.0/src/nyxgpt/config.py +1518 -0
- nyxgpt-2.1.0/src/nyxgpt/config_wizard.py +900 -0
- nyxgpt-2.1.0/src/nyxgpt/error_tracking.py +173 -0
- nyxgpt-2.1.0/src/nyxgpt/health.py +240 -0
- nyxgpt-2.1.0/src/nyxgpt/logging.py +473 -0
- nyxgpt-2.1.0/src/nyxgpt/mcp_server.py +249 -0
- nyxgpt-2.1.0/src/nyxgpt/metrics.py +374 -0
- nyxgpt-2.1.0/src/nyxgpt/models.py +194 -0
- nyxgpt-2.1.0/src/nyxgpt/ollama_client.py +504 -0
- nyxgpt-2.1.0/src/nyxgpt/ops.py +7148 -0
- nyxgpt-2.1.0/src/nyxgpt/optional_imports.py +39 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/__init__.py +8 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/bm25.py +316 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/code_parser.py +523 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/embeddings.py +699 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/fusion.py +279 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/model_compare.py +197 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/rag.py +2153 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/reranker.py +357 -0
- nyxgpt-2.1.0/src/nyxgpt/rag/vectorstore_cassandra.py +1446 -0
- nyxgpt-2.1.0/src/nyxgpt/rate_limiter.py +154 -0
- nyxgpt-2.1.0/src/nyxgpt/resource_metrics_store.py +315 -0
- nyxgpt-2.1.0/src/nyxgpt/resource_monitor.py +259 -0
- nyxgpt-2.1.0/src/nyxgpt/restart_state.py +57 -0
- nyxgpt-2.1.0/src/nyxgpt/self_heal.py +1912 -0
- nyxgpt-2.1.0/src/nyxgpt/sessions.py +2286 -0
- nyxgpt-2.1.0/src/nyxgpt/token_counter.py +108 -0
- nyxgpt-2.1.0/src/nyxgpt/tracing.py +263 -0
- nyxgpt-2.1.0/src/nyxgpt/usage_analytics.py +221 -0
- nyxgpt-2.1.0/src/nyxgpt/wizard.py +400 -0
- nyxgpt-2.1.0/src/nyxgpt/workflow_log_store.py +305 -0
nyxgpt-2.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Darla Baker (dkblinux98)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
nyxgpt-2.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nyxGPT
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: Local ChatGPT-style system
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: fastapi>=0.110
|
|
9
|
+
Requires-Dist: uvicorn>=0.27
|
|
10
|
+
Requires-Dist: cassandra-driver>=3.29.2
|
|
11
|
+
Requires-Dist: python-frontmatter>=1.0.0
|
|
12
|
+
Requires-Dist: markdown>=3.5
|
|
13
|
+
Requires-Dist: beautifulsoup4>=4.12
|
|
14
|
+
Requires-Dist: pypdf>=3.17
|
|
15
|
+
Requires-Dist: pdfplumber>=0.11.0
|
|
16
|
+
Requires-Dist: python-docx>=1.0.0
|
|
17
|
+
Requires-Dist: python-pptx>=0.6.23
|
|
18
|
+
Requires-Dist: python-multipart>=0.0.6
|
|
19
|
+
Requires-Dist: tiktoken>=0.5.0
|
|
20
|
+
Requires-Dist: ebooklib>=0.18
|
|
21
|
+
Requires-Dist: pytesseract>=0.3.10
|
|
22
|
+
Requires-Dist: pdf2image>=1.16.0
|
|
23
|
+
Requires-Dist: pillow>=10.0.0
|
|
24
|
+
Requires-Dist: psutil>=5.9.0
|
|
25
|
+
Requires-Dist: prometheus-client>=0.20.0
|
|
26
|
+
Requires-Dist: opentelemetry-api>=1.24.0
|
|
27
|
+
Requires-Dist: opentelemetry-sdk>=1.24.0
|
|
28
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.24.0
|
|
29
|
+
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.45b0
|
|
30
|
+
Requires-Dist: opentelemetry-instrumentation-cassandra>=0.45b0
|
|
31
|
+
Requires-Dist: opentelemetry-instrumentation-urllib>=0.45b0
|
|
32
|
+
Requires-Dist: sentry-sdk>=2.0
|
|
33
|
+
Requires-Dist: httpx>=0.27
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-mock>=3.12; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
39
|
+
Requires-Dist: mypy>=1.8; extra == "dev"
|
|
40
|
+
Requires-Dist: types-Markdown; extra == "dev"
|
|
41
|
+
Requires-Dist: types-psutil; extra == "dev"
|
|
42
|
+
Requires-Dist: ruff>=0.1; extra == "dev"
|
|
43
|
+
Requires-Dist: black>=24.0; extra == "dev"
|
|
44
|
+
Requires-Dist: yamllint>=1.35; extra == "dev"
|
|
45
|
+
Requires-Dist: interrogate>=1.7; extra == "dev"
|
|
46
|
+
Requires-Dist: bandit[toml]>=1.7; extra == "dev"
|
|
47
|
+
Requires-Dist: pip-audit>=2.7; extra == "dev"
|
|
48
|
+
Requires-Dist: pre-commit>=3.6; extra == "dev"
|
|
49
|
+
Requires-Dist: httpx>=0.27; extra == "dev"
|
|
50
|
+
Requires-Dist: reportlab>=4.0; extra == "dev"
|
|
51
|
+
Dynamic: license-file
|
|
52
|
+
|
|
53
|
+
# nyxGPT
|
|
54
|
+
|
|
55
|
+
**nyxGPT** is a local-first, private, extensible ChatGPT-style system designed to run entirely on your own machine.
|
|
56
|
+
|
|
57
|
+
It uses **Ollama** for local LLM inference, supports persistent **conversation sessions**, optional **Retrieval‑Augmented Generation (RAG)** backed by **Apache Cassandra**, a powerful **CLI**, a **FastAPI backend**, and a lightweight **local web UI** built with Next.js.
|
|
58
|
+
|
|
59
|
+
Your data stays on your machine. No cloud dependency is required.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Installing 2.1.0 from PyPI — read this first
|
|
64
|
+
|
|
65
|
+
The `nyxgpt` package on PyPI provides the Python package (CLI, API, core)
|
|
66
|
+
as a versioned artifact, **but version 2.1.0 is not yet self-contained**:
|
|
67
|
+
the stack-lifecycle tooling (`nyxgpt ops install` and friends) resolves its
|
|
68
|
+
runtime resources relative to a source checkout. A bare `pip install nyxgpt`
|
|
69
|
+
on a clean machine will import and run, but **full stack operation requires
|
|
70
|
+
cloning this repository** and installing from it:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/dkblinux98/nyxGPT.git
|
|
74
|
+
cd nyxGPT
|
|
75
|
+
pip install -e .
|
|
76
|
+
nyxgpt ops install
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Repo-less, artifact-only installation is planned for a later release
|
|
80
|
+
(tracked in #3621/#3622).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Why nyxGPT?
|
|
85
|
+
|
|
86
|
+
- Local‑only by default (no cloud calls)
|
|
87
|
+
- Your prompts, sessions, and embeddings never leave your machine
|
|
88
|
+
- Clear separation between CLI, API, UI, and core logic
|
|
89
|
+
- Designed for experimentation, learning, and extension
|
|
90
|
+
- Production‑like ops tooling for a local system
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Key features
|
|
95
|
+
|
|
96
|
+
- Local LLM inference via **Ollama**
|
|
97
|
+
- Persistent sessions stored outside the repository
|
|
98
|
+
- **Message editing and regeneration** - Edit messages and fork conversations, regenerate responses
|
|
99
|
+
- **Message search** - Full-text search across all sessions with filters for role, session, and case-sensitivity
|
|
100
|
+
- **Automatic session naming** with LLM‑generated titles and smart filename sync
|
|
101
|
+
- **Session management** with right-click context menus, rename, export, delete, and pin
|
|
102
|
+
- Optional **RAG** using Cassandra 5.0 native vector search
|
|
103
|
+
- **Per‑session RAG controls** via WebUI and API
|
|
104
|
+
- Config‑driven RAG context pruning and prompt optimization
|
|
105
|
+
- **Optimized embedding generation** with async processing, GPU utilization, and adaptive batching
|
|
106
|
+
- Streaming responses (CLI, API, Web UI)
|
|
107
|
+
- Unified core shared between CLI and FastAPI
|
|
108
|
+
- Optional **API rate limiting** (disabled by default for localhost use)
|
|
109
|
+
- Homebrew‑managed background services
|
|
110
|
+
- Optional **Kubernetes deployment** for local clusters (kind/minikube/k3s)
|
|
111
|
+
- **Local canary deployment** — deploy a versioned build to canary only, gate a gradual weighted rollout on live metrics, then promote it to stable (or roll back) — operable from the SRE/admin dashboard (`nyxgpt canary` CLI or `/admin/canary`)
|
|
112
|
+
- **System health dashboard** — service uptime, dependency reachability checks (Ollama, Cassandra), resource utilization, and alert indicators live from Grafana's real alerting (falling back to a labeled local estimate if Grafana is unreachable), surfaced in the SRE/admin dashboard (`/admin/health`)
|
|
113
|
+
- **Prometheus metrics** (`/metrics`) — request counts, latency histograms, error rates, and chat/RAG business metrics, surfaced in the SRE/admin dashboard (`/admin`)
|
|
114
|
+
- **Monitoring dashboards** (Grafana) — local-only system overview, RAG performance (including ingest activity), API metrics, resource usage (CPU/mem/disk/queue/cache/rate-limit), and self-healing dashboards backed by Prometheus, plus real alerting (CPU/memory/disk/service-down/self-heal/canary rules, a Slack contact point, `nyxgpt ops alert-test` — see [docs/alerting.md](docs/alerting.md)), auto-started with `nyxgpt ops install` (`nyxgpt ops observability` to start/re-run standalone), linked from the SRE/admin dashboard (`/admin`)
|
|
115
|
+
- **Log aggregation** (Loki + promtail) — local-only centralized search over `~/.nyxGPT/logs` (api, web, Ollama, Cassandra — Ollama captured automatically by `nyxgpt ops install` whether it's running natively or as a Compose container) with a retention policy, searched via Grafana's Logs Drilldown app and a featured queryless logs panel (`{job="nyxgpt"}`) on the SRE Home dashboard, auto-started with `nyxgpt ops install`
|
|
116
|
+
- **Distributed tracing** (OpenTelemetry) — local-only request/RAG/Ollama/Cassandra spans exported to a local Jaeger instance and browsed inside Grafana via a Jaeger datasource, auto-started with `nyxgpt ops install`
|
|
117
|
+
- **Error tracking** (self-hosted GlitchTip) — local-only backend exception and web UI client error reporting via the Sentry SDK protocol, auto-started and auto-provisioned (admin user, org, project, DSN, and a Grafana API token) with `nyxgpt ops install` — zero-touch, no manual sign-in step — surfaced as Grafana panels via the Infinity datasource
|
|
118
|
+
- **SRE Overview** — Grafana is the single pane of glass: the Admin Dashboard's SRE Overview tile (`/admin/dashboard`) opens Grafana's SRE Home dashboard in a new tab, reaching every Grafana dashboard, Logs Drilldown, traces, and GlitchTip error tracking above, all provisioned as code
|
|
119
|
+
- Optional **Docker Compose** stack for one-command bring-up of every component
|
|
120
|
+
- Robust unit and integration test suite
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Quick start
|
|
125
|
+
|
|
126
|
+
### Requirements
|
|
127
|
+
|
|
128
|
+
- Python 3.11+
|
|
129
|
+
- Ollama
|
|
130
|
+
- Homebrew
|
|
131
|
+
- Docker Desktop (required for Cassandra / RAG)
|
|
132
|
+
- Node.js (for the local web UI)
|
|
133
|
+
|
|
134
|
+
### Install and configure
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
pip install -e .
|
|
138
|
+
nyxgpt wizard # interactive setup: Ollama connection, default model, RAG, config.ini
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The wizard tests your Ollama connection, helps you pick a default model,
|
|
142
|
+
optionally configures RAG, and generates `~/.nyxGPT/config.ini` — all
|
|
143
|
+
runtime configuration lives outside the repository. See
|
|
144
|
+
[Configuration](docs/configuration.md) for every `config.ini` section and
|
|
145
|
+
key, and [CLI](docs/cli.md) for the full command reference.
|
|
146
|
+
|
|
147
|
+
### Start services
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
nyxgpt ops install # installs and starts API, web UI, Cassandra helpers, observability
|
|
151
|
+
nyxgpt ops doctor # verify everything is healthy
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Then chat from the CLI or the [local web UI](docs/ui.md#local-web-ui-nextjs)
|
|
155
|
+
(`http://127.0.0.1:3000`, started by `nyxgpt ops install` or
|
|
156
|
+
`nyxgpt ops restart web`):
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
nyxgpt chat "Hello"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
`nyxgpt ops` also covers restarting, stopping, and tearing down every
|
|
163
|
+
component — see [Ops helpers](docs/ops.md). Alternative deployment paths
|
|
164
|
+
(a single-command containerized stack, a local Kubernetes cluster with
|
|
165
|
+
canary rollout, or Terraform-managed local infrastructure)
|
|
166
|
+
are documented in [Docker Compose](docs/docker-compose.md),
|
|
167
|
+
[Kubernetes](docs/kubernetes.md), and [Terraform](docs/terraform.md) —
|
|
168
|
+
each is driven through `nyxgpt`-wrapped commands, never a raw
|
|
169
|
+
`docker`/`docker compose`/`kubectl`/`terraform` invocation.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Logs & runtime data
|
|
174
|
+
|
|
175
|
+
All runtime state lives under:
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
~/.nyxGPT/
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Including:
|
|
182
|
+
|
|
183
|
+
- `sessions/` – conversation sessions
|
|
184
|
+
- `logs/` – API, web UI, Ollama, and Cassandra logs
|
|
185
|
+
- `scripts/` – service wrapper scripts
|
|
186
|
+
|
|
187
|
+
No runtime data is stored in the git repository.
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Documentation
|
|
192
|
+
|
|
193
|
+
Full documentation lives under [`docs/`](docs/README.md) — see the
|
|
194
|
+
**[documentation index](docs/README.md)** for the complete, grouped list
|
|
195
|
+
(User guides · Operations & deployment · Developer · Agent system).
|
|
196
|
+
|
|
197
|
+
Common starting points:
|
|
198
|
+
|
|
199
|
+
- **Configuration** – [`docs/configuration.md`](docs/configuration.md)
|
|
200
|
+
- **CLI** – [`docs/cli.md`](docs/cli.md)
|
|
201
|
+
- **API** – [`docs/api.md`](docs/api.md)
|
|
202
|
+
- **UI (Web)** – [`docs/ui.md`](docs/ui.md)
|
|
203
|
+
- **RAG** – [`docs/rag.md`](docs/rag.md)
|
|
204
|
+
- **Sessions & Memory** – [`docs/sessions.md`](docs/sessions.md)
|
|
205
|
+
- **Docker Compose** – [`docs/docker-compose.md`](docs/docker-compose.md)
|
|
206
|
+
- **Self-healing** – [`docs/self-healing.md`](docs/self-healing.md)
|
|
207
|
+
- **Security** – [`docs/security.md`](docs/security.md)
|
|
208
|
+
- **Architecture** – [`docs/architecture.md`](docs/architecture.md)
|
|
209
|
+
- **Troubleshooting** – [`docs/troubleshooting.md`](docs/troubleshooting.md)
|
|
210
|
+
|
|
211
|
+
If you are new to the project, start with **configuration**, then **architecture**, then **api**.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## GitHub Automation
|
|
216
|
+
|
|
217
|
+
This repository is developed by an automated agent loop (scrummaster →
|
|
218
|
+
developer → review) plus an on-demand `@claude` mention workflow, and ships
|
|
219
|
+
several Claude Code automations (MCP servers, hooks, a subagent, a skill)
|
|
220
|
+
that activate automatically in this directory. See
|
|
221
|
+
[docs/development.md](docs/development.md) for the full workflow reference
|
|
222
|
+
and [AGENTS.md](AGENTS.md) for agent roles and permissions.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Project notes
|
|
227
|
+
|
|
228
|
+
- Distribution name: **nyxGPT**
|
|
229
|
+
- Python package name: **nyxgpt**
|
|
230
|
+
- Runtime data is always externalized
|
|
231
|
+
- Build artifacts such as `*.egg-info/` must not be committed
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Status
|
|
236
|
+
|
|
237
|
+
The core architecture, ops tooling, streaming, web UI, and RAG foundations are complete.
|
|
238
|
+
|
|
239
|
+
Future work focuses on:
|
|
240
|
+
- UX refinement
|
|
241
|
+
- performance tuning
|
|
242
|
+
- richer session metadata and search
|
|
243
|
+
- optional multi‑user and auth extensions
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
nyxGPT is released under the [MIT License](LICENSE).
|
nyxgpt-2.1.0/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# nyxGPT
|
|
2
|
+
|
|
3
|
+
**nyxGPT** is a local-first, private, extensible ChatGPT-style system designed to run entirely on your own machine.
|
|
4
|
+
|
|
5
|
+
It uses **Ollama** for local LLM inference, supports persistent **conversation sessions**, optional **Retrieval‑Augmented Generation (RAG)** backed by **Apache Cassandra**, a powerful **CLI**, a **FastAPI backend**, and a lightweight **local web UI** built with Next.js.
|
|
6
|
+
|
|
7
|
+
Your data stays on your machine. No cloud dependency is required.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Installing 2.1.0 from PyPI — read this first
|
|
12
|
+
|
|
13
|
+
The `nyxgpt` package on PyPI provides the Python package (CLI, API, core)
|
|
14
|
+
as a versioned artifact, **but version 2.1.0 is not yet self-contained**:
|
|
15
|
+
the stack-lifecycle tooling (`nyxgpt ops install` and friends) resolves its
|
|
16
|
+
runtime resources relative to a source checkout. A bare `pip install nyxgpt`
|
|
17
|
+
on a clean machine will import and run, but **full stack operation requires
|
|
18
|
+
cloning this repository** and installing from it:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git clone https://github.com/dkblinux98/nyxGPT.git
|
|
22
|
+
cd nyxGPT
|
|
23
|
+
pip install -e .
|
|
24
|
+
nyxgpt ops install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Repo-less, artifact-only installation is planned for a later release
|
|
28
|
+
(tracked in #3621/#3622).
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Why nyxGPT?
|
|
33
|
+
|
|
34
|
+
- Local‑only by default (no cloud calls)
|
|
35
|
+
- Your prompts, sessions, and embeddings never leave your machine
|
|
36
|
+
- Clear separation between CLI, API, UI, and core logic
|
|
37
|
+
- Designed for experimentation, learning, and extension
|
|
38
|
+
- Production‑like ops tooling for a local system
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Key features
|
|
43
|
+
|
|
44
|
+
- Local LLM inference via **Ollama**
|
|
45
|
+
- Persistent sessions stored outside the repository
|
|
46
|
+
- **Message editing and regeneration** - Edit messages and fork conversations, regenerate responses
|
|
47
|
+
- **Message search** - Full-text search across all sessions with filters for role, session, and case-sensitivity
|
|
48
|
+
- **Automatic session naming** with LLM‑generated titles and smart filename sync
|
|
49
|
+
- **Session management** with right-click context menus, rename, export, delete, and pin
|
|
50
|
+
- Optional **RAG** using Cassandra 5.0 native vector search
|
|
51
|
+
- **Per‑session RAG controls** via WebUI and API
|
|
52
|
+
- Config‑driven RAG context pruning and prompt optimization
|
|
53
|
+
- **Optimized embedding generation** with async processing, GPU utilization, and adaptive batching
|
|
54
|
+
- Streaming responses (CLI, API, Web UI)
|
|
55
|
+
- Unified core shared between CLI and FastAPI
|
|
56
|
+
- Optional **API rate limiting** (disabled by default for localhost use)
|
|
57
|
+
- Homebrew‑managed background services
|
|
58
|
+
- Optional **Kubernetes deployment** for local clusters (kind/minikube/k3s)
|
|
59
|
+
- **Local canary deployment** — deploy a versioned build to canary only, gate a gradual weighted rollout on live metrics, then promote it to stable (or roll back) — operable from the SRE/admin dashboard (`nyxgpt canary` CLI or `/admin/canary`)
|
|
60
|
+
- **System health dashboard** — service uptime, dependency reachability checks (Ollama, Cassandra), resource utilization, and alert indicators live from Grafana's real alerting (falling back to a labeled local estimate if Grafana is unreachable), surfaced in the SRE/admin dashboard (`/admin/health`)
|
|
61
|
+
- **Prometheus metrics** (`/metrics`) — request counts, latency histograms, error rates, and chat/RAG business metrics, surfaced in the SRE/admin dashboard (`/admin`)
|
|
62
|
+
- **Monitoring dashboards** (Grafana) — local-only system overview, RAG performance (including ingest activity), API metrics, resource usage (CPU/mem/disk/queue/cache/rate-limit), and self-healing dashboards backed by Prometheus, plus real alerting (CPU/memory/disk/service-down/self-heal/canary rules, a Slack contact point, `nyxgpt ops alert-test` — see [docs/alerting.md](docs/alerting.md)), auto-started with `nyxgpt ops install` (`nyxgpt ops observability` to start/re-run standalone), linked from the SRE/admin dashboard (`/admin`)
|
|
63
|
+
- **Log aggregation** (Loki + promtail) — local-only centralized search over `~/.nyxGPT/logs` (api, web, Ollama, Cassandra — Ollama captured automatically by `nyxgpt ops install` whether it's running natively or as a Compose container) with a retention policy, searched via Grafana's Logs Drilldown app and a featured queryless logs panel (`{job="nyxgpt"}`) on the SRE Home dashboard, auto-started with `nyxgpt ops install`
|
|
64
|
+
- **Distributed tracing** (OpenTelemetry) — local-only request/RAG/Ollama/Cassandra spans exported to a local Jaeger instance and browsed inside Grafana via a Jaeger datasource, auto-started with `nyxgpt ops install`
|
|
65
|
+
- **Error tracking** (self-hosted GlitchTip) — local-only backend exception and web UI client error reporting via the Sentry SDK protocol, auto-started and auto-provisioned (admin user, org, project, DSN, and a Grafana API token) with `nyxgpt ops install` — zero-touch, no manual sign-in step — surfaced as Grafana panels via the Infinity datasource
|
|
66
|
+
- **SRE Overview** — Grafana is the single pane of glass: the Admin Dashboard's SRE Overview tile (`/admin/dashboard`) opens Grafana's SRE Home dashboard in a new tab, reaching every Grafana dashboard, Logs Drilldown, traces, and GlitchTip error tracking above, all provisioned as code
|
|
67
|
+
- Optional **Docker Compose** stack for one-command bring-up of every component
|
|
68
|
+
- Robust unit and integration test suite
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Quick start
|
|
73
|
+
|
|
74
|
+
### Requirements
|
|
75
|
+
|
|
76
|
+
- Python 3.11+
|
|
77
|
+
- Ollama
|
|
78
|
+
- Homebrew
|
|
79
|
+
- Docker Desktop (required for Cassandra / RAG)
|
|
80
|
+
- Node.js (for the local web UI)
|
|
81
|
+
|
|
82
|
+
### Install and configure
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install -e .
|
|
86
|
+
nyxgpt wizard # interactive setup: Ollama connection, default model, RAG, config.ini
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The wizard tests your Ollama connection, helps you pick a default model,
|
|
90
|
+
optionally configures RAG, and generates `~/.nyxGPT/config.ini` — all
|
|
91
|
+
runtime configuration lives outside the repository. See
|
|
92
|
+
[Configuration](docs/configuration.md) for every `config.ini` section and
|
|
93
|
+
key, and [CLI](docs/cli.md) for the full command reference.
|
|
94
|
+
|
|
95
|
+
### Start services
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
nyxgpt ops install # installs and starts API, web UI, Cassandra helpers, observability
|
|
99
|
+
nyxgpt ops doctor # verify everything is healthy
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Then chat from the CLI or the [local web UI](docs/ui.md#local-web-ui-nextjs)
|
|
103
|
+
(`http://127.0.0.1:3000`, started by `nyxgpt ops install` or
|
|
104
|
+
`nyxgpt ops restart web`):
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
nyxgpt chat "Hello"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`nyxgpt ops` also covers restarting, stopping, and tearing down every
|
|
111
|
+
component — see [Ops helpers](docs/ops.md). Alternative deployment paths
|
|
112
|
+
(a single-command containerized stack, a local Kubernetes cluster with
|
|
113
|
+
canary rollout, or Terraform-managed local infrastructure)
|
|
114
|
+
are documented in [Docker Compose](docs/docker-compose.md),
|
|
115
|
+
[Kubernetes](docs/kubernetes.md), and [Terraform](docs/terraform.md) —
|
|
116
|
+
each is driven through `nyxgpt`-wrapped commands, never a raw
|
|
117
|
+
`docker`/`docker compose`/`kubectl`/`terraform` invocation.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Logs & runtime data
|
|
122
|
+
|
|
123
|
+
All runtime state lives under:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
~/.nyxGPT/
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Including:
|
|
130
|
+
|
|
131
|
+
- `sessions/` – conversation sessions
|
|
132
|
+
- `logs/` – API, web UI, Ollama, and Cassandra logs
|
|
133
|
+
- `scripts/` – service wrapper scripts
|
|
134
|
+
|
|
135
|
+
No runtime data is stored in the git repository.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Documentation
|
|
140
|
+
|
|
141
|
+
Full documentation lives under [`docs/`](docs/README.md) — see the
|
|
142
|
+
**[documentation index](docs/README.md)** for the complete, grouped list
|
|
143
|
+
(User guides · Operations & deployment · Developer · Agent system).
|
|
144
|
+
|
|
145
|
+
Common starting points:
|
|
146
|
+
|
|
147
|
+
- **Configuration** – [`docs/configuration.md`](docs/configuration.md)
|
|
148
|
+
- **CLI** – [`docs/cli.md`](docs/cli.md)
|
|
149
|
+
- **API** – [`docs/api.md`](docs/api.md)
|
|
150
|
+
- **UI (Web)** – [`docs/ui.md`](docs/ui.md)
|
|
151
|
+
- **RAG** – [`docs/rag.md`](docs/rag.md)
|
|
152
|
+
- **Sessions & Memory** – [`docs/sessions.md`](docs/sessions.md)
|
|
153
|
+
- **Docker Compose** – [`docs/docker-compose.md`](docs/docker-compose.md)
|
|
154
|
+
- **Self-healing** – [`docs/self-healing.md`](docs/self-healing.md)
|
|
155
|
+
- **Security** – [`docs/security.md`](docs/security.md)
|
|
156
|
+
- **Architecture** – [`docs/architecture.md`](docs/architecture.md)
|
|
157
|
+
- **Troubleshooting** – [`docs/troubleshooting.md`](docs/troubleshooting.md)
|
|
158
|
+
|
|
159
|
+
If you are new to the project, start with **configuration**, then **architecture**, then **api**.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## GitHub Automation
|
|
164
|
+
|
|
165
|
+
This repository is developed by an automated agent loop (scrummaster →
|
|
166
|
+
developer → review) plus an on-demand `@claude` mention workflow, and ships
|
|
167
|
+
several Claude Code automations (MCP servers, hooks, a subagent, a skill)
|
|
168
|
+
that activate automatically in this directory. See
|
|
169
|
+
[docs/development.md](docs/development.md) for the full workflow reference
|
|
170
|
+
and [AGENTS.md](AGENTS.md) for agent roles and permissions.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Project notes
|
|
175
|
+
|
|
176
|
+
- Distribution name: **nyxGPT**
|
|
177
|
+
- Python package name: **nyxgpt**
|
|
178
|
+
- Runtime data is always externalized
|
|
179
|
+
- Build artifacts such as `*.egg-info/` must not be committed
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Status
|
|
184
|
+
|
|
185
|
+
The core architecture, ops tooling, streaming, web UI, and RAG foundations are complete.
|
|
186
|
+
|
|
187
|
+
Future work focuses on:
|
|
188
|
+
- UX refinement
|
|
189
|
+
- performance tuning
|
|
190
|
+
- richer session metadata and search
|
|
191
|
+
- optional multi‑user and auth extensions
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
nyxGPT is released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "nyxGPT"
|
|
3
|
+
version = "2.1.0"
|
|
4
|
+
description = "Local ChatGPT-style system"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"fastapi>=0.110",
|
|
9
|
+
"uvicorn>=0.27",
|
|
10
|
+
"cassandra-driver>=3.29.2",
|
|
11
|
+
"python-frontmatter>=1.0.0",
|
|
12
|
+
"markdown>=3.5",
|
|
13
|
+
"beautifulsoup4>=4.12",
|
|
14
|
+
"pypdf>=3.17",
|
|
15
|
+
"pdfplumber>=0.11.0",
|
|
16
|
+
"python-docx>=1.0.0",
|
|
17
|
+
"python-pptx>=0.6.23",
|
|
18
|
+
"python-multipart>=0.0.6",
|
|
19
|
+
"tiktoken>=0.5.0",
|
|
20
|
+
"ebooklib>=0.18",
|
|
21
|
+
"pytesseract>=0.3.10",
|
|
22
|
+
"pdf2image>=1.16.0",
|
|
23
|
+
"pillow>=10.0.0",
|
|
24
|
+
"psutil>=5.9.0",
|
|
25
|
+
"prometheus-client>=0.20.0",
|
|
26
|
+
"opentelemetry-api>=1.24.0",
|
|
27
|
+
"opentelemetry-sdk>=1.24.0",
|
|
28
|
+
"opentelemetry-exporter-otlp-proto-http>=1.24.0",
|
|
29
|
+
"opentelemetry-instrumentation-fastapi>=0.45b0",
|
|
30
|
+
"opentelemetry-instrumentation-cassandra>=0.45b0",
|
|
31
|
+
# Instruments urllib.request (ollama_client.py's HTTP client) so outbound
|
|
32
|
+
# Ollama calls get a client span plus automatic W3C traceparent header
|
|
33
|
+
# injection -- the "no hand-rolled header forwarding" correlation backbone
|
|
34
|
+
# requirement (#3430).
|
|
35
|
+
"opentelemetry-instrumentation-urllib>=0.45b0",
|
|
36
|
+
"sentry-sdk>=2.0",
|
|
37
|
+
# ops.py imports httpx unconditionally (GlitchTip HTTP client) and the api
|
|
38
|
+
# imports ops.py, so httpx is a core runtime dep -- not just a ui/dev extra.
|
|
39
|
+
"httpx>=0.27",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
dev = [
|
|
44
|
+
# Testing
|
|
45
|
+
"pytest>=8.0",
|
|
46
|
+
"pytest-cov>=5.0",
|
|
47
|
+
"pytest-mock>=3.12",
|
|
48
|
+
"pytest-asyncio>=0.23",
|
|
49
|
+
|
|
50
|
+
# Type checking
|
|
51
|
+
"mypy>=1.8",
|
|
52
|
+
"types-Markdown",
|
|
53
|
+
"types-psutil",
|
|
54
|
+
|
|
55
|
+
# Linting & formatting
|
|
56
|
+
"ruff>=0.1",
|
|
57
|
+
"black>=24.0",
|
|
58
|
+
"yamllint>=1.35",
|
|
59
|
+
"interrogate>=1.7",
|
|
60
|
+
|
|
61
|
+
# Security scanning (#3501)
|
|
62
|
+
"bandit[toml]>=1.7",
|
|
63
|
+
"pip-audit>=2.7",
|
|
64
|
+
|
|
65
|
+
# Pre-commit hooks
|
|
66
|
+
"pre-commit>=3.6",
|
|
67
|
+
|
|
68
|
+
# Development tools
|
|
69
|
+
"httpx>=0.27",
|
|
70
|
+
"reportlab>=4.0",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[project.scripts]
|
|
74
|
+
nyxgpt = "nyxgpt.cli:cli"
|
|
75
|
+
|
|
76
|
+
# By default, run all tests. Use -m unit or -m integration to filter.
|
|
77
|
+
[tool.pytest.ini_options]
|
|
78
|
+
minversion = "8.0"
|
|
79
|
+
addopts = "-v"
|
|
80
|
+
testpaths = ["tests"]
|
|
81
|
+
asyncio_mode = "auto"
|
|
82
|
+
markers = [
|
|
83
|
+
"unit: fast unit tests with no external dependencies",
|
|
84
|
+
"integration: tests requiring external services (Ollama/Cassandra/Docker)",
|
|
85
|
+
"all: alias marker for running the full test suite",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[tool.setuptools]
|
|
89
|
+
package-dir = {"" = "src"}
|
|
90
|
+
|
|
91
|
+
[tool.setuptools.packages.find]
|
|
92
|
+
where = ["src"]
|
|
93
|
+
|
|
94
|
+
[tool.mypy]
|
|
95
|
+
python_version = "3.11"
|
|
96
|
+
warn_return_any = true
|
|
97
|
+
warn_unused_configs = true
|
|
98
|
+
disallow_untyped_defs = false
|
|
99
|
+
disallow_incomplete_defs = false
|
|
100
|
+
check_untyped_defs = false
|
|
101
|
+
disallow_untyped_decorators = false
|
|
102
|
+
no_implicit_optional = true
|
|
103
|
+
warn_redundant_casts = true
|
|
104
|
+
warn_unused_ignores = true
|
|
105
|
+
warn_no_return = true
|
|
106
|
+
warn_unreachable = true
|
|
107
|
+
strict_equality = true
|
|
108
|
+
show_error_codes = true
|
|
109
|
+
|
|
110
|
+
# Ignore missing imports for third-party libraries without stubs
|
|
111
|
+
[[tool.mypy.overrides]]
|
|
112
|
+
module = [
|
|
113
|
+
"frontmatter",
|
|
114
|
+
"cassandra.*",
|
|
115
|
+
"pdfplumber",
|
|
116
|
+
"reportlab.*",
|
|
117
|
+
"docx.*",
|
|
118
|
+
"pptx.*",
|
|
119
|
+
"ebooklib.*",
|
|
120
|
+
"pytesseract",
|
|
121
|
+
"pdf2image",
|
|
122
|
+
"PIL.*",
|
|
123
|
+
"fastapi",
|
|
124
|
+
"fastapi.*",
|
|
125
|
+
"starlette.*",
|
|
126
|
+
"pydantic",
|
|
127
|
+
"pydantic.*",
|
|
128
|
+
"bs4",
|
|
129
|
+
"pypdf",
|
|
130
|
+
"httpx",
|
|
131
|
+
"tiktoken",
|
|
132
|
+
"psutil",
|
|
133
|
+
"markdown",
|
|
134
|
+
"opentelemetry.*",
|
|
135
|
+
]
|
|
136
|
+
ignore_missing_imports = true
|
|
137
|
+
|
|
138
|
+
[tool.ruff]
|
|
139
|
+
target-version = "py311"
|
|
140
|
+
line-length = 100
|
|
141
|
+
select = [
|
|
142
|
+
"E", # pycodestyle errors
|
|
143
|
+
"W", # pycodestyle warnings
|
|
144
|
+
"F", # pyflakes
|
|
145
|
+
"I", # isort
|
|
146
|
+
"B", # flake8-bugbear
|
|
147
|
+
"C4", # flake8-comprehensions
|
|
148
|
+
"UP", # pyupgrade
|
|
149
|
+
"ARG", # flake8-unused-arguments
|
|
150
|
+
"SIM", # flake8-simplify
|
|
151
|
+
]
|
|
152
|
+
ignore = [
|
|
153
|
+
"E501", # line too long (handled by black)
|
|
154
|
+
"B008", # do not perform function calls in argument defaults
|
|
155
|
+
"C901", # too complex
|
|
156
|
+
]
|
|
157
|
+
|
|
158
|
+
[tool.ruff.per-file-ignores]
|
|
159
|
+
"__init__.py" = ["F401"]
|
|
160
|
+
"tests/**/*.py" = ["ARG"]
|
|
161
|
+
|
|
162
|
+
[tool.ruff.isort]
|
|
163
|
+
known-first-party = ["nyxgpt"]
|
|
164
|
+
|
|
165
|
+
[tool.interrogate]
|
|
166
|
+
# Docstring-coverage gate (issue #3225). Nested/closure functions and classes
|
|
167
|
+
# (e.g. retry-callback closures) are exempt as trivial implementation
|
|
168
|
+
# details of an already-documented enclosing function.
|
|
169
|
+
ignore-nested-functions = true
|
|
170
|
+
ignore-nested-classes = true
|
|
171
|
+
fail-under = 100
|
|
172
|
+
verbose = 1
|
|
173
|
+
exclude = ["tests"]
|
|
174
|
+
|
|
175
|
+
[tool.black]
|
|
176
|
+
line-length = 100
|
|
177
|
+
target-version = ["py311"]
|
|
178
|
+
include = '\.pyi?$'
|
|
179
|
+
|
|
180
|
+
[tool.bandit]
|
|
181
|
+
# SAST scan of runtime code only -- tests intentionally exercise things
|
|
182
|
+
# bandit flags out of context (e.g. hardcoded test fixtures, subprocess
|
|
183
|
+
# calls against local test services). See security/README.md for the CI
|
|
184
|
+
# gate (severity/confidence thresholds) and suppression conventions (#3501).
|
|
185
|
+
exclude_dirs = ["tests", ".venv", "venv", "web"]
|
|
186
|
+
|
|
187
|
+
[build-system]
|
|
188
|
+
requires = ["setuptools>=68"]
|
|
189
|
+
build-backend = "setuptools.build_meta"
|
nyxgpt-2.1.0/setup.cfg
ADDED