principle_files data job, which generates a QA pair Parquet file you can use for instruction fine-tuning. The workflow bundles file upload, ingestion, prompt configuration, and alignment into a single managed job.
Before you start: Upload your source files using the Files API and have your file IDs ready before Step 2. Not sure which approach fits your use case? See Fine-tuning.
Step 1: Create a data job
Endpoint:POST /v1/flow/data-jobs
Create a job shell with job_type set to principle_files.
Step 2: Add files to the job
Endpoint:POST /v1/flow/data-jobs/{id}/add-files
Attach uploaded file IDs to the job. Non-Markdown files (PDF, DOCX, PPT) trigger ingestion automatically. Markdown files are marked as alignment-ready immediately.
Ingestion mode and the UIWhen ingesting files through the SeekrFlow UI, speed-optimized mode is always used. The SDK lets you choose between speed-optimized and accuracy-optimized.
Choose an ingestion method
Step 3: Monitor ingestion
PollGET /v1/flow/data-jobs/{id} until the job status is no longer file_processing.
If a file fails, fix the source, re-upload it, and attach it to the job again. To skip the file instead, remove it via
POST /v1/flow/data-jobs/{id}/remove-files. See Monitor ingestion for a full reference on job states and error codes.
Step 4: Review and edit ingested Markdown
Download the generated Markdown files from thefiles array in the job detail and review for accuracy. Re-upload any corrected versions and remove the originals before starting alignment.
Step 5: Set a system prompt
Asystem_prompt is required for principle_files jobs before alignment can start. You can generate one from high-level instructions or write your own.
Generate a prompt
Endpoint:POST /v1/flow/data-jobs/gen_system_prompt
gen_system_prompt returns a suggested prompt but does not save it to the job. You must call PATCH /v1/flow/data-jobs/{id} to set it.Set the prompt on the job
Endpoint:PATCH /v1/flow/data-jobs/{id}
gen_system_prompt first.
Once alignment starts, the system prompt is locked. Make any changes before calling
/start.Step 6: Start alignment
Endpoint:POST /v1/flow/data-jobs/{id}/start
The /start endpoint enforces pre-flight validation before launching. Requirements for principle_files:
statusmust beready_to_startsystem_promptmust be set- At least one processed Markdown file must be attached
422 Unprocessable Entity with a descriptive message.
Step 7: Monitor alignment
PollGET /v1/flow/data-jobs/{id} to track progress.
status_message gives a human-readable description of the alignment job’s current state, including the reason if the job fails.
Step 8: Retrieve output files
Endpoint:GET /v1/flow/alignment/{job_id}/outputs
Once status shows completed, use this endpoint to retrieve metadata for all input and output files associated with the alignment job.
"purpose": "fine-tune" (the .parquet) is the file ID to use when creating a fine-tuning job.