Skip to main content

Module s3_sink

Module s3_sink 

Source
Expand description

MinIO S3 Bus Sink

Subscribes to the AgentBus and uploads all messages to MinIO S3 as structured JSONL records suitable for LLM pretraining.

Each bus message is transformed into a training-friendly record with:

  • Clear role attribution (system/user/assistant/tool)
  • Paired tool_call → tool_result sequences
  • Full, untruncated content (code, file paths, arguments, outputs)
  • Rich metadata for filtering, deduplication, and curriculum design

The output format follows the OpenAI chat-completions schema so it can be fed directly into fine-tuning pipelines (SFT, DPO, RLHF).

§Usage

use codetether_agent::bus::s3_sink::BusS3Sink;

let sink = BusS3Sink::new(
    bus.clone(),
    "http://localhost:9000",
    "access-key",
    "secret-key",
    "codetether-training",
    "bus/",
).await?;

// Runs forever, uploading bus messages to S3
sink.run().await;

Structs§

BusS3Sink
S3 sink that archives all bus messages as JSONL training records
BusS3SinkConfig
Configuration for the bus S3 sink

Functions§

spawn_bus_s3_sink
Spawn the bus S3 sink in a background task.