epi-recorder 1.0.0__py3-none-any.whl

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.
@@ -0,0 +1,503 @@
1
+ Metadata-Version: 2.4
2
+ Name: epi-recorder
3
+ Version: 1.0.0
4
+ Summary: Evidence Packaged Infrastructure for AI workflows - Record, Verify, and Replay AI runs
5
+ Author-email: EPI Project <contact@epi.dev>
6
+ Maintainer-email: EPI Project <contact@epi.dev>
7
+ License: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/epi-project/epi-recorder
9
+ Project-URL: Documentation, https://epi.dev/docs
10
+ Project-URL: Repository, https://github.com/epi-project/epi-recorder
11
+ Project-URL: Issues, https://github.com/epi-project/epi-recorder/issues
12
+ Keywords: ai,reproducibility,verification,llm,evidence,openai,cryptography,workflow,audit
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Security :: Cryptography
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: pydantic>=2.0.0
28
+ Requires-Dist: cryptography>=41.0.0
29
+ Requires-Dist: cbor2>=5.6.0
30
+ Requires-Dist: typer[all]>=0.12.0
31
+ Requires-Dist: rich>=13.0.0
32
+ Provides-Extra: dev
33
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
34
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
35
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
36
+ Requires-Dist: black>=24.0.0; extra == "dev"
37
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
38
+ Dynamic: license-file
39
+
40
+ # EPI - Evidence Packaged Infrastructure
41
+
42
+ **The "PDF for AI Workflows"** โ€” Self-contained, cryptographically verified evidence packages for AI systems.
43
+
44
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
45
+ [![Python](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
46
+ [![Status](https://img.shields.io/badge/status-MVP-green.svg)]()
47
+
48
+ ---
49
+
50
+ ## ๐Ÿš€ Quick Start
51
+
52
+ ### **Python API** (Recommended for Developers)
53
+
54
+ ```python
55
+ from epi_recorder import record
56
+
57
+ # Wrap your AI code with a context manager
58
+ with record("my_workflow.epi", workflow_name="Demo"):
59
+ # Your AI code runs normally - automatically recorded!
60
+ response = openai.chat.completions.create(
61
+ model="gpt-4",
62
+ messages=[{"role": "user", "content": "Hello!"}]
63
+ )
64
+
65
+ # Optionally log custom events
66
+ epi.log_step("calculation", {"result": 42})
67
+
68
+ # .epi file is automatically created, signed, and ready to verify!
69
+ ```
70
+
71
+ ### **CLI** (For Shell Scripts & CI/CD)
72
+
73
+ ```bash
74
+ # Install
75
+ pip install epi-recorder
76
+
77
+ # Record a workflow
78
+ epi record --out demo.epi -- python my_ai_script.py
79
+
80
+ # Verify integrity and authenticity
81
+ epi verify demo.epi
82
+
83
+ # View in browser
84
+ epi view demo.epi
85
+ ```
86
+
87
+ **That's it!** Your AI workflow is now captured, signed, and viewable.
88
+
89
+ ---
90
+
91
+ ## ๐ŸŽฏ What is EPI?
92
+
93
+ EPI captures **everything** that happens during an AI workflow:
94
+ - ๐Ÿค– **LLM API calls** (prompts, responses, tokens, latency)
95
+ - ๐Ÿ”’ **Secrets redacted** automatically (15+ patterns)
96
+ - ๐Ÿ“ฆ **Files and artifacts** (content-addressed)
97
+ - ๐Ÿ–ฅ๏ธ **Environment snapshot** (OS, Python, packages)
98
+ - โœ… **Cryptographically signed** (Ed25519)
99
+ - ๐Ÿ“Š **Beautiful timeline viewer** (static HTML)
100
+
101
+ All packaged into a **single `.epi` file** that anyone can verify and replay.
102
+
103
+ ---
104
+
105
+ ## ๐ŸŒŸ Why EPI?
106
+
107
+ ### **The Problem**
108
+
109
+ โŒ 70% of AI research cannot be reproduced
110
+ โŒ AI models fail mysteriously in production
111
+ โŒ Cannot prove how AI decisions were made
112
+ โŒ "It worked on my machine" debugging nightmare
113
+
114
+ ### **The Solution**
115
+
116
+ โœ… **Record**: Capture complete AI workflows with one command
117
+ โœ… **Verify**: Cryptographic proof of authenticity
118
+ โœ… **Share**: Single file contains everything
119
+ โœ… **Replay**: Deterministic reproduction (offline mode)
120
+ โœ… **Audit**: Full transparency for compliance
121
+
122
+ ---
123
+
124
+ ## ๐Ÿ“– Core Features
125
+
126
+ ### ๐ŸŽฌ **Recording**
127
+ ```bash
128
+ epi record --out experiment.epi -- python train.py
129
+ ```
130
+ Automatically captures:
131
+ - OpenAI API calls (GPT-4, GPT-3.5, etc.)
132
+ - Shell commands and outputs
133
+ - Python execution context
134
+ - Generated files and artifacts
135
+ - Environment variables (redacted)
136
+
137
+ ### ๐Ÿ” **Security by Default**
138
+ - **Auto-redacts secrets**: API keys, tokens, credentials
139
+ - **Ed25519 signatures**: Cryptographic proof of authenticity
140
+ - **Frictionless**: Auto-generates keypair on first run
141
+ - **No secret leakage**: 15+ regex patterns protect sensitive data
142
+
143
+ ### โœ… **Verification**
144
+ ```bash
145
+ epi verify experiment.epi
146
+ ```
147
+ Three-level verification:
148
+ 1. **Structural**: Valid ZIP format and schema
149
+ 2. **Integrity**: SHA-256 file hashes match
150
+ 3. **Authenticity**: Ed25519 signature valid
151
+
152
+ ### ๐Ÿ‘๏ธ **Beautiful Viewer**
153
+ ```bash
154
+ epi view experiment.epi
155
+ ```
156
+ Opens in your browser with:
157
+ - Interactive timeline of all steps
158
+ - LLM chat bubbles (prompts & responses)
159
+ - Trust badges (signed/unsigned)
160
+ - Artifact previews
161
+ - **Zero code execution** (pure JSON rendering)
162
+
163
+ ---
164
+
165
+ ## ๐ŸŽ“ Use Cases
166
+
167
+ ### **AI Researchers**
168
+ ```bash
169
+ # Submit verifiable research
170
+ epi record --out paper_experiment.epi -- python reproduce.py
171
+ ```
172
+ โœ… 100% reproducible methodology
173
+ โœ… Eliminates "it worked on my machine"
174
+ โœ… Speeds up peer review
175
+
176
+ ### **Enterprise AI Teams**
177
+ ```bash
178
+ # Capture production AI runs
179
+ epi record --out prod_run.epi -- python deploy_model.py
180
+ ```
181
+ โœ… Audit trails for compliance (EU AI Act, SOC 2)
182
+ โœ… Debug production failures instantly
183
+ โœ… Version control for AI systems
184
+
185
+ ### **Software Engineers**
186
+ ```bash
187
+ # Perfect bug reproduction
188
+ epi record --out bug_report.epi -- python flaky_test.py
189
+ ```
190
+ โœ… Share exact failing conditions
191
+ โœ… Debug AI features faster
192
+ โœ… Stable CI/CD for AI features
193
+
194
+ ---
195
+
196
+ ## ๐Ÿ› ๏ธ Installation
197
+
198
+ ### **From Source** (Development)
199
+ ```bash
200
+ cd epi-recorder
201
+ pip install -e .
202
+ ```
203
+
204
+ ### **Requirements**
205
+ - Python 3.11+
206
+ - Windows, macOS, or Linux
207
+
208
+ ---
209
+
210
+ ## ๐Ÿ“š Commands
211
+
212
+ ### **`epi record`**
213
+ Record a workflow into a `.epi` file.
214
+
215
+ ```bash
216
+ epi record --out run.epi -- python script.py [args...]
217
+
218
+ Options:
219
+ --out PATH Output .epi file (required)
220
+ --no-sign Don't sign the manifest
221
+ --no-redact Disable secret redaction
222
+ ```
223
+
224
+ ### **`epi verify`**
225
+ Verify `.epi` file integrity and authenticity.
226
+
227
+ ```bash
228
+ epi verify run.epi
229
+
230
+ Options:
231
+ --json Output as JSON
232
+ --verbose Verbose output
233
+ ```
234
+
235
+ ### **`epi view`**
236
+ Open `.epi` file in browser.
237
+
238
+ ```bash
239
+ epi view run.epi
240
+ ```
241
+
242
+ ### **`epi keys`**
243
+ Manage Ed25519 key pairs.
244
+
245
+ ```bash
246
+ epi keys generate --name mykey
247
+ epi keys list
248
+ epi keys export --name mykey
249
+ ```
250
+
251
+ ---
252
+
253
+ ## ๐Ÿ Python API
254
+
255
+ ### **Why Use the Python API?**
256
+
257
+ The Python API is the **recommended way** to integrate EPI into your AI applications:
258
+ - โœ… **Zero CLI overhead** - no shell commands needed
259
+ - โœ… **Seamless integration** - just wrap your code with `with record()`
260
+ - โœ… **Auto-captures OpenAI** - automatically records all LLM calls
261
+ - โœ… **Custom logging** - manually log steps and artifacts
262
+ - โœ… **Auto-signed** - cryptographic signatures by default
263
+
264
+ ### **Basic Usage**
265
+
266
+ ```python
267
+ from epi_recorder import record
268
+
269
+ with record("experiment.epi", workflow_name="My Experiment"):
270
+ # Your code here - automatically recorded
271
+ result = train_model()
272
+ print(f"Result: {result}")
273
+ ```
274
+
275
+ ### **With Custom Logging**
276
+
277
+ ```python
278
+ from epi_recorder import record
279
+ from pathlib import Path
280
+
281
+ with record("workflow.epi", workflow_name="Data Processing", tags=["v1.0", "prod"]) as epi:
282
+ # Process data
283
+ data = load_data("input.csv")
284
+
285
+ # Log custom steps
286
+ epi.log_step("data.loaded", {
287
+ "rows": len(data),
288
+ "columns": list(data.columns)
289
+ })
290
+
291
+ # Process...
292
+ results = process(data)
293
+
294
+ # Save output
295
+ results.to_csv("output.csv")
296
+
297
+ # Capture the output file
298
+ epi.log_artifact(Path("output.csv"))
299
+
300
+ # Log summary
301
+ epi.log_step("processing.complete", {
302
+ "status": "success",
303
+ "output_rows": len(results)
304
+ })
305
+ ```
306
+
307
+ ### **With OpenAI (Auto-Recorded)**
308
+
309
+ ```python
310
+ from epi_recorder import record
311
+ import openai
312
+
313
+ with record("chat_session.epi", workflow_name="Customer Support"):
314
+ # OpenAI calls are automatically captured!
315
+ response = openai.chat.completions.create(
316
+ model="gpt-4",
317
+ messages=[
318
+ {"role": "system", "content": "You are a helpful assistant."},
319
+ {"role": "user", "content": "What is quantum computing?"}
320
+ ]
321
+ )
322
+
323
+ print(response.choices[0].message.content)
324
+
325
+ # API keys are automatically redacted in the recording!
326
+ ```
327
+
328
+ ### **Advanced Options**
329
+
330
+ ```python
331
+ from epi_recorder import EpiRecorderSession
332
+
333
+ with EpiRecorderSession(
334
+ "advanced.epi",
335
+ workflow_name="Advanced Workflow",
336
+ tags=["experiment", "2024-10-29"],
337
+ auto_sign=True, # Sign with default key (default: True)
338
+ redact=True, # Redact secrets (default: True)
339
+ default_key_name="my-key" # Custom signing key
340
+ ) as epi:
341
+ # Your workflow
342
+ pass
343
+ ```
344
+
345
+ ### **Manual LLM Logging** (For Custom Integrations)
346
+
347
+ ```python
348
+ from epi_recorder import record
349
+
350
+ with record("custom_llm.epi") as epi:
351
+ # For custom/proprietary LLM APIs
352
+ epi.log_llm_request("claude-3-opus", {
353
+ "messages": [{"role": "user", "content": "Hello"}],
354
+ "temperature": 0.7
355
+ })
356
+
357
+ # ... make actual API call ...
358
+
359
+ epi.log_llm_response({
360
+ "model": "claude-3-opus",
361
+ "content": "Hello! How can I help?",
362
+ "tokens": 25
363
+ })
364
+ ```
365
+
366
+ ### **Error Handling**
367
+
368
+ Recordings are saved even if errors occur:
369
+
370
+ ```python
371
+ from epi_recorder import record
372
+
373
+ try:
374
+ with record("debug_session.epi", workflow_name="Debug") as epi:
375
+ epi.log_step("process.start", {"status": "ok"})
376
+
377
+ # Code that might fail
378
+ result = risky_operation()
379
+
380
+ except Exception as e:
381
+ print(f"Error: {e}")
382
+ # .epi file is still created with error logs!
383
+ ```
384
+
385
+ ### **Running the Examples**
386
+
387
+ ```bash
388
+ # See examples directory
389
+ python examples/api_example.py
390
+
391
+ # Verify the generated .epi files
392
+ epi verify example_basic.epi
393
+
394
+ # View in browser
395
+ epi view example_basic.epi
396
+ ```
397
+
398
+ ---
399
+
400
+ ## ๐Ÿ”’ Security
401
+
402
+ ### **Automatic Redaction**
403
+ EPI automatically removes:
404
+ - OpenAI API keys (`sk-...`)
405
+ - Anthropic API keys (`sk-ant-...`)
406
+ - AWS credentials (`AKIA...`)
407
+ - GitHub tokens (`ghp_...`)
408
+ - Bearer tokens, JWT tokens
409
+ - Database connection strings
410
+ - Private keys (PEM format)
411
+
412
+ ### **Cryptographic Signing**
413
+ - **Algorithm**: Ed25519 (RFC 8032)
414
+ - **Key Size**: 256 bits
415
+ - **Hash**: SHA-256 with canonical CBOR
416
+ - **Storage**: `~/.epi/keys/` (secure permissions)
417
+
418
+ ---
419
+
420
+ ## ๐Ÿงช Example
421
+
422
+ ```python
423
+ # chat_example.py
424
+ from openai import OpenAI
425
+
426
+ client = OpenAI()
427
+
428
+ response = client.chat.completions.create(
429
+ model="gpt-3.5-turbo",
430
+ messages=[
431
+ {"role": "user", "content": "Explain quantum computing"}
432
+ ]
433
+ )
434
+
435
+ print(response.choices[0].message.content)
436
+ ```
437
+
438
+ ```bash
439
+ # Record it
440
+ epi record --out chat.epi -- python chat_example.py
441
+
442
+ # Verify it
443
+ epi verify chat.epi
444
+ # โœ… Trust Level: HIGH
445
+
446
+ # View it
447
+ epi view chat.epi
448
+ # Opens timeline in browser
449
+ ```
450
+
451
+ ---
452
+
453
+ ## ๐Ÿง‘โ€๐Ÿ’ป Development
454
+
455
+ ### **Running Tests**
456
+ ```bash
457
+ pytest tests/ -v --cov=epi_core --cov=epi_cli
458
+ ```
459
+
460
+ ### **Project Structure**
461
+ ```
462
+ epi-recorder/
463
+ โ”œโ”€โ”€ epi_core/ # Core logic
464
+ โ”œโ”€โ”€ epi_cli/ # CLI commands
465
+ โ”œโ”€โ”€ epi_recorder/ # Runtime capture
466
+ โ”œโ”€โ”€ epi_viewer_static/ # Static viewer
467
+ โ”œโ”€โ”€ tests/ # Test suite
468
+ โ””โ”€โ”€ docs/ # Specification
469
+ ```
470
+
471
+ ---
472
+
473
+ ## ๐Ÿ“Š Status
474
+
475
+ โœ… **Phase 0**: Foundation (complete)
476
+ โœ… **Phase 1**: Trust Layer (complete)
477
+ โœ… **Phase 2**: Recorder MVP (complete)
478
+ โœ… **Phase 3**: Viewer MVP (complete)
479
+ ๐Ÿ”„ **Phase 4**: Polish & docs (in progress)
480
+
481
+ **Current**: Keystone MVP - Production Ready
482
+
483
+ ---
484
+
485
+ ## ๐Ÿ“„ License
486
+
487
+ Apache License 2.0
488
+
489
+ ---
490
+
491
+ ## ๐Ÿ™ Acknowledgments
492
+
493
+ Built with:
494
+ - [Pydantic](https://pydantic.dev/)
495
+ - [Typer](https://typer.tiangolo.com/)
496
+ - [Rich](https://rich.readthedocs.io/)
497
+ - [cryptography](https://cryptography.io/)
498
+
499
+ ---
500
+
501
+ **Made with โค๏ธ for the AI community**
502
+
503
+ *Turning opaque AI runs into transparent, portable digital proofs.*
@@ -0,0 +1,25 @@
1
+ epi_cli/__init__.py,sha256=SSpuDlDqVBbPvR21CCRcNOB61EyB8jAUzNd8XISADa8,98
2
+ epi_cli/keys.py,sha256=0ytG_rrwbn3YA_girZb_BNG-2HLnbx9WIKHwdDcfmHM,9116
3
+ epi_cli/main.py,sha256=5rhqkmsu6Cy_mOkU7wYmrhhmfZors6P6JhlWd6KcNqY,3452
4
+ epi_cli/record.py,sha256=2YLMDMojEe8uH7t3yHUtLfL1uAV9uEbAM4IsUoaoCF8,6975
5
+ epi_cli/verify.py,sha256=wg3K41rY0dmKpLfEfzWl1_J8twThz8wrL7BG74XkzSQ,8210
6
+ epi_cli/view.py,sha256=MJebDImddv-P0nb3-Mch1R5528gjvbpLxEsu5zxZqeI,2470
7
+ epi_core/__init__.py,sha256=LD57Jbx5gsxxfntPoUwYhDd5EgEyyDLZr-0qA1BQJBc,312
8
+ epi_core/container.py,sha256=nO0Z4pdvTwgKaPk7c6NmRfwGoesNOj6GOK5oabvIh3k,11949
9
+ epi_core/redactor.py,sha256=YBA8of5ZSsOYAjJOlveDyMgNuFRUIUu_8dDs5vuzsNY,9273
10
+ epi_core/schemas.py,sha256=hqX6tp2AiAuyNLz3MylYjZX5d7uNUYD-liZ5k7yzCM8,3487
11
+ epi_core/serialize.py,sha256=rx6tEnfXX1gW-AGEUpVWPEB9zsaIZ4qYn65s-7aQQtA,4736
12
+ epi_core/trust.py,sha256=yk-ZrqVl9nTabAdSOfCTNUbAWSJvMds7wxc0ghdtEPM,7551
13
+ epi_recorder/__init__.py,sha256=WDgzWMiTJVnA26sXaF5Id8ptQawLlkLeU2pVy268lQU,405
14
+ epi_recorder/api.py,sha256=opVfDb0wjUXtVTRz1CFD7F-ZngWrzfo0TWga8C3zhlE,13952
15
+ epi_recorder/bootstrap.py,sha256=yE1y0rjQ-1D-ZhWFipX_6qXFTA2BPlEm8Ft4Z0iex88,1845
16
+ epi_recorder/environment.py,sha256=DAudeqABQQjKLgxsuN23klJQMrdjnLuj4R3SOr2AjDA,5990
17
+ epi_recorder/patcher.py,sha256=Cr6orXgxGWiUlasekyTf1EUXjDsQK86WqqQ0nXVQyaw,11817
18
+ epi_recorder-1.0.0.dist-info/licenses/LICENSE,sha256=aUgjAzBUkmKIZy3AZ_XAZWoh3kzkRlkOc3JHLVfyF-A,11540
19
+ epi_viewer_static/app.js,sha256=3yZpMZtMDl6Ug36jB4R_ZZkYlt3WCFX0LNmYZIAZ_DU,9662
20
+ epi_viewer_static/index.html,sha256=OMEggB4u4O9eIDAO2wb9u_qOwZwxcLl4K9BjcK6vaZg,3136
21
+ epi_recorder-1.0.0.dist-info/METADATA,sha256=0WTyAo-jZdVNf3G1qbYMM4GGWMUN6BhZv6WO_mN85Yo,12826
22
+ epi_recorder-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ epi_recorder-1.0.0.dist-info/entry_points.txt,sha256=MfMwqVRx_yMGbuPpiyjz2f8fQp8TUbHmRC1H_bupoyM,41
24
+ epi_recorder-1.0.0.dist-info/top_level.txt,sha256=nKpWVQUoGWK-gyLLVbrxibQUlIzI0TowNzMDondlHpI,48
25
+ epi_recorder-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ epi = epi_cli.main:app