SDK and API Reference
cognify-sdk v2 Python reference. All methods are available after import cognify following initialization.
cognify.init()
Initialize a Cognify tracking session. Must be called before any other SDK method.
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace | str | required | Your Cognify workspace slug. |
api_key | str | required | API key from workspace settings. |
run_name | str | optional | Human-readable name for this run. Auto-generated if omitted. |
tags | list[str] | optional | Tags for filtering and grouping runs. |
project | str | optional | Project name within workspace. |
Returns: CognifyRun object.
cognify.dataset()
Register and version a dataset for the current run.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | str | required | Dataset identifier. |
source | Dataset | str | Path | required | HuggingFace Dataset, file path, or S3/GCS URI. |
split | str | optional | Dataset split name (e.g. "train", "eval"). |
version | str | optional | Manual version override. Auto-increments if omitted. |
Returns: DatasetVersion with fields version_id, sha256, record_count, timestamp.
cognify.run()
Log hyperparameters for the current run. Call once before training starts.
cognify.run(
config={
"learning_rate": 2e-5,
"batch_size": 16,
"epochs": 3,
"model_base": "meta-llama/Llama-3-8B"
}
)
cognify.checkpoint()
Manually log a checkpoint. In most cases, framework auto-hooks handle this automatically.
| Parameter | Type | Required | Description |
|---|---|---|---|
step | int | required | Training step number. |
path | str | Path | optional | Path to checkpoint files (for metadata hash). |
metrics | dict | optional | Metrics dict, e.g. {"loss": 0.234}. |
cognify.eval()
Log evaluation results for a checkpoint or the final model.
cognify.eval(
benchmark="safety_classification",
results={
"accuracy": 0.942,
"f1": 0.934,
"policy_threshold_met": True
},
checkpoint_step=None # None = final model
)
cognify.export_audit()
Export a compliance package for a completed run.
| Parameter | Type | Required | Description |
|---|---|---|---|
run_name or run_id | str | required | Identify the run to export. |
formats | list[str] | optional | Export formats. Options: "pdf", "json", "xlsx". Default: ["pdf"]. |
template | str | optional | Audit template: "standard", "eu_ai_act", "custom". |
output_dir | str | Path | optional | Output directory. Defaults to ./cognify_exports. |
REST API endpoints
Base URL: https://api.fyntuneq.com/v2. All endpoints require Authorization: Bearer <api_key>.
| Method | Endpoint | Description |
|---|---|---|
| GET | /runs | List runs in workspace. |
| GET | /runs/{run_id} | Get run details including lineage graph. |
| POST | /runs/{run_id}/export | Trigger audit package export. |
| GET | /datasets/{dataset_id}/versions | List all versions of a dataset. |
| GET | /runs/{run_id}/lineage | Get lineage graph as JSON. |
| POST | /runs/{run_id}/approve | Submit compliance approval (compliance reviewer role required). |
| DELETE | /runs/{run_id} | Delete a run (soft delete only; audit records are immutable). |