drift-ml 0.2.7__tar.gz → 0.2.8__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.
Files changed (26) hide show
  1. drift_ml-0.2.8/PKG-INFO +129 -0
  2. {drift_ml-0.2.7 → drift_ml-0.2.8}/README.md +30 -1
  3. drift_ml-0.2.8/drift/__init__.py +25 -0
  4. drift_ml-0.2.8/drift/api.py +116 -0
  5. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/engine_launcher.py +1 -1
  6. drift_ml-0.2.8/drift_ml.egg-info/PKG-INFO +129 -0
  7. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift_ml.egg-info/SOURCES.txt +1 -0
  8. {drift_ml-0.2.7 → drift_ml-0.2.8}/pyproject.toml +13 -1
  9. drift_ml-0.2.7/PKG-INFO +0 -10
  10. drift_ml-0.2.7/drift/__init__.py +0 -5
  11. drift_ml-0.2.7/drift_ml.egg-info/PKG-INFO +0 -10
  12. {drift_ml-0.2.7 → drift_ml-0.2.8}/LICENSE +0 -0
  13. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/__main__.py +0 -0
  14. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/cli/__init__.py +0 -0
  15. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/cli/client.py +0 -0
  16. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/cli/repl.py +0 -0
  17. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/cli/session.py +0 -0
  18. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/llm_adapters/__init__.py +0 -0
  19. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/llm_adapters/base.py +0 -0
  20. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/llm_adapters/gemini_cli.py +0 -0
  21. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift/llm_adapters/local_llm.py +0 -0
  22. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift_ml.egg-info/dependency_links.txt +0 -0
  23. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift_ml.egg-info/entry_points.txt +0 -0
  24. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift_ml.egg-info/requires.txt +0 -0
  25. {drift_ml-0.2.7 → drift_ml-0.2.8}/drift_ml.egg-info/top_level.txt +0 -0
  26. {drift_ml-0.2.7 → drift_ml-0.2.8}/setup.cfg +0 -0
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: drift-ml
3
+ Version: 0.2.8
4
+ Summary: drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth.
5
+ Project-URL: Homepage, https://github.com/lakshitsachdeva/intent2model
6
+ Project-URL: Repository, https://github.com/lakshitsachdeva/intent2model
7
+ Keywords: automl,ml,machine-learning,cli,chat,local-first
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: requests>=2.28.0
20
+ Dynamic: license-file
21
+
22
+ # drift
23
+
24
+ **Terminal-first, chat-based AutoML.** Open source. No tokens. No auth.
25
+
26
+ ---
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pipx install drift-ml
32
+ ```
33
+
34
+ Or:
35
+
36
+ ```bash
37
+ npm install -g drift-ml
38
+ ```
39
+
40
+ (Both require `pipx install drift-ml` for the Python CLI.)
41
+
42
+ ---
43
+
44
+ ## Run
45
+
46
+ ```bash
47
+ drift
48
+ ```
49
+
50
+ On first run, drift downloads and starts the engine automatically. No backend setup. No config. No tokens.
51
+
52
+ ---
53
+
54
+ ## How it works
55
+
56
+ - **Local-first** — Engine runs on your machine. Data never leaves.
57
+ - **Chat-based** — `load data.csv`, `predict price`, `try something stronger`
58
+ - **Auto-start** — Engine downloads and starts in the background. You never start a backend manually.
59
+ - **No auth** — No API keys for drift. (You need an LLM for training: Ollama, Gemini CLI, etc.)
60
+
61
+ ---
62
+
63
+ ## Example (CLI)
64
+
65
+ ```text
66
+ drift › load iris.csv
67
+ drift › predict variety
68
+ drift › try something stronger
69
+ drift › quit
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Use as library
75
+
76
+ ```bash
77
+ pip install drift-ml
78
+ ```
79
+
80
+ ```python
81
+ from drift import Drift
82
+
83
+ d = Drift()
84
+ d.load("iris.csv")
85
+ d.chat("predict sepal length")
86
+ result = d.train()
87
+ print(result["metrics"])
88
+ ```
89
+
90
+ Or with an existing engine:
91
+
92
+ ```python
93
+ from drift import Drift
94
+
95
+ d = Drift(base_url="http://localhost:8000")
96
+ d.load("data.csv")
97
+ reply = d.chat("predict price")
98
+ print(d.get_last_reply(reply))
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Philosophy
104
+
105
+ drift should feel like `git`, `docker`, `brew` — a tool you trust immediately. Zero friction. Open source.
106
+
107
+ ---
108
+
109
+ ## Web UI (optional)
110
+
111
+ This repo also includes a web UI. For development:
112
+
113
+ ```bash
114
+ ./start.sh
115
+ ```
116
+
117
+ Then open http://localhost:3000
118
+
119
+ ---
120
+
121
+ ## Contributing
122
+
123
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
124
+
125
+ ---
126
+
127
+ ## License
128
+
129
+ MIT
@@ -39,7 +39,7 @@ On first run, drift downloads and starts the engine automatically. No backend se
39
39
 
40
40
  ---
41
41
 
42
- ## Example
42
+ ## Example (CLI)
43
43
 
44
44
  ```text
