{"id":41785387,"url":"https://github.com/tzervas/axolotl-rs","last_synced_at":"2026-01-25T04:11:44.789Z","repository":{"id":332726804,"uuid":"1129034375","full_name":"tzervas/axolotl-rs","owner":"tzervas","description":"YAML-driven configurable fine-tuning toolkit for LLMs in Rust","archived":false,"fork":false,"pushed_at":"2026-01-24T07:13:06.000Z","size":520,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T17:31:07.590Z","etag":null,"topics":["cli","fine-tuning","llm","rust","yaml"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tzervas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-06T14:11:36.000Z","updated_at":"2026-01-16T06:41:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tzervas/axolotl-rs","commit_stats":null,"previous_names":["tzervas/axolotl-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tzervas/axolotl-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faxolotl-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faxolotl-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faxolotl-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faxolotl-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tzervas","download_url":"https://codeload.github.com/tzervas/axolotl-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzervas%2Faxolotl-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28742983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","fine-tuning","llm","rust","yaml"],"created_at":"2026-01-25T04:11:44.203Z","updated_at":"2026-01-25T04:11:44.784Z","avatar_url":"https://github.com/tzervas.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# axolotl-rs\n\nYAML-driven configurable fine-tuning toolkit for LLMs in Rust.\n\n[![Crates.io](https://img.shields.io/crates/v/axolotl-rs.svg)](https://crates.io/crates/axolotl-rs)\n[![Documentation](https://docs.rs/axolotl-rs/badge.svg)](https://docs.rs/axolotl-rs)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT)\n\n## Overview\n\n`axolotl-rs` is a Rust port of the Python [Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) project, providing a framework for fine-tuning language models.\n\n**Features:**\n- **YAML Configuration** - Parse and validate training configuration files\n- **Dataset Handling** - Load datasets in Alpaca, ShareGPT, completion, and custom formats\n- **CLI Interface** - Commands for `validate`, `train`, `merge`, `init`\n- **Configuration Presets** - Templates for LLaMA-2, Mistral, and Phi-3 models\n- **Adapter Integration** - LoRA and QLoRA via peft-rs and qlora-rs\n- **Training Loop** - Forward/backward passes with checkpoint support\n\n## Installation\n\n```bash\n# From crates.io\ncargo install axolotl-rs\n\n# Or from source\ngit clone https://github.com/tzervas/axolotl-rs\ncd axolotl-rs\ncargo build --release\n```\n\n## Quick Start\n\n### 1. Generate a Configuration\n\n```bash\n# Create a config for LLaMA-2 7B with QLoRA\naxolotl init config.yaml --preset llama2-7b\n```\n\n### 2. Prepare Your Dataset\n\nCreate a JSONL file in Alpaca format:\n\n```json\n{\"instruction\": \"Explain quantum computing\", \"input\": \"\", \"output\": \"Quantum computing uses...\"}\n{\"instruction\": \"Write a haiku about Rust\", \"input\": \"\", \"output\": \"Memory safe code\\n...\"}\n```\n\n### 3. Validate Configuration\n\n```bash\naxolotl validate config.yaml\n```\n\n### 4. Start Training\n\n```bash\naxolotl train config.yaml\n```\n\n### 5. Merge Adapters (Optional)\n\n```bash\naxolotl merge --config config.yaml --output ./merged-model\n```\n\n## Configuration\n\n### Full Example\n\n```yaml\n# config.yaml\nbase_model: meta-llama/Llama-2-7b-hf\nadapter: qlora\n\n# LoRA settings\nlora:\n  r: 64\n  alpha: 16\n  dropout: 0.05\n  target_modules:\n    - q_proj\n    - k_proj\n    - v_proj\n    - o_proj\n\n# Quantization (for QLoRA)\nquantization:\n  bits: 4\n  quant_type: nf4\n  double_quant: true\n\n# Dataset\ndataset:\n  path: ./data/train.jsonl\n  format: alpaca\n  max_length: 2048\n  val_split: 0.05\n\n# Training\ntraining:\n  epochs: 3\n  batch_size: 4\n  gradient_accumulation_steps: 4\n  learning_rate: 2.0e-4\n  lr_scheduler: cosine\n  warmup_ratio: 0.03\n  save_steps: 500\n  gradient_checkpointing: true\n\noutput_dir: ./outputs/my-model\nseed: 42\n```\n\n### Dataset Formats\n\n| Format | Description | Fields |\n|--------|-------------|--------|\n| `alpaca` | Standard Alpaca | `instruction`, `input`, `output` |\n| `sharegpt` | Conversation format | `conversations[{from, value}]` |\n| `completion` | Raw text | `text` |\n| `custom` | User-defined | Configure `input_field`, `output_field` |\n\n### Available Presets\n\n- `llama2-7b` - LLaMA-2 7B with QLoRA\n- `mistral-7b` - Mistral 7B with QLoRA  \n- `phi3-mini` - Phi-3 Mini with LoRA\n\n## CLI Commands\n\n```bash\n# Validate configuration\naxolotl validate \u003cconfig.yaml\u003e\n\n# Start training\naxolotl train \u003cconfig.yaml\u003e\naxolotl train \u003cconfig.yaml\u003e --resume ./checkpoint-1000\n\n# Merge adapter into base model\naxolotl merge --config \u003cconfig.yaml\u003e --output \u003cpath\u003e\n\n# Generate sample config\naxolotl init \u003coutput.yaml\u003e --preset \u003cpreset\u003e\n```\n\n## Architecture\n\n```\naxolotl-rs\n├── config     - YAML parsing \u0026 validation\n├── dataset    - Data loading \u0026 preprocessing\n├── model      - Model loading \u0026 adapter management\n└── trainer    - Training loop \u0026 optimization\n\nDependencies:\n├── candle-*   - Tensor operations and transformer models\n├── tokenizers - HuggingFace tokenizer bindings\n├── peft-rs    - LoRA/DoRA adapter support (optional)\n├── qlora-rs   - 4-bit quantization (optional)\n└── unsloth-rs - Optimized kernels (optional)\n```\n\n## Feature Flags\n\n| Flag | Description |\n|------|-------------|\n| `download` | Enable model downloading from HF Hub (default) |\n| `peft` | Enable peft-rs for LoRA/DoRA adapters |\n| `qlora` | Enable qlora-rs for 4-bit quantization |\n| `unsloth` | Enable unsloth-rs optimized kernels |\n| `cuda` | Enable CUDA GPU acceleration |\n\n## Documentation\n\n- [ARCHITECTURE.md](ARCHITECTURE.md) - Technical architecture details\n- [CONTRIBUTING.md](CONTRIBUTING.md) - Contribution guidelines\n- [TEST_COVERAGE_PLAN.md](TEST_COVERAGE_PLAN.md) - Test coverage goals\n\n**Porting from Python:** This is a Rust port of the Python [Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) project, designed for better performance and efficiency.\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nLicensed under the [MIT License](LICENSE-MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzervas%2Faxolotl-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftzervas%2Faxolotl-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzervas%2Faxolotl-rs/lists"}