From 638c159d90bc95eaa070f02f1d10b51f93fc38ee Mon Sep 17 00:00:00 2001 From: Prattyush Mangal Date: Tue, 21 Apr 2026 15:58:48 +0100 Subject: [PATCH 01/11] feat: adds in dmf cli install and usage to push model Contributes to: contributes to model deployment and benchmarking via DMF Signed-off-by: Prattyush Mangal --- .../workflows/reusable-push-models-to-dmf.yml | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index e204d730..e06041bc 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -18,6 +18,10 @@ on: type: string required: true description: 'Quantization type (e.g., Q4_K_M)' + model_size: + type: string + required: true + description: 'Model size (e.g.,1b, 3b, 13b, 20b)' target_repo_owner: type: string required: true @@ -52,6 +56,10 @@ on: required: true IBM_DMF_TOKEN: required: true + ARTIFACTORY_USER: + required: true + ARTIFACTORY_API_KEY: + required: true inputs: enable_language_jobs: type: boolean @@ -63,6 +71,9 @@ on: quantization: type: string required: true + model_size: + type: string + required: true target_repo_owner: type: string required: true @@ -195,4 +206,57 @@ jobs: echo "================== Derivative Environment Variables 3 ==================" echo "LOCAL_FNAME_QUANTIZED_GGUF='$LOCAL_FNAME_QUANTIZED_GGUF' (${{ env.LOCAL_FNAME_QUANTIZED_GGUF }})" + - name: install-dmf-library + run: | + echo "[INFO] Installing dmf-lib from Artifactory..." + pip install dmf-lib \ + --index-url https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_API_KEY }}@na.artifactory.swg-devops.com/artifactory/api/pypi/res-data-model-factory-team-pypi-local/simple \ + --trusted-host na.artifactory.swg-devops.com + echo "[INFO] Verifying dmf-lib installation..." + pip show dmf-lib + + - name: test-quantized-model-exists + run: | + exists=$(python ./scripts/hf_model_file_exists.py ${{ env.TARGET_REPO_ID }} ${{ env.BASE_FNAME_QUANTIZED_GGUF }} ${{secrets.hf_token}}) + echo "exists: '$exists'" + if [[ "$exists" == "False" ]]; then + echo "FAILURE: model file: '${{env.TARGET_REPO_ID}}/${{env.BASE_FNAME_QUANTIZED_GGUF}}' does not exist." + exit 2 + else + echo "SUCCESS: model file: '${{env.TARGET_REPO_ID}}/${{env.BASE_FNAME_QUANTIZED_GGUF}}' exists." + echo setting environment variable: QUANTIZED_MODEL_EXISTS='true'... + echo "QUANTIZED_MODEL_EXISTS=true" >> $GITHUB_ENV + fi + + - name: download-quantized-gguf-from-huggingface + if: env.QUANTIZED_MODEL_EXISTS == 'true' + run: | + echo "Downloading model to: ${{env.LOCAL_FNAME_QUANTIZED_GGUF}}..." + echo "--------------------" + python ./scripts/hf_file_download.py ${{ env.MODEL_DOWNLOAD_DIR}} ${{ env.TARGET_REPO_ID }} ${{ env.BASE_FNAME_QUANTIZED_GGUF }} ${{secrets.hf_token}} + ls -al ${{env.MODEL_DOWNLOAD_DIR}}/${{ env.TARGET_REPO_ID }}/*${{env.EXT_GGUF}} + + - name: push-model-to-dmf + if: env.QUANTIZED_MODEL_EXISTS == 'true' + env: + DMF_TOKEN: ${{ secrets.IBM_DMF_TOKEN }} + run: | + echo "[INFO] Pushing model to Data Model Factory..." + echo "[INFO] Model path: ${{env.LOCAL_MODEL_PATH}}" + echo "[INFO] Target repo: ${{env.TARGET_REPO_ID}}" + echo "[INFO] Using DMF namespace: granite_gguf" + echo "[INFO] Using DMF table: model" + + DMF_COMMENTS='{"stack":"","instance_profile":"","served_model_name":"${{env.TARGET_REPO_ID}}/*${{env.EXT_GGUF}}","metadata":[{"supplemental_arguments":[]}]}' + + dmf model push \ + -n granite_gguf \ + -t model \ + --dir "${{env.MODEL_DOWNLOAD_DIR}}/${{ env.TARGET_REPO_ID }}/*${{env.EXT_GGUF}}" \ + --base-model "${{ env.REPO_NAME }}" \ + --type granite \ + --size "${{ inputs.model_size }}" \ + --variant "${{ inputs.quantization }}" \ + --comments "$DMF_COMMENTS" + \ No newline at end of file From 53411b2e24c58d2eae8fa38f054340810c8bc9f3 Mon Sep 17 00:00:00 2001 From: Prattyush Mangal Date: Tue, 21 Apr 2026 16:23:04 +0100 Subject: [PATCH 02/11] feat: pin install version of dmf lib Signed-off-by: Prattyush Mangal --- .github/workflows/reusable-push-models-to-dmf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index e06041bc..9bb568d3 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -209,7 +209,7 @@ jobs: - name: install-dmf-library run: | echo "[INFO] Installing dmf-lib from Artifactory..." - pip install dmf-lib \ + pip install "dmf-lib==1.9.8" \ --index-url https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_API_KEY }}@na.artifactory.swg-devops.com/artifactory/api/pypi/res-data-model-factory-team-pypi-local/simple \ --trusted-host na.artifactory.swg-devops.com echo "[INFO] Verifying dmf-lib installation..." From 0d425f38b9e0fae4b2da2a8e3cd5276a5c75b78e Mon Sep 17 00:00:00 2001 From: Prattyush Mangal Date: Tue, 21 Apr 2026 16:30:17 +0100 Subject: [PATCH 03/11] feat: adds in pypi index for global installs of libs Signed-off-by: Prattyush Mangal --- .github/workflows/reusable-push-models-to-dmf.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index 9bb568d3..80537adc 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -211,6 +211,7 @@ jobs: echo "[INFO] Installing dmf-lib from Artifactory..." pip install "dmf-lib==1.9.8" \ --index-url https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_API_KEY }}@na.artifactory.swg-devops.com/artifactory/api/pypi/res-data-model-factory-team-pypi-local/simple \ + --extra-index-url https://pypi.org/simple \ --trusted-host na.artifactory.swg-devops.com echo "[INFO] Verifying dmf-lib installation..." pip show dmf-lib From 82cbd6d169162c5e7bb9b7a1a7fa6a998b63da5f Mon Sep 17 00:00:00 2001 From: Prattyush Mangal Date: Tue, 21 Apr 2026 16:38:31 +0100 Subject: [PATCH 04/11] feat: update dmf version to try latest install Signed-off-by: Prattyush Mangal --- .github/workflows/reusable-push-models-to-dmf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index 80537adc..55ec45f8 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -209,7 +209,7 @@ jobs: - name: install-dmf-library run: | echo "[INFO] Installing dmf-lib from Artifactory..." - pip install "dmf-lib==1.9.8" \ + pip install "dmf-lib==1.10.2" \ --index-url https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_API_KEY }}@na.artifactory.swg-devops.com/artifactory/api/pypi/res-data-model-factory-team-pypi-local/simple \ --extra-index-url https://pypi.org/simple \ --trusted-host na.artifactory.swg-devops.com From 5242468cd4f47c6275cee9d679966ca45e5ceaa2 Mon Sep 17 00:00:00 2001 From: Prattyush Mangal Date: Tue, 21 Apr 2026 16:46:29 +0100 Subject: [PATCH 05/11] feat: adds in lh-conf for dmf authentication Signed-off-by: Prattyush Mangal --- .github/workflows/reusable-push-models-to-dmf.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index 55ec45f8..88dd586f 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -250,6 +250,12 @@ jobs: DMF_COMMENTS='{"stack":"","instance_profile":"","served_model_name":"${{env.TARGET_REPO_ID}}/*${{env.EXT_GGUF}}","metadata":[{"supplemental_arguments":[]}]}' + cat > lh-conf.yaml < Date: Tue, 21 Apr 2026 18:57:41 +0100 Subject: [PATCH 06/11] feat: fixing model download path Signed-off-by: Prattyush Mangal --- .github/workflows/reusable-push-models-to-dmf.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index 88dd586f..c8c70a82 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -253,13 +253,16 @@ jobs: cat > lh-conf.yaml < Date: Wed, 22 Apr 2026 14:31:49 -0400 Subject: [PATCH 07/11] Default instance profile + updated naming Signed-off-by: vdemers --- .github/workflows/reusable-push-models-to-dmf.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index c8c70a82..8923ee78 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -125,7 +125,7 @@ env: jobs: push-quantized-model-to-dmf: runs-on: macos-latest # should be faster to provision mac runtime then ubuntu runtime - if: ${{ inputs.enable_language_jobs == true }} + if: ${{ inputs.enable_dmf_push == true }} env: HF_HUB_DISABLE_XET: 1 HF_HUB_ENABLE_HF_TRANSFER: 0 @@ -248,7 +248,7 @@ jobs: echo "[INFO] Using DMF namespace: granite_gguf" echo "[INFO] Using DMF table: model" - DMF_COMMENTS='{"stack":"","instance_profile":"","served_model_name":"${{env.TARGET_REPO_ID}}/*${{env.EXT_GGUF}}","metadata":[{"supplemental_arguments":[]}]}' + DMF_COMMENTS='{"stack":"","instance_profile":"granite-4.0-1b-bf16.gguf","served_model_name":"${{env.TARGET_REPO_ID}}-{{inputs.quantization}}","metadata":[{"supplemental_arguments":[]},{"type":"gguf"}]}' cat > lh-conf.yaml < Date: Wed, 22 Apr 2026 14:37:30 -0400 Subject: [PATCH 08/11] updated script to reflect enable_dmf_push instead of language job --- .github/workflows/reusable-push-models-to-dmf.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index 8923ee78..546f5c66 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -5,11 +5,11 @@ name: push-models-to-dmf on: workflow_dispatch: inputs: - enable_language_jobs: + enable_dmf_push: type: boolean required: false default: false - description: 'Enable language jobs to run tests' + description: 'Enable dmf push job' repo_id: type: string required: true @@ -61,7 +61,7 @@ on: ARTIFACTORY_API_KEY: required: true inputs: - enable_language_jobs: + enable_dmf_push: type: boolean required: false default: false From 5bf935894c66dbe6ac18096a07338c02504dffb0 Mon Sep 17 00:00:00 2001 From: vdemers Date: Wed, 22 Apr 2026 14:51:56 -0400 Subject: [PATCH 09/11] added served model name var --- .github/workflows/reusable-push-models-to-dmf.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index 546f5c66..c031d7d0 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -30,6 +30,10 @@ on: type: string required: false description: 'Target repository name extension' + served_model_name: + type: string + required: true + description: 'Custom model name for hosting (e.g., ibm-granite/granite-3.0-2b-instruct-v1)' ext_log: type: string required: false @@ -248,7 +252,7 @@ jobs: echo "[INFO] Using DMF namespace: granite_gguf" echo "[INFO] Using DMF table: model" - DMF_COMMENTS='{"stack":"","instance_profile":"granite-4.0-1b-bf16.gguf","served_model_name":"${{env.TARGET_REPO_ID}}-{{inputs.quantization}}","metadata":[{"supplemental_arguments":[]},{"type":"gguf"}]}' + DMF_COMMENTS='{"stack":"","instance_profile":"granite-4.0-1b-bf16.gguf","served_model_name":"${{inputs.served_model_name}}","metadata":[{"supplemental_arguments":[]},{"type":"gguf"}]}' cat > lh-conf.yaml < Date: Thu, 23 Apr 2026 09:27:09 -0400 Subject: [PATCH 10/11] TESTING with hardcoded HK token -- to be replaed by input param after confirmation Signed-off-by: vdemers --- .github/workflows/reusable-push-models-to-dmf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index c031d7d0..57cac002 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -222,7 +222,7 @@ jobs: - name: test-quantized-model-exists run: | - exists=$(python ./scripts/hf_model_file_exists.py ${{ env.TARGET_REPO_ID }} ${{ env.BASE_FNAME_QUANTIZED_GGUF }} ${{secrets.hf_token}}) + exists=$(python ./scripts/hf_model_file_exists.py ${{ env.TARGET_REPO_ID }} ${{ env.BASE_FNAME_QUANTIZED_GGUF }} ${{secrets.HF_TOKEN_IBM_GRANITE}}) echo "exists: '$exists'" if [[ "$exists" == "False" ]]; then echo "FAILURE: model file: '${{env.TARGET_REPO_ID}}/${{env.BASE_FNAME_QUANTIZED_GGUF}}' does not exist." From e5217a4d36cef8ef0eb0bb52b848066415b54e1e Mon Sep 17 00:00:00 2001 From: vdemers Date: Thu, 23 Apr 2026 09:47:40 -0400 Subject: [PATCH 11/11] TESTING with hardcoded HK token -- to be replaed by input param after confirmation -- download section Signed-off-by: vdemers --- .github/workflows/reusable-push-models-to-dmf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-push-models-to-dmf.yml b/.github/workflows/reusable-push-models-to-dmf.yml index 57cac002..81645f32 100644 --- a/.github/workflows/reusable-push-models-to-dmf.yml +++ b/.github/workflows/reusable-push-models-to-dmf.yml @@ -238,7 +238,7 @@ jobs: run: | echo "Downloading model to: ${{env.LOCAL_FNAME_QUANTIZED_GGUF}}..." echo "--------------------" - python ./scripts/hf_file_download.py ${{ env.MODEL_DOWNLOAD_DIR}} ${{ env.TARGET_REPO_ID }} ${{ env.BASE_FNAME_QUANTIZED_GGUF }} ${{secrets.hf_token}} + python ./scripts/hf_file_download.py ${{ env.MODEL_DOWNLOAD_DIR}} ${{ env.TARGET_REPO_ID }} ${{ env.BASE_FNAME_QUANTIZED_GGUF }} ${{secrets.HF_TOKEN_IBM_GRANITE}} ls -al ${{env.MODEL_DOWNLOAD_DIR}}/${{ env.TARGET_REPO_ID }}/*${{env.EXT_GGUF}} - name: push-model-to-dmf