> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Repositories

> <Badge color="blue" shape="pill">Early access</Badge>

Create and manage mka1-repos repositories — org-scoped git repositories for the model weights and datasets that Compute workloads pull from and publish to.


mka1-repos is the platform's repository service for model weights and datasets.
Every repository is an ordinary git repository with Git LFS, owned by exactly one organization and identified by the pair `<org>/<name>` — for example `meetkai/functionary`.

That identifier is the whole point.
You push artifacts to the repository from your machine over git, and Compute workloads resolve the same `<org>/<name>` through the platform's Hugging Face-compatible artifact endpoint to train on or serve them.

This guide covers both halves: the management API for creating, listing, renaming and deleting repositories, and the two client tools — `git` and the Hugging Face CLI — that move bytes in and out.

The CLI examples assume an [authenticated MKA1 CLI](/docs/cli/authentication).

## Before you start

You need:

| Requirement | Notes |
| - | - |
| API key | Send it as `Authorization: Bearer <mka1-api-key>` on every request. |
| Org owner or admin role | Every repository endpoint is restricted to owners and admins of the organization. There are no per-repository permissions; access is decided by your org role alone. |
| `git` and `git-lfs` | Model weights are large binaries; the git host stores them through Git LFS, so install and initialize `git lfs` before the first push. |

Repositories always belong to the caller's organization.
You never choose the `org` at create time — it is derived from your API key — and you cannot reach another organization's repositories at all.

## Create a repository

Pick a name and optionally a description.
The name must start with a letter or digit and be at most 100 characters of letters, digits, dots, underscores, and dashes (`^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$`).

Optionally, set `kind` to declare what the repository will hold. If omitted, it defaults to `repo`.

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  import { SDK } from '@meetkai/mka1';

  const sdk = new SDK({ bearerAuth: 'Bearer <mka1-api-key>' });

  const result = await sdk.repos.create({
    "createRepoRequest": {
      "name": "functionary",
      "description": "Fine-tuned weights for the MeetKai assistant."
    }
  });
  console.log(result.id);
  ```

  ```python Python SDK theme={null}
  import os
  from meetkai_mka1 import models
  from meetkai_mka1 import SDK

  sdk = SDK(bearer_auth="Bearer <mka1-api-key>")

  result = sdk.repos.create(
      name="functionary",
      description="Fine-tuned weights for the MeetKai assistant.",
  )
  print(result.id)
  ```

  ```csharp C# SDK theme={null}
  using MeetKai.MKA1.Types.Components;
  using MeetKai.MKA1.Types.Requests;
  using Newtonsoft.Json;
  using MeetKai.MKA1;

  var sdk = new SDK(bearerAuth: "Bearer <mka1-api-key>");

  // Deserialize the wire-format payload into the SDK request model.
  var body = JsonConvert.DeserializeObject<MeetKai.MKA1.Types.Components.CreateRepoRequest> ("""
  {
    "name": "functionary",
    "description": "Fine-tuned weights for the MeetKai assistant."
  }
  """)!;

  var response = await sdk.Repos.CreateAsync(body);
  var result = response.Repo
      ?? throw new InvalidOperationException(JsonConvert.SerializeObject(response));
  Console.WriteLine(JsonConvert.SerializeObject(result.Id));
  ```

  ```bash CLI theme={null}
  mka1 repos create \
    --output-format json \
    --body @- <<'JSON'
  {
    "description": "Fine-tuned weights for the MeetKai assistant.",
    "name": "functionary"
  }
  JSON
  ```

  ```bash Bash theme={null}
  curl https://apigw.mka1.com/api/v1/repos \
    --request POST \
    --header 'Content-Type: application/json' \
    --header "Authorization: Bearer $MKA1_API_KEY" \
    --data '{
      "name": "functionary",
      "description": "Fine-tuned weights for the MeetKai assistant."
    }'
  ```
</CodeGroup>

The response is `201` with the repository:

```json theme={null}
{
  "id": "rqz4h6k2m5n7p9r3t5v7w9x2",
  "org": "meetkai",
  "name": "functionary",
  "description": "Fine-tuned weights for the MeetKai assistant.",
  "created_at": "2026-07-30T09:15:00Z"
}
```

`id` is an opaque, stable identifier — the canonical key that survives renames.
`org` and `name` are the user-facing labels that form the repository reference and its URLs.

Creation provisions the backing git repository as part of the request.
If that provisioning fails, the create returns `502 provision_failed`. The rollback is best-effort, so retrying the same name may return `409 name_taken`; if it does, delete the repository and try again.
The request body rejects unknown fields, and a name that is already taken in your org returns `409`.

## The repository reference and git URL

Two values identify a repository everywhere else on the platform:

| Value | Shape | Used for |
| - | - | - |
| Repository reference | `<org>/<name>`, e.g. `meetkai/functionary` | Hugging Face-compatible resolution inside Compute workloads, and tools like ms-swift and vLLM. |
| Git URL | `https://git.mka1.com/<org>/<name>.git` | `git clone`, `git push`, and Git LFS transfers from your own machines. |