45
45
  drift › load iris.csv
@@ -50,6 +50,35 @@ drift › quit
50
50
 
51
51
  ---
52
52
 
53
+ ## Use as library
54
+
55
+ ```bash
56
+ pip install drift-ml
57
+ ```
58
+
59
+ ```python
60
+ from drift import Drift
61
+
62
+ d = Drift()
63
+ d.load("iris.csv")
64
+ d.chat("predict sepal length")
65
+ result = d.train()
66
+ print(result["metrics"])
67
+ ```
68
+
69
+ Or with an existing engine:
70
+
71
+ ```python
72
+ from drift import Drift
73
+
74
+ d = Drift(base_url="http://localhost:8000")
75
+ d.load("data.csv")
76
+ reply = d.chat("predict price")
77
+ print(d.get_last_reply(reply))
78
+ ```
79
+
80
+ ---
81
+
53
82
  ## Philosophy
54
83
 
55
84
  drift should feel like `git`, `docker`, `brew` — a tool you trust immediately. Zero friction. Open source.
@@ -0,0 +1,25 @@
1
+ """
2
+ drift — terminal-first, chat-based AutoML. Use as CLI or library.
3
+
4
+ CLI:
5
+ pip install drift-ml
6
+ drift
7
+ drift › load data.csv
8
+ drift › predict price
9
+
10
+ Library:
11
+ from drift import Drift
12
+
13
+ d = Drift()
14
+ d.load("data.csv")
15
+ d.chat("predict price")
16
+ result = d.train()
17
+ """
18
+
19
+ __version__ = "0.2.8"
20
+
21
+ from drift.api import Drift
22
+ from drift.cli.client import BackendClient, BackendError
23
+ from drift.engine_launcher import ensure_engine
24
+
25
+ __all__ = ["Drift", "BackendClient", "BackendError", "ensure_engine", "__version__"]
@@ -0,0 +1,116 @@
1
+ """
2
+ Programmatic API for drift — use in your own Python scripts.
3
+
4
+ Example:
5
+ from drift import Drift
6
+
7
+ d = Drift()
8
+ d.load("data.csv")
9
+ d.chat("predict price")
10
+ result = d.train()
11
+ print(result["metrics"])
12
+ """
13
+
14
+ import os
15
+ from typing import Any, Dict, Optional
16
+
17
+ from drift.cli.client import BackendClient, BackendError
18
+
19
+
20
+ class Drift:
21
+ """
22
+ High-level client for drift. Load data, chat, train — in your code.
23
+
24
+ Uses a local engine (auto-started if needed) or DRIFT_BACKEND_URL.
25
+ """
26
+
27
+ def __init__(self, base_url: Optional[str] = None):
28
+ """
29
+ Args:
30
+ base_url: Engine URL. If None, uses DRIFT_BACKEND_URL or auto-starts engine.
31
+ """
32
+ if base_url:
33
+ self._client = BackendClient(base_url=base_url)
34
+ else:
35
+ url = os.environ.get("DRIFT_BACKEND_URL")
36
+ if not url:
37
+ from drift.engine_launcher import ensure_engine
38
+
39
+ if not ensure_engine():
40
+ raise BackendError(
41
+ "Could not start engine. Set DRIFT_BACKEND_URL or check ~/.drift/bin/.engine-stderr.log"
42
+ )
43
+ port = os.environ.get("DRIFT_ENGINE_PORT", "8000")
44
+ url = f"http://127.0.0.1:{port}"
45
+ self._client = BackendClient(base_url=url)
46
+ self._session_id: Optional[str] = None
47
+ self._dataset_id: Optional[str] = None
48
+
49
+ def load(self, path: str) -> "Drift":
50
+ """
51
+ Load a CSV file. Returns self for chaining.
52
+
53
+ Args:
54
+ path: Path to CSV file.
55
+
56
+ Returns:
57
+ self
58
+ """
59
+ out = self._client.upload_csv(path)
60
+ self._session_id = out["session_id"]
61
+ self._dataset_id = out["dataset_id"]
62
+ return self
63
+
64
+ def chat(self, message: str) -> Dict[str, Any]:
65
+ """
66
+ Send a chat message. Returns chat_history and trigger_training.
67
+
68
+ Args:
69
+ message: Natural language, e.g. "predict price", "try something stronger".
70
+
71
+ Returns:
72
+ {"chat_history": [...], "trigger_training": bool}
73
+ """
74
+ if not self._session_id:
75
+ raise BackendError("Load a dataset first: drift.load('data.csv')")
76
+ return self._client.chat(self._session_id, message)
77
+
78
+ def train(self) -> Dict[str, Any]:
79
+ """
80
+ Run one training attempt. Blocking.
81
+
82
+ Returns:
83
+ run_id, metrics, refused, agent_message, etc.
84
+ """
85
+ if not self._session_id:
86
+ raise BackendError("Load a dataset first: drift.load('data.csv')")
87
+ return self._client.train(self._session_id)
88
+
89
+ def get_last_reply(self, chat_result: Optional[Dict[str, Any]] = None) -> Optional[str]:
90
+ """Get the last agent reply from chat_history."""
91
+ hist = (chat_result or {}).get("chat_history") if chat_result else None
92
+ if not hist and self._session_id:
93
+ sess = self._client.get_session(self._session_id)
94
+ hist = sess.get("chat_history") or []
95
+ if not hist:
96
+ return None
97
+ for m in reversed(hist):
98
+ if m.get("role") == "agent" and m.get("content"):
99
+ return m["content"]
100
+ return None
101
+
102
+ def download_notebook(self, run_id: str) -> Optional[bytes]:
103
+ """Download training notebook as bytes."""
104
+ return self._client.download_notebook(run_id)
105
+
106
+ def download_model(self, run_id: str) -> Optional[bytes]:
107
+ """Download trained model pickle as bytes."""
108
+ return self._client.download_model(run_id)
109
+
110
+ def health(self) -> Dict[str, Any]:
111
+ """Check engine health and LLM status."""
112
+ return self._client.health()
113
+
114
+ @property
115
+ def session_id(self) -> Optional[str]:
116
+ return self._session_id
@@ -16,7 +16,7 @@ except ImportError:
16
16
  requests = None
