Skip to content

changelog: add entries for deployment tools#63

Open
uelkerd wants to merge 1 commit into
mainfrom
chore/changelog-additions
Open

changelog: add entries for deployment tools#63
uelkerd wants to merge 1 commit into
mainfrom
chore/changelog-additions

Conversation

@uelkerd
Copy link
Copy Markdown
Owner

@uelkerd uelkerd commented Aug 10, 2025

Summary by Sourcery

Update the changelog to include detailed entries for the new custom model deployment solution, bug fix, and configuration enhancements under an unreleased section.

New Features:

  • Add changelog entries for a custom model deployment pipeline including upload script, deployment guide, flexible API server, and environment configuration templates

Bug Fixes:

  • Record fix for Model-as-a-Service falling back to untrained base models instead of custom-trained models

Enhancements:

  • Document support for loading custom models from HuggingFace Hub and use of 12-class emotion labels

Documentation:

  • Introduce an [Unreleased] section in CHANGELOG.md to track deployment tooling changes

@uelkerd uelkerd requested a review from Copilot August 10, 2025 23:17
@uelkerd uelkerd self-assigned this Aug 10, 2025
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Aug 10, 2025

Reviewer's Guide

This PR enriches the CHANGELOG with a comprehensive Custom Model Deployment Solution—including scripts, guides, deployment strategies and automated features—while documenting a fix for the Model-as-a-Service configuration fallback and updating infrastructure to support custom HuggingFace models and specialized emotion labels.

Class diagram for Flexible API Server and Model Deployment

classDiagram
  class FlexibleAPIServer {
    +load_model()
    +predict()
    +handle_cold_start()
    +retry_logic()
    +serve(mode)
    -model_path
    -emotion_labels
  }
  class ModelPreparationScript {
    +find_model()
    +convert_format()
    +upload_to_hub()
    +generate_model_card()
    -base_dir
    -config
  }
  class EnvironmentConfig {
    +load_env()
    +detect_project_root()
    -env_vars
  }
  FlexibleAPIServer o-- EnvironmentConfig
  FlexibleAPIServer o-- ModelPreparationScript
  FlexibleAPIServer <|-- ServerlessAPI
  FlexibleAPIServer <|-- InferenceEndpoint
  FlexibleAPIServer <|-- SelfHostedServer
Loading

File-Level Changes

Change Details Files
Documented the Custom Model Deployment Solution
  • Introduced upload script for HuggingFace uploads
  • Added deployment guide and models directory structure
  • Outlined serverless, endpoint, and self-hosted strategies
  • Listed automated features like format conversion, Git LFS and model card generation
CHANGELOG.md
Logged fix for Model-as-a-Service configuration issue
  • Resolved fallback to base models
  • Ensured custom-trained models are uploaded to HuggingFace Hub
CHANGELOG.md
Updated deployment infrastructure details
  • Switched loading from local files to Hub-hosted custom models
  • Updated to 12-class custom emotion labels
CHANGELOG.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 10, 2025

Warning

Rate limit exceeded

@uelkerd has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c564a74 and 8d2fff8.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/changelog-additions

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @uelkerd, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a comprehensive custom model deployment solution, enabling the upload of fine-tuned models to HuggingFace Hub. It resolves a critical issue where untrained base models were being used for deployment, ensuring that custom-trained models are now properly utilized. Furthermore, the deployment infrastructure has been updated to exclusively source models from HuggingFace Hub and to support custom emotion labels.

Highlights

  • Custom Model Deployment Solution: I've added a complete pipeline for uploading custom-trained models to HuggingFace Hub, including new scripts, a deployment guide, and a flexible API server.
  • Flexible Deployment Strategies: The solution supports various HuggingFace deployment strategies: Serverless Inference API, Inference Endpoints, and self-hosted options, along with portable configuration.
  • Automated Deployment Features: I've implemented automated features such as model format conversion, Git LFS setup, environment configuration templates, and model card generation.
  • Model-as-a-Service Fix: I've resolved an issue where the deployment infrastructure was incorrectly using untrained base models instead of custom-trained ones, ensuring proper model accessibility.
  • Updated Model Sourcing: The deployment infrastructure now exclusively supports custom models sourced from HuggingFace Hub, moving away from local file dependencies.
  • Custom Emotion Labels: I've updated the model loading configuration to correctly utilize 12 custom emotion labels.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@deepsource-io