The git host authenticates with HTTP basic auth: the username must be your org slug and the password is an MKA1 API key. `org:apikey` is enforced — a username that does not match the organization is rejected.

Both values are what you hand to a Compute workload as environment variables — see [Run a fine-tune job](/docs/compute-fine-tune-job) and [Deploy a model server](/docs/compute-deployment).

## List repositories

Returns every repository in your organization.

You can optionally filter by `kind`. Note that legacy untyped repositories (`kind: null`) only appear when you omit the filter.

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  const result = await sdk.repos.list({});
  console.log(result.repos);
  ```

  ```python Python SDK theme={null}
  result = sdk.repos.list()
  print(result.repos)
  ```

  ```csharp C# SDK theme={null}
  var response = await sdk.Repos.ListAsync();
  var result = response.Object
      ?? throw new InvalidOperationException(JsonConvert.SerializeObject(response));
  Console.WriteLine(JsonConvert.SerializeObject(result.Repos));
  ```

  ```bash CLI theme={null}
  mka1 repos list \
    --output-format json
  ```

  ```bash Bash theme={null}
  curl https://apigw.mka1.com/api/v1/repos \
    --header "Authorization: Bearer $MKA1_API_KEY"
  ```
</CodeGroup>

```json theme={null}
{
  "repos": [
    {
      "id": "rqz4h6k2m5n7p9r3t5v7w9x2",
      "org": "meetkai",
      "name": "functionary",
      "description": "Fine-tuned weights for the MeetKai assistant.",
      "created_at": "2026-07-30T09:15:00Z"
    },
    {
      "id": "rb8s2d4f6h8j1l3n5q7s9v2x",
      "org": "meetkai",
      "name": "support-conversations",
      "description": "Curated support transcripts for fine-tuning.",
      "created_at": "2026-07-28T16:40:00Z"
    }
  ]
}
```

## Get a repository

Read a single repository by its reference.

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  const result = await sdk.repos.get({
    "org": "meetkai",
    "name": "functionary"
  });
  console.log(result.description);
  ```

  ```python Python SDK theme={null}
  result = sdk.repos.get(
      org="meetkai",
      name="functionary",
  )
  print(result.description)
  ```

  ```csharp C# SDK theme={null}
  var response = await sdk.Repos.GetAsync("meetkai", "functionary");
  var result = response.Repo
      ?? throw new InvalidOperationException(JsonConvert.SerializeObject(response));
  Console.WriteLine(JsonConvert.SerializeObject(result.Description));
  ```

  ```bash CLI theme={null}
  mka1 repos get \
    --org meetkai \
    --name functionary \
    --output-format json
  ```

  ```bash Bash theme={null}
  curl https://apigw.mka1.com/api/v1/repos/meetkai/functionary \
    --header "Authorization: Bearer $MKA1_API_KEY"
  ```
</CodeGroup>

A repository that does not exist in your org returns `404` — including any repository that belongs to a different org.

## Rename or update a repository

