AGPL-3.0-or-later · forever.

remote preview · outputs

Choose the right byte path.

List artifacts, parse text or JSON, download bytes and stream large files without forcing every output into memory.

Format is part of the artifact contract. The SDK provides a separate method for text, JSON, bytes and ReadableStream so a large output cannot hide behind a convenient string.

List before downloading.

The artifact list carries name, size, format and content type. Let product policy choose which methods and destinations are allowed.

const files = await nika.jobs.artifacts(job_id)
for (const file of files) {
  console.log(file.name, file.size, file.format)
}

Make text and JSON explicit.

artifact returns text. artifactJson parses once and keeps its generic at the application boundary.

const report = await nika.jobs.artifact(job_id, 'report.md')
const data = await nika.jobs.artifactJson<Result>(
  job_id,
  'result.json',
)

Keep large bytes out of the heap.

Use the ReadableStream form for datasets, images, audio or archives. Backpressure stays with the platform stream.

const source = await nika.jobs.artifactStream(
  job_id,
  'dataset.csv',
)

await source.pipeTo(destination)

Use runAndCollect for small non-binary sets.

The convenience path batches downloads and skips binary artifacts. It is not a replacement for a deliberate large-output policy.