Copy link
Copy Markdown
Contributor

deepsource-io Bot commented Aug 10, 2025

Here's the code health analysis summary for commits c564a74..8d2fff8. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Test coverage LogoTest coverage⚠️ Artifact not reportedTimed out: Artifact was never reportedView Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Terraform LogoTerraform✅ SuccessView Check ↗
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Shell LogoShell✅ SuccessView Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @uelkerd - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a comprehensive changelog entry documenting the implementation of custom model deployment tools for machine learning models. The update details a complete deployment pipeline that enables uploading custom-trained models to HuggingFace Hub for production use.

Key changes include:

  • Added detailed changelog entry for unreleased deployment features (v2025-08-07)
  • Documented new deployment scripts, guides, and API server components
  • Fixed model-as-a-service configuration issues with custom model usage

Comment thread CHANGELOG.md

---

## [Unreleased] - 2025-08-07
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

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

The date '2025-08-07' in the Unreleased section is inconsistent with changelog conventions. Unreleased sections typically don't include specific dates since they represent pending changes. Consider using just '## [Unreleased]' or move this to a versioned release when ready.

Suggested change
## [Unreleased] - 2025-08-07
## [Unreleased]

Copilot uses AI. Check for mistakes.
Comment thread CHANGELOG.md
- Added `deployment/models/` directory with README for organized model storage
- Created `.env.model_config.example` template for easy environment configuration
- **HuggingFace Deployment Strategies**:
- 🆓 Serverless Inference API (free tier with rate limits)
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

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

[nitpick] Using emoji characters in changelog entries may cause display issues in certain environments or when the changelog is processed by automated tools. Consider using plain text alternatives like '[FREE]' or '(Free)' instead of '🆓'.

Suggested change
- 🆓 Serverless Inference API (free tier with rate limits)
- [FREE] Serverless Inference API (free tier with rate limits)

Copilot uses AI. Check for mistakes.
Comment thread CHANGELOG.md
- Created `.env.model_config.example` template for easy environment configuration
- **HuggingFace Deployment Strategies**:
- 🆓 Serverless Inference API (free tier with rate limits)
- 🚀 Inference Endpoints (paid, production-grade with consistent latency)
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

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

[nitpick] Using emoji characters in changelog entries may cause display issues in certain environments or when the changelog is processed by automated tools. Consider using plain text alternatives like '[PAID]' or '(Production)' instead of '🚀'.

Suggested change
- 🚀 Inference Endpoints (paid, production-grade with consistent latency)
- [PAID] Inference Endpoints (paid, production-grade with consistent latency)

Copilot uses AI. Check for mistakes.
Comment thread CHANGELOG.md
- **HuggingFace Deployment Strategies**:
- 🆓 Serverless Inference API (free tier with rate limits)
- 🚀 Inference Endpoints (paid, production-grade with consistent latency)
- 🏠 Self-hosted (maximum control with local transformers)
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

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

[nitpick] Using emoji characters in changelog entries may cause display issues in certain environments or when the changelog is processed by automated tools. Consider using plain text alternatives like '[SELF-HOSTED]' or '(Local)' instead of '🏠'.

Suggested change
- 🏠 Self-hosted (maximum control with local transformers)
- [SELF-HOSTED] Self-hosted (maximum control with local transformers)

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a changelog entry for a new custom model deployment solution. However, the changelog appears to be for a different set of changes, as it references several files that are not present in the branch. This is a high-priority issue that needs to be resolved to ensure the accuracy of the release notes. Additionally, the changelog entry is very verbose. I've provided a suggestion to make it more concise and scannable by summarizing the key points and moving granular details to dedicated documentation.

Comment thread CHANGELOG.md
Comment on lines +288 to +290
- Created `scripts/deployment/upload_model_to_huggingface.py` - Comprehensive script to find, prepare, and upload custom trained models
- Added `deployment/CUSTOM_MODEL_DEPLOYMENT_GUIDE.md` - Complete guide for deploying custom models with multiple deployment strategies
- Added `deployment/flexible_api_server.py` - Flexible API server supporting serverless, endpoints, and self-hosted deployments
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This changelog entry appears to document a set of features and files that are not included in this pull request or the current branch. The following files mentioned in the Added section are missing:

  • scripts/deployment/upload_model_to_huggingface.py
  • deployment/CUSTOM_MODEL_DEPLOYMENT_GUIDE.md
  • deployment/flexible_api_server.py

