# `HfHub.Commit.LfsUpload`
[🔗](https://github.com/North-Shore-AI/hf_hub_ex/blob/v0.3.1/lib/hf_hub/commit/lfs_upload.ex#L1)

Git LFS upload protocol implementation.

Handles uploading large files (>= 10MB) using the Git LFS batch API.
Supports both single-part and multipart uploads based on server response.

# `request_batch_info`

```elixir
@spec request_batch_info(
  String.t(),
  [HfHub.LFS.UploadInfo.t()],
  String.t(),
  keyword()
) ::
  {:ok, map()} | {:error, term()}
```

Requests upload instructions from the LFS batch endpoint.

Sends file info (OID and size) to the server and receives
upload URLs and headers for each file.

# `upload_batch`

```elixir
@spec upload_batch(
  String.t(),
  [HfHub.Commit.Operation.Add.t()],
  String.t(),
  keyword()
) ::
  {:ok, [HfHub.Commit.Operation.Add.t()]} | {:error, term()}
```

Uploads multiple LFS files in batch.

Requests batch upload info from the server, uploads each file that
needs uploading, and verifies uploads if required.

## Options

- `:repo_type` - Repository type: :model, :dataset, :space (default: :model)
- `:max_workers` - Maximum concurrent uploads (default: 4)
- `:lfs_upload_timeout` - Socket receive timeout for direct LFS PUT/POST
  requests in milliseconds (default: 30 minutes)
- `:lfs_task_timeout` - Task timeout per LFS object in milliseconds
  (default: `:lfs_upload_timeout + 60_000`)

## Returns

Returns `{:ok, operations}` where operations have `is_uploaded: true`,
or `{:error, reason}` on failure.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
