UAL Adapter

User Guide

  • Installation
    • Requirements
    • Installation Methods
      • Via pip (Recommended)
      • From Source
      • For Development
      • Docker
    • Verify Installation
    • GPU Support
    • Troubleshooting
      • Common Issues
      • Getting Help
  • Quick Start Guide
    • Basic Workflow
    • Step 1: Train an Adapter
    • Step 2: Export to AIR Format
    • Step 3: Transfer to Target Model
    • Multi-Domain Dispatcher
    • Command-Line Interface
    • Next Steps
  • Architecture Overview
    • System Components
      • 1. AIR Format
      • 2. Model Binders
      • 3. Dimension Projection
      • 4. LoRA Dispatcher
      • 5. Training Pipeline
    • Data Flow
      • Training Phase
      • Transfer Phase
      • Inference Phase
    • Design Principles
    • Performance Considerations
    • Limitations
    • Next Steps
  • Tutorials
    • Basic Adapter Transfer
      • Step 1: Prepare Training Data
      • Step 2: Train Adapter
      • Step 3: Export to AIR
      • Step 4: Transfer to Target Model
      • Complete Example
    • Multi-Domain Dispatcher
      • Overview
      • Step 1: Train Multiple Adapters
      • Step 2: Create Dispatcher
      • Step 3: Register Domains
      • Step 4: Train Router
      • Step 5: Use for Inference
    • Custom Training Configuration
      • Training Parameters
        • rank
        • alpha
      • Custom Target Modules
      • Gradient Accumulation
      • Learning Rate Scheduling
      • Checkpointing
    • Coming Soon

Core Concepts

  • AIR Format Specification
    • Format Structure
    • Semantic Roles
      • Attention Roles
      • MLP Roles
    • Layer Indexing
    • LoRA Weight Storage
    • Metadata Fields
      • version
      • source_architecture
      • domain
      • rank
      • alpha
      • created_at
      • training_config
    • Compatibility
    • Import Process
    • Export Process
    • Best Practices
  • Model Binders
    • Architecture Detection
    • Binder Structure
    • Pattern Matching
    • Supported Architectures
      • GPT-2 Family
      • LLaMA Family
      • Qwen Family
    • Custom Binders
  • Dimension Projection
    • Why Projection is Needed
    • Projection Methods
      • SVD Projection
      • Truncate Projection
      • Interpolate Projection
    • Rank Preservation
    • Quality Analysis
  • LoRA Dispatcher
    • Architecture
    • Components
      • Sentence Encoder
      • Domain Router
      • Domain Registry
    • Usage Pattern
      • 1. Register Domains
      • 2. Train Router
      • 3. Route Queries
    • Confidence Thresholds
    • Embedding Cache
    • Domain Overlap Analysis

