Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Conversation

@namchuai
Copy link
Contributor

@namchuai namchuai commented Oct 14, 2024

Describe Your Changes

  • Refactor to add download stop API.
  • Using multi interface from libcurl.
  • Throttle event by 1 sec
  • Return DownloadTask when calling download API.

API:

curl --location --request DELETE 'http://127.0.0.1:39281/models/pull' \
--header 'Content-Type: application/json' \
--data '{
    "taskId": <your_download_task_id>
}'

Response when calling Download API

{
    "message": "Model start downloading!",
    "task": {
        "id": "Mistral-7B-Instruct-v0.1-GGUF",
        "items": [
            {
                "bytes": 3822024352,
                "checksum": "N/A",
                "downloadUrl": "https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/resolve/main/mistral-7b-instruct-v0.1.Q3_K_L.gguf",
                "downloadedBytes": 0,
                "id": "TheBloke:Mistral-7B-Instruct-v0.1-GGUF:mistral-7b-instruct-v0.1.Q3_K_L.gguf",
                "localPath": "/Users/jamesnguyen/cortexcpp/models/huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF/mistral-7b-instruct-v0.1.Q3_K_L.gguf"
            }
        ],
        "type": "Model"
    }
}

Issue

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@namchuai namchuai force-pushed the j/refactor-download-service branch 4 times, most recently from 0c0fea0 to 4dad79a Compare October 15, 2024 07:40
@namchuai namchuai marked this pull request as ready for review October 15, 2024 12:13
@namchuai namchuai force-pushed the j/refactor-download-service branch from 116b675 to afeda20 Compare October 15, 2024 12:16
@dan-menlo
Copy link
Contributor

@namchuai At the conclusion of this issue, please make sure we add this to the API Reference (i.e. swagger). cc @gabrielle-ong

Copy link
Contributor

@vansangpfiev vansangpfiev left a comment

Choose a reason for hiding this comment

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

Great work!

@namchuai namchuai merged commit cc01530 into dev Oct 16, 2024
4 checks passed
@namchuai namchuai deleted the j/refactor-download-service branch October 16, 2024 03:03
@gabrielle-ong
Copy link
Contributor

@namchuai can I check if this new endpoint DELETE models/pull is added to Swagger?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

idea: [DownloadEvent] Adding download stop API feat: Model Pull has clear API and CLI to support Huggingface Repos

5 participants