17
17
 
18
18
  GITHUB_REPO = "lakshitsachdeva/intent2model" # Engine binaries (same repo)
19
- ENGINE_TAG = "v0.2.7" # Pinned — direct URL, no API, no rate limits
19
+ ENGINE_TAG = "v0.2.8" # Pinned — direct URL, no API, no rate limits
20
20
  ENGINE_PORT = os.environ.get("DRIFT_ENGINE_PORT", "8000")
21
21
  HEALTH_URL = f"http://127.0.0.1:{ENGINE_PORT}/health"
22
22
 
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: drift-ml
3
+ Version: 0.2.8
4
+ Summary: drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth.
5
+ Project-URL: Homepage, https://github.com/lakshitsachdeva/intent2model
6
+ Project-URL: Repository, https://github.com/lakshitsachdeva/intent2model
7
+ Keywords: automl,ml,machine-learning,cli,chat,local-first
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: requests>=2.28.0
20
+ Dynamic: license-file
21
+
22
+ # drift
23
+
24
+ **Terminal-first, chat-based AutoML.** Open source. No tokens. No auth.
25
+
26
+ ---
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pipx install drift-ml
32
+ ```
33
+
34
+ Or:
35
+
36
+ ```bash
37
+ npm install -g drift-ml
38
+ ```
39
+
40
+ (Both require `pipx install drift-ml` for the Python CLI.)
41
+
42
+ ---
43
+
44
+ ## Run
45
+
46
+ ```bash
47
+ drift
48
+ ```
49
+
50
+ On first run, drift downloads and starts the engine automatically. No backend setup. No config. No tokens.
51
+
52
+ ---
53
+
54
+ ## How it works
55
+
56
+ - **Local-first** — Engine runs on your machine. Data never leaves.
57
+ - **Chat-based** — `load data.csv`, `predict price`, `try something stronger`
58
+ - **Auto-start** — Engine downloads and starts in the background. You never start a backend manually.
59
+ - **No auth** — No API keys for drift. (You need an LLM for training: Ollama, Gemini CLI, etc.)
60
+
61
+ ---
62
+
63
+ ## Example (CLI)
64
+
65
+ ```text
66
+ drift › load iris.csv
67
+ drift › predict variety
68
+ drift › try something stronger
69
+ drift › quit
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Use as library
75
+
76
+ ```bash
77
+ pip install drift-ml
78
+ ```
79
+
80
+ ```python
81
+ from drift import Drift
82
+
83
+ d = Drift()
84
+ d.load("iris.csv")
85
+ d.chat("predict sepal length")
86
+ result = d.train()
87
+ print(result["metrics"])
88
+ ```
89
+
90
+ Or with an existing engine:
91
+
92
+ ```python
93
+ from drift import Drift
94
+
95
+ d = Drift(base_url="http://localhost:8000")
96
+ d.load("data.csv")
97
+ reply = d.chat("predict price")
98
+ print(d.get_last_reply(reply))
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Philosophy
104
+
105
+ drift should feel like `git`, `docker`, `brew` — a tool you trust immediately. Zero friction. Open source.
106
+
107
+ ---
108
+
109
+ ## Web UI (optional)
110
+
111
+ This repo also includes a web UI. For development:
112
+
113
+ ```bash
114
+ ./start.sh
115
+ ```
116
+
117
+ Then open http://localhost:3000
118
+
119
+ ---
120
+
121
+ ## Contributing
122
+
123
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
124
+
125
+ ---
126
+
127
+ ## License
128
+
129
+ MIT
@@ -3,6 +3,7 @@ README.md
3
3
  pyproject.toml
4
4
  drift/__init__.py
5
5
  drift/__main__.py
6
+ drift/api.py
6
7
  drift/engine_launcher.py
7
8
  drift/cli/__init__.py
8
9
  drift/cli/client.py
@@ -4,12 +4,24 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "drift-ml"
7
- version = "0.2.7"
7
+ version = "0.2.8"
8
8
  description = "drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth."
9
9
  requires-python = ">=3.10"
10
10
  dependencies = [
11
11
  "requests>=2.28.0",
12
12
  ]
13
+ readme = "README.md"
14
+ keywords = ["automl", "ml", "machine-learning", "cli", "chat", "local-first"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
24
+ ]
13
25
 
14
26
  [project.urls]
15
27
  Homepage = "https://github.com/lakshitsachdeva/intent2model"
drift_ml-0.2.7/PKG-INFO DELETED
@@ -1,10 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: drift-ml
3
- Version: 0.2.7
4
- Summary: drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth.
5
- Project-URL: Homepage, https://github.com/lakshitsachdeva/intent2model
6
- Project-URL: Repository, https://github.com/lakshitsachdeva/intent2model
7
- Requires-Python: >=3.10
8
- License-File: LICENSE
9
- Requires-Dist: requests>=2.28.0
10
- Dynamic: license-file
@@ -1,5 +0,0 @@
1
- """
2
- drift — terminal-first, chat-based CLI for the same AutoML planner + executor as the web app.
3
- """
4
-
5
- __version__ = "0.1.0"
@@ -1,10 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: drift-ml
3
- Version: 0.2.7
4
- Summary: drift — terminal-first, chat-based AutoML. Open source. No tokens. No auth.
5
- Project-URL: Homepage, https://github.com/lakshitsachdeva/intent2model
6
- Project-URL: Repository, https://github.com/lakshitsachdeva/intent2model
7
- Requires-Python: >=3.10
8
- License-File: LICENSE
9
- Requires-Dist: requests>=2.28.0
10
- Dynamic: license-file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes