corethink 1.0.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.
- corethink-1.0.0/PKG-INFO +120 -0
- corethink-1.0.0/README.md +92 -0
- corethink-1.0.0/pyproject.toml +67 -0
- corethink-1.0.0/setup.cfg +4 -0
- corethink-1.0.0/src/corethink/__init__.py +17 -0
- corethink-1.0.0/src/corethink/__main__.py +3 -0
- corethink-1.0.0/src/corethink/_version.py +3 -0
- corethink-1.0.0/src/corethink/account.py +470 -0
- corethink-1.0.0/src/corethink/cli.py +1058 -0
- corethink-1.0.0/src/corethink/client.py +253 -0
- corethink-1.0.0/src/corethink/commands/__init__.py +0 -0
- corethink-1.0.0/src/corethink/commands/admin.py +703 -0
- corethink-1.0.0/src/corethink/commands/api.py +59 -0
- corethink-1.0.0/src/corethink/commands/archive.py +433 -0
- corethink-1.0.0/src/corethink/commands/auth.py +375 -0
- corethink-1.0.0/src/corethink/commands/billing.py +314 -0
- corethink-1.0.0/src/corethink/commands/capture.py +564 -0
- corethink-1.0.0/src/corethink/commands/connection.py +1266 -0
- corethink-1.0.0/src/corethink/commands/endpoint.py +1124 -0
- corethink-1.0.0/src/corethink/commands/env.py +1966 -0
- corethink-1.0.0/src/corethink/commands/hub.py +269 -0
- corethink-1.0.0/src/corethink/commands/library.py +347 -0
- corethink-1.0.0/src/corethink/commands/models.py +258 -0
- corethink-1.0.0/src/corethink/commands/train.py +2655 -0
- corethink-1.0.0/src/corethink/commands/workspace.py +622 -0
- corethink-1.0.0/src/corethink/config.py +181 -0
- corethink-1.0.0/src/corethink/context.py +46 -0
- corethink-1.0.0/src/corethink/env_template.py +117 -0
- corethink-1.0.0/src/corethink/environment_http_store.py +96 -0
- corethink-1.0.0/src/corethink/experiment_cli.py +2187 -0
- corethink-1.0.0/src/corethink/hosted_profiles.py +44 -0
- corethink-1.0.0/src/corethink/hosted_rl.py +688 -0
- corethink-1.0.0/src/corethink/hosted_rl_archive.py +74 -0
- corethink-1.0.0/src/corethink/hosted_rl_attribution.py +44 -0
- corethink-1.0.0/src/corethink/hosted_rl_billing.py +103 -0
- corethink-1.0.0/src/corethink/hosted_rl_state.py +182 -0
- corethink-1.0.0/src/corethink/jobs_cli.py +839 -0
- corethink-1.0.0/src/corethink/main.py +204 -0
- corethink-1.0.0/src/corethink/output.py +201 -0
- corethink-1.0.0/src/corethink/py.typed +0 -0
- corethink-1.0.0/src/corethink/rl_cli.py +997 -0
- corethink-1.0.0/src/corethink/rl_inspect.py +521 -0
- corethink-1.0.0/src/corethink/rl_playground.py +129 -0
- corethink-1.0.0/src/corethink/rl_reassessment.py +214 -0
- corethink-1.0.0/src/corethink/rl_settings.py +43 -0
- corethink-1.0.0/src/corethink/sdk.py +331 -0
- corethink-1.0.0/src/corethink/settings.py +162 -0
- corethink-1.0.0/src/corethink.egg-info/PKG-INFO +120 -0
- corethink-1.0.0/src/corethink.egg-info/SOURCES.txt +65 -0
- corethink-1.0.0/src/corethink.egg-info/dependency_links.txt +1 -0
- corethink-1.0.0/src/corethink.egg-info/entry_points.txt +2 -0
- corethink-1.0.0/src/corethink.egg-info/requires.txt +3 -0
- corethink-1.0.0/src/corethink.egg-info/top_level.txt +1 -0
- corethink-1.0.0/tests/test_admin.py +469 -0
- corethink-1.0.0/tests/test_archive.py +250 -0
- corethink-1.0.0/tests/test_auth.py +238 -0
- corethink-1.0.0/tests/test_billing.py +274 -0
- corethink-1.0.0/tests/test_capture.py +360 -0
- corethink-1.0.0/tests/test_connection.py +650 -0
- corethink-1.0.0/tests/test_endpoint.py +616 -0
- corethink-1.0.0/tests/test_env.py +1152 -0
- corethink-1.0.0/tests/test_hub.py +149 -0
- corethink-1.0.0/tests/test_library.py +169 -0
- corethink-1.0.0/tests/test_models.py +191 -0
- corethink-1.0.0/tests/test_train.py +920 -0
- corethink-1.0.0/tests/test_version.py +19 -0
- corethink-1.0.0/tests/test_workspace.py +379 -0
corethink-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: corethink
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: The CoreThink Workbench from your terminal: environments, training, endpoints and more.
|
|
5
|
+
Author-email: CoreThink <support@corethink.ai>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://corethink.ai
|
|
8
|
+
Project-URL: Documentation, https://workbench.corethink.ai/app/docs
|
|
9
|
+
Project-URL: Console, https://workbench.corethink.ai
|
|
10
|
+
Keywords: corethink,workbench,llm,agents,cli,training
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Software Development
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
Requires-Dist: httpx<1,>=0.27
|
|
26
|
+
Requires-Dist: rich<16,>=13.7
|
|
27
|
+
Requires-Dist: typer<1,>=0.12
|
|
28
|
+
|
|
29
|
+
# CoreThink CLI
|
|
30
|
+
|
|
31
|
+
The [CoreThink Workbench](https://workbench.corethink.ai) from your terminal. Build environments, train programs around
|
|
32
|
+
small models, check them against the base model, release them and call them — everything the Workbench console does,
|
|
33
|
+
scriptable.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install corethink # or: pipx install corethink / uv tool install corethink
|
|
37
|
+
corethink login # opens your browser to approve this terminal
|
|
38
|
+
corethink env list
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Python 3.10 or newer, on Linux, macOS and Windows.
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
corethink login # sign in (approve the code in your browser)
|
|
47
|
+
corethink hub list # starter programs that already passed their final check
|
|
48
|
+
corethink hub start employee-leave-requests # copy one into your workspace; prints its environment id
|
|
49
|
+
corethink train start <environment> --limit 20 # train it, spending at most $20
|
|
50
|
+
corethink train watch <run> # follow it live: Data → Mine → Synthesise → Verify → Ship
|
|
51
|
+
corethink train show <run> # base model vs trained program on held-out tasks
|
|
52
|
+
corethink endpoint keys create <environment> --name my-app
|
|
53
|
+
corethink endpoint call <environment> "Can Ana take 3 days off next week?"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Every command has `--help`, and `corethink --help` lists them all.
|
|
57
|
+
|
|
58
|
+
## What you can do
|
|
59
|
+
|
|
60
|
+
| Area | Commands |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| Account | `login`, `logout`, `whoami`, `token`, `profile` |
|
|
63
|
+
| Workspaces and team | `workspace` (list, use, create, members, invite, roles, audit, credit) |
|
|
64
|
+
| Environments | `env` (init, create, check, show, versions, pull, push, archive), `capture` (live traffic → tasks) |
|
|
65
|
+
| Connections | `connection` (HTTP/OpenAPI, MCP, databases, your own code; secrets, tests, health) |
|
|
66
|
+
| Hub and library | `hub` (starters), `library` (every step training has learned) |
|
|
67
|
+
| Training | `train` (start in Automatic or Advanced mode, `--from` an earlier run, test the base model, settings, estimate, list, show, watch, curve, tasks, logs, cancel, resume, archive), `models` |
|
|
68
|
+
| Serving | `endpoint` (releases, canaries, keys, usage, call a program, code snippets) |
|
|
69
|
+
| Billing | `billing` (balance, usage, buy credit) |
|
|
70
|
+
| Archive | `archive` (restore or delete for good) |
|
|
71
|
+
| Admins | `admin` (CoreThink staff only) |
|
|
72
|
+
| Anything else | `corethink api GET /api/v1/...` calls any Workbench API route |
|
|
73
|
+
|
|
74
|
+
### Training modes and hyperparameters
|
|
75
|
+
|
|
76
|
+
`corethink train start ENV` uses **Automatic** mode: recommended settings, and you set the spending limit. For
|
|
77
|
+
**Advanced** mode, pass any setting with `--set`, or a JSON file with `--settings`:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
corethink train settings # every setting, its default and its allowed range
|
|
81
|
+
corethink train start payroll --method search \
|
|
82
|
+
--set search_iterations=8 --set minibatch=30 --capacity spot_then_on_demand --limit 25
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Values are checked against the same bounds the Workbench enforces before anything is submitted.
|
|
86
|
+
|
|
87
|
+
## Scripts and CI
|
|
88
|
+
|
|
89
|
+
Make a token once (`corethink token create github-actions`, or in the Workbench: Settings › CLI sign-ins) and set it
|
|
90
|
+
as `CORETHINK_TOKEN`. No login or config file is needed then:
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
- run: pip install corethink
|
|
94
|
+
- run: corethink train start payroll --limit 10 --yes --json > run.json
|
|
95
|
+
env:
|
|
96
|
+
CORETHINK_TOKEN: ${{ secrets.CORETHINK_TOKEN }}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
* `--json` on any command prints machine-readable output to stdout (messages go to stderr).
|
|
100
|
+
* `--yes` skips confirmations; without it, a non-interactive run refuses instead of guessing.
|
|
101
|
+
* Exit codes: `0` ok, `1` failed, `2` bad usage, `3` not signed in, `4` not allowed, `5` not found, `6` conflict,
|
|
102
|
+
`7` busy or unavailable (try again), `130` interrupted.
|
|
103
|
+
|
|
104
|
+
## Settings
|
|
105
|
+
|
|
106
|
+
`corethink login` stores a revocable token in `~/.config/corethink/cli.json` (on Windows `%APPDATA%\CoreThink`),
|
|
107
|
+
readable only by you. Revoke any sign-in in the Workbench under Settings › CLI sign-ins, or with `corethink logout`.
|
|
108
|
+
|
|
109
|
+
| Variable | Meaning |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `CORETHINK_TOKEN` | A CLI token; overrides the stored sign-in |
|
|
112
|
+
| `CORETHINK_URL` | Another Workbench (default `https://workbench.corethink.ai`) |
|
|
113
|
+
| `CORETHINK_PROFILE` | Which profile to use (`corethink profile list`) |
|
|
114
|
+
| `CORETHINK_CONFIG_DIR` | Another config folder |
|
|
115
|
+
|
|
116
|
+
Shell completion: `corethink --install-completion`.
|
|
117
|
+
|
|
118
|
+
## Help
|
|
119
|
+
|
|
120
|
+
Docs: <https://workbench.corethink.ai/app/docs> · Support: support@corethink.ai
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# CoreThink CLI
|
|
2
|
+
|
|
3
|
+
The [CoreThink Workbench](https://workbench.corethink.ai) from your terminal. Build environments, train programs around
|
|
4
|
+
small models, check them against the base model, release them and call them — everything the Workbench console does,
|
|
5
|
+
scriptable.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install corethink # or: pipx install corethink / uv tool install corethink
|
|
9
|
+
corethink login # opens your browser to approve this terminal
|
|
10
|
+
corethink env list
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Python 3.10 or newer, on Linux, macOS and Windows.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
corethink login # sign in (approve the code in your browser)
|
|
19
|
+
corethink hub list # starter programs that already passed their final check
|
|
20
|
+
corethink hub start employee-leave-requests # copy one into your workspace; prints its environment id
|
|
21
|
+
corethink train start <environment> --limit 20 # train it, spending at most $20
|
|
22
|
+
corethink train watch <run> # follow it live: Data → Mine → Synthesise → Verify → Ship
|
|
23
|
+
corethink train show <run> # base model vs trained program on held-out tasks
|
|
24
|
+
corethink endpoint keys create <environment> --name my-app
|
|
25
|
+
corethink endpoint call <environment> "Can Ana take 3 days off next week?"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Every command has `--help`, and `corethink --help` lists them all.
|
|
29
|
+
|
|
30
|
+
## What you can do
|
|
31
|
+
|
|
32
|
+
| Area | Commands |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Account | `login`, `logout`, `whoami`, `token`, `profile` |
|
|
35
|
+
| Workspaces and team | `workspace` (list, use, create, members, invite, roles, audit, credit) |
|
|
36
|
+
| Environments | `env` (init, create, check, show, versions, pull, push, archive), `capture` (live traffic → tasks) |
|
|
37
|
+
| Connections | `connection` (HTTP/OpenAPI, MCP, databases, your own code; secrets, tests, health) |
|
|
38
|
+
| Hub and library | `hub` (starters), `library` (every step training has learned) |
|
|
39
|
+
| Training | `train` (start in Automatic or Advanced mode, `--from` an earlier run, test the base model, settings, estimate, list, show, watch, curve, tasks, logs, cancel, resume, archive), `models` |
|
|
40
|
+
| Serving | `endpoint` (releases, canaries, keys, usage, call a program, code snippets) |
|
|
41
|
+
| Billing | `billing` (balance, usage, buy credit) |
|
|
42
|
+
| Archive | `archive` (restore or delete for good) |
|
|
43
|
+
| Admins | `admin` (CoreThink staff only) |
|
|
44
|
+
| Anything else | `corethink api GET /api/v1/...` calls any Workbench API route |
|
|
45
|
+
|
|
46
|
+
### Training modes and hyperparameters
|
|
47
|
+
|
|
48
|
+
`corethink train start ENV` uses **Automatic** mode: recommended settings, and you set the spending limit. For
|
|
49
|
+
**Advanced** mode, pass any setting with `--set`, or a JSON file with `--settings`:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
corethink train settings # every setting, its default and its allowed range
|
|
53
|
+
corethink train start payroll --method search \
|
|
54
|
+
--set search_iterations=8 --set minibatch=30 --capacity spot_then_on_demand --limit 25
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Values are checked against the same bounds the Workbench enforces before anything is submitted.
|
|
58
|
+
|
|
59
|
+
## Scripts and CI
|
|
60
|
+
|
|
61
|
+
Make a token once (`corethink token create github-actions`, or in the Workbench: Settings › CLI sign-ins) and set it
|
|
62
|
+
as `CORETHINK_TOKEN`. No login or config file is needed then:
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
- run: pip install corethink
|
|
66
|
+
- run: corethink train start payroll --limit 10 --yes --json > run.json
|
|
67
|
+
env:
|
|
68
|
+
CORETHINK_TOKEN: ${{ secrets.CORETHINK_TOKEN }}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
* `--json` on any command prints machine-readable output to stdout (messages go to stderr).
|
|
72
|
+
* `--yes` skips confirmations; without it, a non-interactive run refuses instead of guessing.
|
|
73
|
+
* Exit codes: `0` ok, `1` failed, `2` bad usage, `3` not signed in, `4` not allowed, `5` not found, `6` conflict,
|
|
74
|
+
`7` busy or unavailable (try again), `130` interrupted.
|
|
75
|
+
|
|
76
|
+
## Settings
|
|
77
|
+
|
|
78
|
+
`corethink login` stores a revocable token in `~/.config/corethink/cli.json` (on Windows `%APPDATA%\CoreThink`),
|
|
79
|
+
readable only by you. Revoke any sign-in in the Workbench under Settings › CLI sign-ins, or with `corethink logout`.
|
|
80
|
+
|
|
81
|
+
| Variable | Meaning |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `CORETHINK_TOKEN` | A CLI token; overrides the stored sign-in |
|
|
84
|
+
| `CORETHINK_URL` | Another Workbench (default `https://workbench.corethink.ai`) |
|
|
85
|
+
| `CORETHINK_PROFILE` | Which profile to use (`corethink profile list`) |
|
|
86
|
+
| `CORETHINK_CONFIG_DIR` | Another config folder |
|
|
87
|
+
|
|
88
|
+
Shell completion: `corethink --install-completion`.
|
|
89
|
+
|
|
90
|
+
## Help
|
|
91
|
+
|
|
92
|
+
Docs: <https://workbench.corethink.ai/app/docs> · Support: support@corethink.ai
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "corethink"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "The CoreThink Workbench from your terminal: environments, training, endpoints and more."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [{ name = "CoreThink", email = "support@corethink.ai" }]
|
|
13
|
+
keywords = ["corethink", "workbench", "llm", "agents", "cli", "training"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
26
|
+
"Topic :: Software Development",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"httpx>=0.27,<1",
|
|
30
|
+
"rich>=13.7,<16",
|
|
31
|
+
"typer>=0.12,<1",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://corethink.ai"
|
|
36
|
+
Documentation = "https://workbench.corethink.ai/app/docs"
|
|
37
|
+
Console = "https://workbench.corethink.ai"
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
corethink = "corethink.main:main"
|
|
41
|
+
|
|
42
|
+
[dependency-groups]
|
|
43
|
+
# The older commands (eval, rl, experiments: hidden from help) need these; the monorepo installs them as workspace packages.
|
|
44
|
+
legacy = ["corethink-evals==0.2.0", "corethink-experiments==0.0.1"]
|
|
45
|
+
dev = ["pytest>=8"]
|
|
46
|
+
|
|
47
|
+
[tool.uv.sources]
|
|
48
|
+
corethink-evals = { workspace = true }
|
|
49
|
+
corethink-experiments = { workspace = true }
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.packages.find]
|
|
52
|
+
where = ["src"]
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.package-data]
|
|
55
|
+
corethink = ["py.typed"]
|
|
56
|
+
|
|
57
|
+
[tool.pytest.ini_options]
|
|
58
|
+
testpaths = ["tests"]
|
|
59
|
+
|
|
60
|
+
[tool.ruff]
|
|
61
|
+
line-length = 120
|
|
62
|
+
target-version = "py310"
|
|
63
|
+
|
|
64
|
+
[tool.ruff.lint]
|
|
65
|
+
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
66
|
+
# B008: Typer declares options as defaults (typer.Option(...)); UP017: datetime.UTC is 3.11+, the CLI supports 3.10
|
|
67
|
+
ignore = ["B008", "UP017", "E501"] # E501: the formatter keeps code at 120; long help strings stay whole
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""CoreThink: the Workbench from your terminal (`corethink --help`), and the older evaluation SDK.
|
|
2
|
+
|
|
3
|
+
The SDK names (Environment, TaskInstance, Template) are loaded only when asked for: they need the evaluation packages,
|
|
4
|
+
which a plain `pip install corethink` does not bring.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from corethink._version import __version__
|
|
8
|
+
|
|
9
|
+
__all__ = ["Environment", "TaskInstance", "Template", "__version__"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def __getattr__(name: str):
|
|
13
|
+
if name in {"Environment", "TaskInstance", "Template"}:
|
|
14
|
+
from corethink import sdk
|
|
15
|
+
|
|
16
|
+
return getattr(sdk, name)
|
|
17
|
+
raise AttributeError(f"module 'corethink' has no attribute {name!r}")
|