Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2a44a13
Add reasoning capabilities and dual dataset writer for enhanced model…
lemon07r Nov 12, 2025
3a18b1e
feat: Enhance checkpoint resume functionality with environment file s…
lemon07r Nov 12, 2025
567a0d0
Merge timeout branch: Add HTTP timeout config and env-file support fo…
lemon07r Nov 12, 2025
b0e04ce
feat: Integrate streaming mode to bypass gateway timeouts
lemon07r Nov 12, 2025
d3a5aab
feat: Complete dual dataset implementation with reasoning capture
lemon07r Nov 12, 2025
bcda614
fix: Properly skip rejected model in SFT mode regardless of config pr…
lemon07r Nov 12, 2025
7b122fd
feat: Enhance refusal response handling with detailed logging of resp…
lemon07r Nov 12, 2025
7a12e94
feat: Add golangci-lint configuration and enhance Makefile for improv…
lemon07r Nov 13, 2025
e58e176
Refactor API reliability test suite and enhance validation
lemon07r Nov 14, 2025
2c711ba
feat: Add optional verbose SSE logging for debugging streaming responses
lemon07r Nov 14, 2025
89812ee
feat: Add integration test command and improve test output handling
lemon07r Nov 15, 2025
27597e1
feat: Enhance preference pair generation with initial progress tracking
lemon07r Nov 15, 2025
1aeadc9
feat: Update version to 1.6.0 and add progress render delay in worker
lemon07r Nov 15, 2025
c5c11bc
feat: Add ShareGPT and Alpaca format options for SFT datasets
lemon07r Nov 15, 2025
4745558
feat: Implement dataset transformation commands for SFT to DPO conver…
lemon07r Nov 17, 2025
8fad787
feat: Add dataset transformation commands for SFT to DPO conversion a…
lemon07r Nov 17, 2025
ee8ea5e
feat: Add reasoning support for DPO dataset transformation and update…
lemon07r Nov 17, 2025
83ce9c7
feat: Update .gitignore to include new config file and adjust transfo…
lemon07r Nov 17, 2025
d840306
feat: Enhance analyze_results script with session selection and struc…
lemon07r Nov 17, 2025
bc2a3e4
feat: Add support for Chutes AI and Nahcrof AI API keys in configuration
lemon07r Nov 17, 2025
d54beeb
fix: Update estimated duration for testing both providers in run_test.sh
lemon07r Nov 17, 2025
d6b1817
feat: Implement LLM response meta-chatter cleanup for DPO datasets, i…
lemon07r Nov 20, 2025
d1d7786
test: improve meta cleanup utility tests
lemon07r Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ go.work
.env
*.env
!.env.example
.env.*
!.env.*.example

# Output directory with all session data
output/
results.json

# IDE
.vscode/
Expand Down Expand Up @@ -48,6 +51,7 @@ REPORTS/
*.toml
!config.example.toml
!cliff.toml
!config.nahcrof.toml

# Old .git files
old.git.backup/
Expand Down
17 changes: 17 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# golangci-lint v2.x configuration
version: 2

linters:
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused

run:
timeout: 5m

issues:
max-issues-per-linter: 0
max-same-issues: 0
165 changes: 137 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
.PHONY: build test lint clean install run
.PHONY: all build test lint clean install run fmt vet check deps help
.PHONY: build-all build-linux build-darwin build-windows test-coverage test-integration
.PHONY: lint-fix security pre-commit ci

BINARY_NAME=vellumforge2
VERSION?=1.5.3
VERSION?=1.6.0
BUILD_TIME=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
GIT_COMMIT=$(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")

LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME) -X main.GitCommit=$(GIT_COMMIT)"

