ai-experiments 2.1.1 → 2.3.0

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 (47) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +13 -1
  3. package/package.json +7 -7
  4. package/src/clickhouse-storage.ts +698 -0
  5. package/src/decide.ts +8 -10
  6. package/src/experiment.ts +12 -12
  7. package/src/index.ts +13 -3
  8. package/src/tracking.ts +3 -3
  9. package/test/cartesian.test.ts +287 -0
  10. package/test/clickhouse-storage.test.ts +470 -0
  11. package/test/decide.test.ts +414 -0
  12. package/test/experiment.test.ts +473 -0
  13. package/test/tracking.test.ts +347 -0
  14. package/vitest.config.ts +34 -0
  15. package/.turbo/turbo-build.log +0 -5
  16. package/dist/cartesian.d.ts +0 -140
  17. package/dist/cartesian.d.ts.map +0 -1
  18. package/dist/cartesian.js +0 -216
  19. package/dist/cartesian.js.map +0 -1
  20. package/dist/decide.d.ts +0 -152
  21. package/dist/decide.d.ts.map +0 -1
  22. package/dist/decide.js +0 -329
  23. package/dist/decide.js.map +0 -1
  24. package/dist/experiment.d.ts +0 -53
  25. package/dist/experiment.d.ts.map +0 -1
  26. package/dist/experiment.js +0 -292
  27. package/dist/experiment.js.map +0 -1
  28. package/dist/index.d.ts +0 -14
  29. package/dist/index.d.ts.map +0 -1
  30. package/dist/index.js +0 -19
  31. package/dist/index.js.map +0 -1
  32. package/dist/tracking.d.ts +0 -159
  33. package/dist/tracking.d.ts.map +0 -1
  34. package/dist/tracking.js +0 -310
  35. package/dist/tracking.js.map +0 -1
  36. package/dist/types.d.ts +0 -198
  37. package/dist/types.d.ts.map +0 -1
  38. package/dist/types.js +0 -5
  39. package/dist/types.js.map +0 -1
  40. package/src/cartesian.js +0 -215
  41. package/src/chdb-storage.js +0 -464
  42. package/src/chdb-storage.ts +0 -565
  43. package/src/decide.js +0 -328
  44. package/src/experiment.js +0 -291
  45. package/src/index.js +0 -20
  46. package/src/tracking.js +0 -309
  47. package/src/types.js +0 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # ai-experiments
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9e2779a]
8
+ - Updated dependencies [b7c7c57]
9
+ - ai-functions@2.3.0
10
+ - ai-database@2.3.0
11
+
12
+ ## 2.1.3
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+ - ai-functions@2.1.3
18
+
3
19
  ## 2.1.1
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,18 @@
1
1
  # ai-experiments
2
2
 
3
- AI-powered experimentation primitives for testing and evaluating models.
3
+ ![Stability: Experimental](https://img.shields.io/badge/stability-experimental-red)
4
+
5
+ Runtime A/B testing for AI variants in production. Traffic splitting, multi-armed bandits, parameter sweeps, and ClickHouse-backed outcome tracking via the canonical `ai-database` adapter.
6
+
7
+ ## Lifecycle
8
+
9
+ **Runtime (production).** `ai-experiments` is for splitting live traffic across model/prompt/parameter variants and measuring outcomes against real users. Reach for it when you need to learn which variant wins under production conditions — not in a test suite.
10
+
11
+ ## Not for
12
+
13
+ - **Unit testing.** If you want to assert that a specific input produces a specific output during development or CI, use [`ai-tests`](../ai-tests) plus `vitest`. `ai-experiments` exists to *measure* outcomes across users, not to *assert* them against fixtures.
14
+ - **Sandboxing untrusted code.** That's [`ai-evaluate`](../ai-evaluate)'s job.
15
+ - **Offline-only experiments.** While `Experiment()` works offline for parameter sweeps, the package's value comes from production tracking — if you're never deploying the variants, a plain `for` loop is simpler.
4
16
 
5
17
  ## Overview
6
18
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-experiments",
3
- "version": "2.1.1",
4
- "description": "AI-powered experimentation primitives for testing and evaluating models",
3
+ "version": "2.3.0",
4
+ "description": "Runtime A/B testing for AI variants in production - traffic splitting, decision strategies, and ClickHouse-backed outcome tracking",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -11,21 +11,21 @@
11
11
  "types": "./dist/index.d.ts"
12
12
  },
13
13
  "./storage": {
14
- "import": "./dist/chdb-storage.js",
15
- "types": "./dist/chdb-storage.d.ts"
14
+ "import": "./dist/clickhouse-storage.js",
15
+ "types": "./dist/clickhouse-storage.d.ts"
16
16
  }
17
17
  },
18
18
  "scripts": {
19
19
  "build": "tsc",
20
20
  "dev": "tsc --watch",
21
- "test": "vitest",
21
+ "test": "vitest run",
22
22
  "typecheck": "tsc --noEmit",
23
23
  "lint": "eslint .",
24
24
  "clean": "rm -rf dist"
25
25
  },
26
26
  "dependencies": {
27
- "ai-functions": "2.1.1",
28
- "chdb": "^1.6.0"
27
+ "ai-database": "2.3.0",
28
+ "ai-functions": "2.3.0"
29
29
  },
30
30
  "keywords": [
31
31
  "ai",