API Reference

  • UniversalAdapter
    • UniversalAdapter
      • UniversalAdapter.__init__()
      • UniversalAdapter.train_adapter()
      • UniversalAdapter.export_adapter()
      • UniversalAdapter.import_adapter()
      • UniversalAdapter.transfer_to_model()
      • UniversalAdapter.list_adapters()
      • UniversalAdapter.clear_adapters()
    • Overview
    • Class Definition
      • UniversalAdapter
        • UniversalAdapter.__init__()
        • UniversalAdapter.train_adapter()
        • UniversalAdapter.export_adapter()
        • UniversalAdapter.import_adapter()
        • UniversalAdapter.transfer_to_model()
        • UniversalAdapter.list_adapters()
        • UniversalAdapter.clear_adapters()
    • Methods
      • Training Methods
        • UniversalAdapter.train_adapter()
      • Export/Import Methods
        • UniversalAdapter.export_adapter()
        • UniversalAdapter.import_adapter()
      • Utility Methods
        • UniversalAdapter.list_adapters()
    • Usage Examples
      • Basic Training
      • Export and Import
      • Managing Adapters
    • See Also
  • AIR Format
    • AIRMetadata
      • AIRMetadata.version
      • AIRMetadata.source_model
      • AIRMetadata.source_architecture
      • AIRMetadata.source_dimensions
      • AIRMetadata.adapter_rank
      • AIRMetadata.adapter_alpha
      • AIRMetadata.training_config
      • AIRMetadata.domain
      • AIRMetadata.description
      • AIRMetadata.created_at
      • AIRMetadata.__init__()
    • AIRFormat
      • AIRFormat.ATTENTION_ROLES
      • AIRFormat.MLP_ROLES
      • AIRFormat.__init__()
      • AIRFormat.export_to_air()
      • AIRFormat.import_from_air()
    • AIRFormat Class
      • AIRFormat
        • AIRFormat.ATTENTION_ROLES
        • AIRFormat.MLP_ROLES
        • AIRFormat.__init__()
        • AIRFormat.export_to_air()
        • AIRFormat.import_from_air()
  • LoRA Dispatcher
    • LoRADispatcher
      • LoRADispatcher.__init__()
      • LoRADispatcher.register_domain()
      • LoRADispatcher.route_query()
      • LoRADispatcher.apply_adapter()
      • LoRADispatcher.analyze_domain_overlap()
      • LoRADispatcher.save()
      • LoRADispatcher.load()
    • DomainAdapter
      • DomainAdapter.__init__()
      • DomainAdapter.get_info()
    • LoRADispatcher Class
      • LoRADispatcher
        • LoRADispatcher.__init__()
        • LoRADispatcher.register_domain()
        • LoRADispatcher.route_query()
        • LoRADispatcher.apply_adapter()
        • LoRADispatcher.analyze_domain_overlap()
        • LoRADispatcher.save()
        • LoRADispatcher.load()
    • DomainAdapter Class
      • DomainAdapter
        • DomainAdapter.__init__()
        • DomainAdapter.get_info()
  • Dimension Projection
    • DimensionProjector
      • DimensionProjector.__init__()
      • DimensionProjector.project_adapter()
      • DimensionProjector.analyze_projection_quality()
    • DimensionProjector Class
      • DimensionProjector
        • DimensionProjector.__init__()
        • DimensionProjector.project_adapter()
        • DimensionProjector.analyze_projection_quality()
  • Model Binders
    • Base Binder
      • ModelBinder
        • ModelBinder.__init__()
        • ModelBinder.map_weights()
        • ModelBinder.get_fused_modules()
        • ModelBinder.supports_architecture()
    • Architecture Binders
      • GPT2Binder
      • LLaMABinder
      • PythiaBinder
      • QwenBinder
      • MistralBinder
      • PhiBinder
      • BERTBinder
      • T5Binder
      • GenericBinder
    • Binder Registry
      • BinderRegistry
        • BinderRegistry.__init__()
        • BinderRegistry.register()
        • BinderRegistry.get_binder()
        • BinderRegistry.list_supported_architectures()
        • BinderRegistry.is_architecture_supported()
  • Training
    • TextDataset
      • TextDataset.__init__()
    • LoRATrainer
      • LoRATrainer.__init__()
      • LoRATrainer.train_adapter()
      • LoRATrainer.compute_perplexity()
    • LoRATrainer Class
      • LoRATrainer
        • LoRATrainer.__init__()
        • LoRATrainer.train_adapter()
        • LoRATrainer.compute_perplexity()
  • Utilities
    • ModelAnalyzer
      • ModelAnalyzer.__init__()
      • ModelAnalyzer.analyze()
      • ModelAnalyzer.get_lora_target_modules()
      • ModelAnalyzer.get_module_dimensions()
      • ModelAnalyzer.validate_lora_compatibility()
    • Model Analysis

Advanced Topics

  • Adding Custom Architectures
    • Creating a Binder
    • Registering the Binder
    • Testing the Binder
    • Contributing
  • Multi-Domain Best Practices
    • Domain Design
      • Clear Boundaries
      • Good Examples
    • Router Optimization
      • Confidence Tuning
    • Performance Monitoring
  • Performance Optimization
    • Memory Optimization
      • Use Lower Ranks
      • Gradient Checkpointing
    • Speed Optimization
      • Batch Processing
      • Cache Embeddings
      • Projection Method
    • Quality vs Speed Tradeoffs
  • Troubleshooting Guide
    • Import Errors
      • Dimension Mismatch
      • Architecture Not Detected
    • Training Issues
      • OOM Errors
      • Slow Training
    • Dispatcher Issues
      • Poor Routing Accuracy
      • Low Confidence Scores
    • Quality Issues
      • Poor Transfer Quality
    • Getting Help

Development

  • Contributing
    • Development Setup
    • Running Tests
    • Code Style
    • Contributing Guidelines
    • Areas for Contribution
    • Code of Conduct
  • Changelog
    • Version 0.1.0 (2025-01-15)
      • Features
      • Known Limitations
      • Future Plans
  • License
    • MIT License
UAL Adapter
  • Search


© Copyright 2025, UAL Adapter Contributors.

Built with Sphinx using a theme provided by Read the Docs.