Skip to content

feat: FineTuningPipeline added - #714

Merged
AmitoVrito merged 1 commit into
SynapseKit:mainfrom
Abhay-Mmmm:feat/FineTuningPipeline
May 20, 2026
Merged

AmitoVrito merged 1 commit into
SynapseKit:mainfrom
Abhay-Mmmm:feat/FineTuningPipeline

Conversation

@Abhay-Mmmm

Copy link
Copy Markdown
Collaborator

Summary

Implements a production-ready continuous fine-tuning and feedback learning pipeline for SynapseKit.
Closes #702

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / internal improvement
  • Dependency / tooling update

Changes

  • synapsekit.training package — new module with six components: FeedbackCollector (non-blocking async queue with pluggable FeedbackBackend), TrainingDataGenerator (JSONL export, preference pairs), AnthropicFineTuneProvider /
    OpenAIFineTuneProvider (provider-agnostic fine-tune ABC), ABTestRouter (deterministic sticky hash routing, bounded result deque), AutoRolloutManager (staged rollout with per-stage sample gate, latency/cost/quality rollback), and
    CostBenefitAnalyzer (ROI, payback-day projection, multi-provider training rates)
  • ContinuousTrainer orchestrator (training/orchestrator.py) — wires all components into a single lifecycle: record_feedback → maybe_trigger_training (watermark-gated, non-blocking file I/O via asyncio.to_thread) → check_job_status →
    activate_ab_test (optional eval-score gate) → run_evaluation_cycle (advance or rollback rollout, optional cost report)
  • FeedbackSample gains latency_ms and cost_usd fields; RolloutState gains stage_start_finetuned_count for per-stage sample counting
  • Context injection fix — RAG context is merged into the single system message rather than appended as a second system turn (which caused OpenAI JSONL validation failures)
  • pyproject.toml — added training = ["openai>=1.0"] optional-dependency group
  • examples/continuous_finetuning.py — end-to-end runnable walkthrough of the full pipeline
  • 162 new tests across test_feedback, test_dataset, test_finetune, test_ab_testing, test_rollout, test_orchestrator, and test_cost_analysis

Testing

  • All existing tests pass (uv run pytest tests/ -q)
  • New tests added for new behaviour
  • No API keys or secrets in the code

@AmitoVrito
AmitoVrito merged commit 671f905 into SynapseKit:main May 20, 2026
12 checks passed
@AmitoVrito

Copy link
Copy Markdown
Collaborator

Thanks Abhay. This is a well-structured contribution — the separation across seven focused modules is clean, the orchestrator wires them together without leaking internal state, and the A/B router's deterministic SHA-256 bucketing is the right approach for sticky assignment without session storage. 162 tests covering rollout regression guards, cost projection, and the orchestrator lifecycle. Merged via #719.

AmitoVrito added a commit that referenced this pull request May 20, 2026
…turedOutput, AgentFederation, FineTuningPipeline, benchmark harness

Covers PRs #711 #712 #713 #718 #714 #717 merged via batch PR #719.

Co-authored-by: Dhruv Garg <[email protected]>
Co-authored-by: Abhay <[email protected]>
@Abhay-Mmmm
Abhay-Mmmm deleted the feat/FineTuningPipeline branch May 23, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: FineTuningPipeline with production feedback integration

2 participants