jozu-ai / kitops

Tools for easing the handoff between AI/ML and App/SRE teams.
https://KitOps.ml
Apache License 2.0
266 stars 26 forks source link

missing file causes manifest to be incomplete #255

Closed gorkem closed 2 months ago

gorkem commented 2 months ago

Describe the bug If a file referenced by the code layer is mistyped, kit continues to package other layers (model, config) however the manifest is missing the layers completely. Kit should error if a referenced file is not present on the file system.

To Reproduce

manifestVersion: 1.0
package:
  name: llama3
  version: 3.0.0
  description: >-
    Llama 3 family of large language models (LLMs), a collection of pretrained and  instruction tuned generative text models in 8 and 70B sizes.
  authors: [Meta Platforms, Inc.]
code:
  - path: LICENSE.txt
    description: License file.
  - path: README.md
    description: Readme file.
  - path: USE_POLICY.md
    description: Use policy file.
model:
  name: llama3-8B-instruct-f16
  path: ./some-model.gguff
  description: >-
    Llama 3 8B instruct model
  license: META LLAMA 3 COMMUNITY LICENSE AGREEMENT

Steps to reproduce the behavior:

  1. Using the above Kitfile in the ./model folder issue kit pack ./model -t ghcr.io/jozu-ai/llama3:8B-instruct-f16
  2. The ./model includes all the referenced files expect LICENSE.txt which is named LICENSE on the ./model folder
  3. the command concludes with
    kit pack ./model -t ghcr.io/jozu-ai/llama3:8B-instruct-f16
    Saved configuration: sha256:38cd4ea6979847fda9a04da2831135fbc4514de322cd35bed264c863f67b70ee
    Saved model layer: sha256:b77f22bf5654a21dd8ef89058caf6ec50f688ef23ed1e552154975d29c14d55b
    Saved manifest to storage: sha256:044ccc51bd6ae545bf174b15abae6784ef34405653ac233e56bdb2d0993099af
    Model saved: sha256:044ccc51bd6ae545bf174b15abae6784ef34405653ac233e56bdb2d0993099af
  4. issuing an inspect command returns
    kit inspect  ghcr.io/jozu-ai/llama3:8B-instruct-f16
    {
    "schemaVersion": 2,
    "config": {
    "mediaType": "application/vnd.kitops.modelkit.config.v1+json",
    "digest": "sha256:38cd4ea6979847fda9a04da2831135fbc4514de322cd35bed264c863f67b70ee",
    "size": 611
    },
    "layers": null
    }

    Version

    Version: 0.1.3-71ba3de
    Commit: 71ba3dece0c37f180fe6969ec547039a80c0b968
    Built: 2024-04-19T15:27:51Z
    Go version: go1.21.6