Updates are label-only: you can change `name`, `description`, and `kind`, and an omitted field is left unchanged.

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  const result = await sdk.repos.update({
    "org": "meetkai",
    "name": "functionary",
    "patchRepoRequest": {
      "name": "functionary-v2"
    }
  });
  console.log(result.name);
  ```

  ```python Python SDK theme={null}
  result = sdk.repos.update(
      org="meetkai",
      name_param="functionary",
      name="functionary-v2",
  )
  print(result.name)
  ```

  ```csharp C# SDK theme={null}
  // Deserialize the wire-format payload into the SDK request model.
  var body = JsonConvert.DeserializeObject<MeetKai.MKA1.Types.Components.PatchRepoRequest> ("""
  {
    "name": "functionary-v2"
  }
  """)!;

  var response = await sdk.Repos.UpdateAsync("meetkai", "functionary", body);
  var result = response.Repo
      ?? throw new InvalidOperationException(JsonConvert.SerializeObject(response));
  Console.WriteLine(JsonConvert.SerializeObject(result.Name));
  ```

  ```bash CLI theme={null}
  mka1 repos update \
    --org meetkai \
    --name functionary \
    --output-format json \
    --body @- <<'JSON'
  {
    "name": "functionary-v2"
  }
  JSON
  ```

  ```bash Bash theme={null}
  curl https://apigw.mka1.com/api/v1/repos/meetkai/functionary \
    --request PATCH \
    --header 'Content-Type: application/json' \
    --header "Authorization: Bearer $MKA1_API_KEY" \
    --data '{"name": "functionary-v2"}'
  ```
</CodeGroup>

The repository `id` is stable, so a rename is a metadata update — the git history and stored artifacts are untouched.
Renaming to a name that already exists in your org returns `409`.

Changing `kind` may be refused with `409 kind_has_content` if the repository still has container images reachable by tags (for example, switching away from `image`, or typing a legacy `kind: null` repository as a non-image kind). If you hit this, list the tags and delete them first.

<Warning>
  **A rename changes the repository reference and the git URL.**

  The old `<org>/<name>` stops resolving immediately.
  Update every git remote, every `REPO`/`REPO_URL` environment value in Compute create bodies, and every training or serving script that referenced the old name.
</Warning>

## List and delete image tags

If a repository holds container images, you can list and delete its tags through the management API.

The listing is a fact about what the repository currently holds (it is not derived from `kind`): a repository of any kind may list `[]`, and a legacy `kind: null` repository that still holds images lists the tags it has.

List tags:

```bash theme={null}
curl https://apigw.mka1.com/api/v1/repos/meetkai/functionary/tags \
  --header "Authorization: Bearer $MKA1_API_KEY"
```

The response is a single page (up to 1000 tags) and includes a `truncated` flag:

```json theme={null}
{
  "tags": [
    {
      "tag": "latest",
      "digest": "sha256:...",
      "media_type": "application/vnd.oci.image.manifest.v1+json",
      "size": 123456789,
      "moved_at": "2026-07-30T09:15:00Z"
    }
  ],
  "truncated": false
}
```

Delete a single tag:

```bash theme={null}
curl https://apigw.mka1.com/api/v1/repos/meetkai/functionary/tags/latest \
  --request DELETE \
  --header "Authorization: Bearer $MKA1_API_KEY"