This discrepancy makes the changelog inaccurate and could cause significant confusion for anyone reading the release notes. Please ensure the changelog accurately reflects the changes being introduced in the codebase.

Comment thread CHANGELOG.md
Comment on lines +287 to +325
- **Custom Model Deployment Solution** - Complete pipeline to upload custom-trained models to HuggingFace Hub for production deployment
- Created `scripts/deployment/upload_model_to_huggingface.py` - Comprehensive script to find, prepare, and upload custom trained models
- Added `deployment/CUSTOM_MODEL_DEPLOYMENT_GUIDE.md` - Complete guide for deploying custom models with multiple deployment strategies
- Added `deployment/flexible_api_server.py` - Flexible API server supporting serverless, endpoints, and self-hosted deployments
- **Portable Configuration**: Environment variable support (`SAMO_DL_BASE_DIR` or `MODEL_BASE_DIR`) with automatic project root detection
- Added `deployment/models/` directory with README for organized model storage
- Created `.env.model_config.example` template for easy environment configuration
- **HuggingFace Deployment Strategies**:
- 🆓 Serverless Inference API (free tier with rate limits)
- 🚀 Inference Endpoints (paid, production-grade with consistent latency)
- 🏠 Self-hosted (maximum control with local transformers)
- **Automated Features**:
- Model format conversion (PyTorch .pth to HuggingFace format)
- Git LFS setup for large model files
- Environment configuration templates (.env.serverless, .env.endpoints, .env.selfhosted)
- Deployment configuration updates
- Model card generation with proper metadata and usage examples
- Cold start handling and retry logic for API calls

### Fixed
- **Model-as-a-Service Configuration Issue** - Resolved deployment using untrained base models instead of custom trained models
- Deployment was falling back to base `distilroberta-base` and `bert-base-uncased` models
- Custom models trained in Colab were not accessible to deployment infrastructure
- Now properly uploads custom models to HuggingFace Hub for production access

### Changed
- Deployment infrastructure now supports custom models from HuggingFace Hub instead of local files only
- Updated model loading configuration to use custom emotion labels (12 classes) instead of generic ones

### Technical Details
- **Model Architecture**: DistilRoBERTa/BERT fine-tuned on custom journal entries
- **Emotion Classes**: 12 specialized emotions (anxious, calm, content, excited, frustrated, grateful, happy, hopeful, overwhelmed, proud, sad, tired)
- **Performance**: Expected ~85% accuracy vs ~60% with base models
- **Deployment Options**:
- Serverless API: Free tier, 30s timeout, automatic retry and cold start handling
- Inference Endpoints: Paid service, 10s timeout, no cold starts, consistent latency
- Self-hosted: Local transformers, full control, configurable device (CPU/GPU)
- **Storage**: Uses HuggingFace Hub as model repository with Git LFS for large files
- **Cost Structure**: Public repos free, private repos with quotas, bandwidth tracking
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While the detail provided in this changelog entry is comprehensive, it might be overly verbose for a high-level changelog, especially the 'Automated Features' and 'Technical Details' sections. Consider summarizing the key features and linking to the new CUSTOM_MODEL_DEPLOYMENT_GUIDE.md or other technical documentation for the full details. This would make the main changelog more scannable for users.

A more concise entry might look like:

### Added
- **Custom Model Deployment Solution**: Added a complete pipeline to upload and deploy custom-trained models to HuggingFace Hub. This includes scripts for uploading, a flexible API server, and comprehensive documentation. See `deployment/CUSTOM_MODEL_DEPLOYMENT_GUIDE.md` for full details on deployment strategies (Serverless, Endpoints, Self-hosted) and automated features.

### Fixed
- **Model-as-a-Service Configuration Issue**: Resolved an issue where deployments incorrectly used untrained base models instead of custom-trained ones.

### Changed
- The deployment infrastructure now supports custom models from HuggingFace Hub.
- Model loading configuration updated to use 12 custom emotion classes.

The 'Technical Details' section could be moved to the relevant guide or design document.

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.

3 participants