# Colors for output
COLOR_RESET=\033[0m
COLOR_BOLD=\033[1m
COLOR_GREEN=\033[32m
COLOR_YELLOW=\033[33m
COLOR_BLUE=\033[34m

define print_step
@echo -e "$(COLOR_BOLD)$(COLOR_BLUE)==> $(1)$(COLOR_RESET)"
endef
Comment on lines +19 to +21
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo -e is not portable across /bin/sh implementations (e.g., dash prints -e literally). Since print_step is used by most targets, consider using printf for ANSI color output to keep the Makefile working consistently across environments.

Copilot uses AI. Check for mistakes.

## all: Run all checks and build (optimal order for development)
all: deps fmt vet lint test build
$(call print_step,"✅ All checks passed! Binary built successfully.")

## check: Run all quality checks without building (faster CI)
check: fmt-check vet lint test
$(call print_step,"✅ All quality checks passed!")

## pre-commit: Fast checks before committing (skip tests)
pre-commit: fmt vet lint
$(call print_step,"✅ Pre-commit checks passed!")

## ci: Full CI pipeline (format check + all validations + coverage)
ci: fmt-check vet lint test-coverage build
$(call print_step,"✅ CI pipeline completed successfully!")
Comment on lines +35 to +37
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ci target currently runs test-coverage, which runs the full test suite (including integration tests that can make real API calls). This can be costly/flaky when CI has credentials available. Consider using the test (short) target in ci and keeping integration tests behind an explicit target/job.

Copilot uses AI. Check for mistakes.

build:
@echo "Building $(BINARY_NAME)..."
$(call print_step,"Building $(BINARY_NAME)...")
@go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/vellumforge2
$(call print_step,"Built: bin/$(BINARY_NAME)")

build-linux:
@echo "Building $(BINARY_NAME) for Linux..."
Expand All @@ -27,53 +57,132 @@ build-windows:
build-all: build-linux build-darwin build-windows

test:
@echo "Running tests..."
@go test -v -race -coverprofile=coverage.out ./...
$(call print_step,"Running unit tests - skips integration tests...")
@go test -short -race -coverprofile=coverage.out ./...
@echo -e "$(COLOR_GREEN)Total coverage: $$(go tool cover -func=coverage.out | grep total | awk '{print $$3}')$(COLOR_RESET)"
$(call print_step,"✓ Tests passed")

test-integration:
$(call print_step,"Running ALL tests including integration tests - makes real API calls...")
@go test -race -coverprofile=coverage.out ./...
@echo -e "$(COLOR_GREEN)Total coverage: $$(go tool cover -func=coverage.out | grep total | awk '{print $$3}')$(COLOR_RESET)"
$(call print_step,"✓ All tests passed")

test-coverage:
@echo "Running tests with coverage report..."
@go test -v -race -coverprofile=coverage.out ./...
$(call print_step,"Running ALL tests with coverage report - makes real API calls...")
@go test -race -coverprofile=coverage.out ./...
@go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
@echo -e "$(COLOR_GREEN)Total coverage: $$(go tool cover -func=coverage.out | grep total | awk '{print $$3}')$(COLOR_RESET)"
$(call print_step,"✓ Coverage report generated: coverage.html")

test-short:
$(call print_step,"Running short tests - alias for test...")
@go test -short -race ./...
$(call print_step,"✓ Short tests passed")

test-verbose:
$(call print_step,"Running tests with verbose output...")
@go test -v -race -coverprofile=coverage.out -count=1 ./...
$(call print_step,"✓ Verbose tests completed")

lint:
@echo "Running linters..."
$(call print_step,"Running golangci-lint...")
@golangci-lint run ./...
$(call print_step,"✓ Linting passed")

lint-fix:
$(call print_step,"Running golangci-lint with auto-fix...")
@golangci-lint run --fix ./...
$(call print_step,"✓ Linting with auto-fix completed")

security:
$(call print_step,"Running security checks...")
@golangci-lint run --disable-all --enable gosec ./...
$(call print_step,"✓ Security checks passed")

clean:
@echo "Cleaning..."
$(call print_step,"Cleaning build artifacts...")
@rm -rf bin/
@rm -f coverage.out coverage.html
$(call print_step,"✓ Clean completed")

install:
@echo "Installing dependencies..."
$(call print_step,"Installing dependencies...")
@go mod download
@go mod tidy
$(call print_step,"✓ Dependencies installed")

deps:
$(call print_step,"Verifying dependencies...")
@go mod download
@go mod verify
$(call print_step,"✓ Dependencies verified")

run:
@go run ./cmd/vellumforge2 run --config configs/config.example.toml

fmt:
@echo "Formatting code..."
$(call print_step,"Formatting code...")
@go fmt ./...
@if command -v goimports >/dev/null 2>&1; then \
goimports -w -local github.com/lamim/vellumforge2 .; \
elif [ -f "$(shell go env GOPATH)/bin/goimports" ]; then \
$(shell go env GOPATH)/bin/goimports -w -local github.com/lamim/vellumforge2 .; \
else \
echo -e "$(COLOR_YELLOW)Warning: goimports not found, run: go install golang.org/x/tools/cmd/goimports@latest$(COLOR_RESET)"; \
fi
$(call print_step,"✓ Code formatted")

fmt-check:
$(call print_step,"Checking code formatting...")
@test -z "$$(gofmt -l .)" || (echo -e "$(COLOR_YELLOW)Files not formatted:$(COLOR_RESET)" && gofmt -l . && exit 1)
$(call print_step,"✓ Code formatting check passed")

vet:
@echo "Running go vet..."
$(call print_step,"Running go vet...")
@go vet ./...

deps:
@echo "Downloading dependencies..."
@go mod download
$(call print_step,"✓ Go vet passed")

help:
@echo "Available targets:"
@echo " build - Build the binary"
@echo " build-all - Build for all platforms"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage report"
@echo " lint - Run linters"
@echo " clean - Remove build artifacts"
@echo " install - Install dependencies"
@echo " run - Run with example config"
@echo " fmt - Format code"
@echo " vet - Run go vet"
@echo -e "$(COLOR_BOLD)VellumForge2 Makefile Commands$(COLOR_RESET)"
@echo ""
@echo -e "$(COLOR_BOLD)Primary Commands:$(COLOR_RESET)"
@echo -e " $(COLOR_GREEN)make all$(COLOR_RESET) - Run full pipeline: deps → fmt → vet → lint → test → build"
@echo -e " $(COLOR_GREEN)make check$(COLOR_RESET) - Run quality checks without building (faster)"
@echo -e " $(COLOR_GREEN)make pre-commit$(COLOR_RESET) - Quick checks before committing (fmt → vet → lint)"
@echo -e " $(COLOR_GREEN)make ci$(COLOR_RESET) - Full CI pipeline with coverage"
@echo ""
@echo -e "$(COLOR_BOLD)Build Commands:$(COLOR_RESET)"
@echo " make build - Build binary for current platform"
@echo " make build-all - Build for all platforms (Linux, macOS, Windows)"
@echo " make build-linux - Build for Linux amd64"
@echo " make build-darwin - Build for macOS (amd64 + arm64)"
@echo " make build-windows - Build for Windows amd64"
@echo ""
@echo -e "$(COLOR_BOLD)Quality Commands:$(COLOR_RESET)"
@echo " make fmt - Format code with gofmt and goimports"
@echo " make fmt-check - Check if code is formatted (CI)"
@echo " make vet - Run go vet"
@echo " make lint - Run golangci-lint"
@echo " make lint-fix - Run golangci-lint with auto-fix"
@echo " make security - Run security checks (gosec)"
@echo ""
@echo -e "$(COLOR_BOLD)Test Commands:$(COLOR_RESET)"
@echo " make test - Run unit tests (fast, skips integration tests)"
@echo " make test-integration - Run ALL tests including integration tests (slow, makes API calls)"
@echo " make test-coverage - Run ALL tests and generate HTML coverage report (slow)"
@echo " make test-short - Alias for 'make test'"
@echo " make test-verbose - Run tests with verbose output"
@echo ""
@echo -e "$(COLOR_BOLD)Utility Commands:$(COLOR_RESET)"
@echo " make deps - Verify and download dependencies"
@echo " make install - Install and tidy dependencies"
@echo " make clean - Remove build artifacts and coverage files"
@echo " make run - Run with example config"
@echo " make help - Show this help message"
@echo ""
@echo -e "$(COLOR_BOLD)Examples:$(COLOR_RESET)"
@echo " make all # Run everything before pushing"
@echo " make pre-commit # Quick check before commit"
@echo " make test-coverage # Generate coverage report"
@echo " make lint-fix # Auto-fix linting issues"
80 changes: 78 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ Resume interrupted session:

# Resume generation
./bin/vellumforge2 checkpoint resume session_2025-11-05T12-34-56

# Resume with specific config and env file
./bin/vellumforge2 checkpoint resume session_2025-11-05T12-34-56 \
--config config.sft.toml \
--env-file .env
```

Graceful shutdown with Ctrl+C automatically saves checkpoint.
Expand Down Expand Up @@ -283,6 +288,53 @@ Graceful shutdown with Ctrl+C automatically saves checkpoint.

# Resume from checkpoint
./bin/vellumforge2 checkpoint resume <session-dir>

# Resume with specific config (important if checkpoint used different config file)
./bin/vellumforge2 checkpoint resume <session-dir> --config config.sft.toml --env-file .env
```

### Dataset Transform (SFT→DPO & Rejected Regeneration)

```bash
# Convert an existing SFT dataset into DPO (generates rejected responses)
./bin/vellumforge2 transform \
--config config.dpo.toml \
--mode sft-to-dpo \
--input path/to/sft_dataset.jsonl \
--output path/to/dpo_from_sft.jsonl

# Regenerate rejected responses for an existing DPO dataset
./bin/vellumforge2 transform \
--config config.dpo.toml \
--mode regen-rejected \
--input path/to/dpo_dataset.jsonl \
--output path/to/dpo_dataset.regen.jsonl

# Optional: checkpoint/resume for long transforms
./bin/vellumforge2 transform \
--config config.dpo.toml \
--mode regen-rejected \
--input path/to/dpo_dataset.jsonl \
--output path/to/dpo_dataset.regen.jsonl \
--checkpoint path/to/transform.checkpoint.json \
--resume

# Regenerate both plain and reasoning DPO datasets
./bin/vellumforge2 transform \
--config config.dpo.toml \
--mode regen-rejected \
--input path/to/dpo_dataset.jsonl \
--input-reasoning path/to/dpo_dataset_reasoning.jsonl \
--output path/to/dpo_dataset.regen.jsonl \
--output-reasoning path/to/dpo_dataset_reasoning.regen.jsonl

# Reasoning-only input: rebuild plain + reasoning datasets from reasoning JSONL
./bin/vellumforge2 transform \
--config config.dpo.toml \
--mode regen-rejected \
--input-reasoning path/to/dpo_dataset_reasoning.jsonl \
--output path/to/dpo_dataset_from_reasoning.jsonl \
--output-reasoning path/to/dpo_dataset_reasoning.regen.jsonl
```

### Other
Expand Down Expand Up @@ -367,6 +419,30 @@ base_url = "https://integrate.api.nvidia.com/v1"
model_name = "meta/llama-3.1-8b-instruct" # Smaller model
```

### Request Timeout Errors for Long-Form Generation

For long responses (>4000 words or >16k tokens), increase HTTP timeout:

```toml
[models.main]
http_timeout_seconds = 900 # 15 minutes (default: 120)
# For very long-form (32k+ tokens):
# http_timeout_seconds = 1800 # 30 minutes
```

Typical generation times:
- 4k tokens: ~1-2 minutes
- 16k tokens: ~3-5 minutes
- 32k tokens: ~5-10+ minutes

Also increase retry settings for stability:

```toml
[models.main]
max_retries = 8 # More retries for long requests (default: 3)
max_backoff_seconds = 300 # Longer backoff cap (default: 120)
```

See [GETTING_STARTED.md](GETTING_STARTED.md) for more troubleshooting.

## Documentation
Expand Down Expand Up @@ -406,7 +482,7 @@ MIT License - see [LICENSE](LICENSE) file.
author = {Lamim},
year = {2025},
url = {https://github.com/lemon07r/vellumforge2},
version = {1.5.3}
version = {1.6.0}
}
```

Expand All @@ -423,5 +499,5 @@ MIT License - see [LICENSE](LICENSE) file.

---

Current Version: v1.5.3
Current Version: v1.6.0
Last Updated: 2025-11-06
Loading
Loading