Skip to content

fix(pydantic): set allowed values for adapter config#3415

Merged
winglian merged 1 commit into
mainfrom
fix/adapter-typing-pydantic
Feb 23, 2026
Merged

fix(pydantic): set allowed values for adapter config#3415
winglian merged 1 commit into
mainfrom
fix/adapter-typing-pydantic

Conversation

@NanoCode012

@NanoCode012 NanoCode012 commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator

Description

From telemetry, we had users setting this to invalid values. This helps set early validation that we missed

Motivation and Context

How has this been tested?

AI Usage Disclaimer

Screenshots (if appropriate)

Types of changes

Social Handles (Optional)

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation for the adapter configuration field to only accept supported types: "lora", "qlora", and "llama-adapter". Previously accepted arbitrary values will now be rejected, preventing invalid configurations.

@coderabbitai

coderabbitai Bot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The adapter field type in LoraConfig was narrowed from a generic string to a constrained literal type accepting only "lora", "qlora", or "llama-adapter". The field description was updated to reflect these allowed values.

Changes

Cohort / File(s) Summary
Type constraint on adapter field
src/axolotl/utils/schemas/peft.py
Narrowed LoraConfig.adapter field type from str | None to Literal["lora", "qlora", "llama-adapter"] | None; updated description text to document allowed values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main
Title check ✅ Passed The PR title 'fix(pydantic): set allowed values for adapter config' clearly and specifically describes the main change: restricting the adapter field to allowed literal values in the Pydantic schema.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/adapter-typing-pydantic

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview: https://6992945d2485f04e85919b08--resonant-treacle-0fd729.netlify.app

Deployed on Netlify from commit d6c4241

@codecov

codecov Bot commented Feb 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@NanoCode012 NanoCode012 changed the title fix: set allowed values for adapter config fix(pydantic): set allowed values for adapter config Feb 16, 2026
@winglian winglian merged commit 08441fe into main Feb 23, 2026
20 checks passed
@winglian winglian deleted the fix/adapter-typing-pydantic branch February 23, 2026 16:39
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.

2 participants