```

Deleting a tag is an *untag*: it removes the name, but the underlying image may remain reachable by digest and by any other tag that points to it.

If the repository does not exist (or exists outside your org), deletion returns `404 not_found`. If the repository exists but the tag does not, deletion returns `404 tag_not_found`.

## Delete a repository

<CodeGroup>
  ```ts TypeScript SDK theme={null}
  const result = await sdk.repos.delete({
    "org": "meetkai",
    "name": "functionary"
  });
  console.log('Request completed');
  ```

  ```python Python SDK theme={null}
  result = sdk.repos.delete(
      org="meetkai",
      name="functionary",
  )
  print("Request completed")
  ```

  ```csharp C# SDK theme={null}
  var response = await sdk.Repos.DeleteAsync("meetkai", "functionary");
  Console.WriteLine("Request completed");
  ```

  ```bash CLI theme={null}
  mka1 repos delete \
    --org meetkai \
    --name functionary \
    --output-format json
  ```

  ```bash Bash theme={null}
  curl https://apigw.mka1.com/api/v1/repos/meetkai/functionary \
    --request DELETE \
    --header "Authorization: Bearer $MKA1_API_KEY"
  ```
</CodeGroup>

The response is `204` with no body.
The repository record is removed immediately — that delete is authoritative — while teardown of the backing git storage is best-effort cleanup.
A repeated delete of the same reference returns `404`.

<Warning>
  Deleting a repository removes the repository, its git history, and every stored artifact.
  This cannot be undone — there is no soft delete and no recovery window.
</Warning>

## Push and pull with git

Clone the repository, or add it as a remote of an existing local repository:

```bash theme={null}
git clone https://git.mka1.com/meetkai/functionary-train-data.git
cd functionary-train-data
```

```bash theme={null}
# In an existing local repository instead:
git remote add mka1 https://git.mka1.com/meetkai/functionary-train-data.git
```

Track large binaries with Git LFS before committing them.
Weight files must go through LFS; small text files such as configs, tokenizer definitions, and JSONL datasets can stay in plain git.

```bash theme={null}
git lfs install
git lfs track "*.safetensors" "*.bin" "*.gguf"
git add .gitattributes
```

Then commit and push as usual:

```bash theme={null}
git add .
git commit -m "Add curated support transcripts"
git push origin main   # or: git push mka1 main
```

Git authenticates the push with HTTP basic auth.
The username must be your org slug and the password is an MKA1 API key — `org:apikey` is enforced, so a username that does not match the organization is rejected:

```text theme={null}
Username for 'https://git.mka1.com': meetkai
Password for 'https://meetkai@git.mka1.com': <mka1-api-key>
```

<Note>
  For non-interactive pushes (CI, a training box), export the API key as `MK_API_KEY` in the environment (for example from a CI secret) and supply it through a git credential helper, instead of embedding the key in the remote URL, where it would be written to `.git/config`:

  ```bash theme={null}
  git config credential.helper '!f() { echo "username=meetkai"; echo "password=$MK_API_KEY"; }; f'
  ```
</Note>

Lay out the repository however your training or serving stack expects.
The examples in this guide use two repositories: `meetkai/functionary-train-data`, a dataset repository holding JSONL transcripts, and `meetkai/functionary`, a weights repository in the usual Hugging Face layout (`config.json`, tokenizer files, `*.safetensors`).

## Push and pull with the Hugging Face CLI

Install the CLI with `uv tool install huggingface-hub==0.34.4` if `hf` is not already available.

The same repository is reachable over the Hugging Face Hub API. Set the endpoint and token, and disable Xet so uploads use the standard Hub/LFS path supported by mka1-repos:

```bash theme={null}
export HF_ENDPOINT=https://hf.mka1.com
export HF_TOKEN="$MKA1_API_KEY"
export HF_HUB_DISABLE_XET=1
```

With those set, the ordinary Hugging Face commands operate on your repositories instead of the public hub:

```bash theme={null}
hf download meetkai/functionary --local-dir ./base
hf download meetkai/functionary-train-data --repo-type dataset --local-dir ./data
hf upload meetkai/functionary ./merged .
```

The same variables work from Python, because `huggingface_hub` reads them by name:

```python theme={null}
from huggingface_hub import snapshot_download

path = snapshot_download(repo_id="meetkai/functionary")
```

<Note>
  `hf` is the current CLI; older environments ship the same commands as `huggingface-cli`.
  Unlike git, this path does not need your org slug as a username — the token carries the identity.
</Note>

This is the part that carries over to Compute. A training or serving container sets the same variables, and ms-swift or vLLM resolves `<org>/<name>` with no code changes — see [Run a fine-tune job](/docs/compute-fine-tune-job) and [Deploy a model server](/docs/compute-deployment).

## Errors

Repository endpoints return a uniform envelope with a stable machine-readable code and the request's correlation id:

```json theme={null}
{
  "error": "not_found",
  "correlation_id": "c0a8f3d2-4b6e-4f1a-9c7d-2e5b8a1f6d3c"
}
```

| Status | Code | Meaning |
| - | - | - |
| `400` | `invalid_name`, `invalid_body` | A name that violates the pattern, or a malformed body or unknown field (bodies reject unknown properties). |
| `401` | `unauthorized` | Missing or incomplete org-scoped identity on the request. |
| `403` | `forbidden` | The caller is not an owner or admin of the organization. |
| `404` | `not_found` | No such repository in your org — a repository in another org is reported as `404`, never `403`, so existence never leaks. |
| `409` | `name_taken` | The name is already taken in your org (create or rename). |
| `500` | `internal` | An unexpected server-side error. |
| `502` | `provision_failed` | The backing git repository could not be created; the repository could not be provisioned. |
| `503` | `org_unresolved` | The gateway could not resolve your organization; retry, and contact support if it persists. |

## API reference

For the full request and response schemas, open the Repositories groups in the [API Reference](/api-reference/introduction).

## See also

* [Run a fine-tune job](/docs/compute-fine-tune-job) - publish merged weights to a repository from a training job.
* [Deploy a model server](/docs/compute-deployment) - serve weights straight from a repository with vLLM.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.