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

# Launch a custom model

> Prepare a Hugging Face repository with Safetensors weights and a valid pipeline tag for SynapsAI Cloud

This page shows how to prepare your model repository on Hugging Face so it can be deployed on SynapsAI Cloud. If the model is already on the Hub in Safetensors format with a valid `pipeline_tag`, you can skip to [Deploy a model](/guides/deploy-model).

We support model architectures available in the Hugging Face [transformers](https://huggingface.co/docs/transformers) and [diffusers](https://huggingface.co/docs/diffusers) libraries. Custom architectures and remote code are not supported yet.

## Prerequisites

* Hugging Face account: [huggingface.co](https://huggingface.co)
* Personal Access Token with read access: [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens)
* `huggingface_hub`, `transformers`, and `safetensors` installed

```bash theme={null}
pip install --upgrade huggingface_hub transformers safetensors
```

## Create a model repository

Create a new model repo on Hugging Face (UI or CLI):

* **UI:** [huggingface.co/new](https://huggingface.co/new)
* **CLI:**

```bash theme={null}
huggingface-cli login
huggingface-cli repo create <namespace>/<model-name> --type model
```

## Required files

Your repository should include:

* Model weights in `.safetensors` format
* Model configuration files (for example, `config.json`)
* Tokenizer files (for example, `tokenizer.json`, `tokenizer_config.json`, `vocab.json`, `merges.txt`)
* Any processors (for example, `preprocessor_config.json`, image processor files)
* A `README.md` with a `pipeline_tag`

Refer to the official docs for file layouts:

* [Transformers docs](https://huggingface.co/docs/transformers/index)
* [Safetensors format](https://huggingface.co/docs/safetensors/index)

If your weights are not in Safetensors format, see [Convert models to Safetensors](/guides/convert-safetensors).

## Push model weights and artifacts

Below is a Python example that saves a model and tokenizer, then pushes them to the Hub.

```python theme={null}
from huggingface_hub import login
from transformers import AutoModelForCausalLM, AutoTokenizer

login(token="<HF_TOKEN>")

model_id = "<namespace>/<model-name>"

model = AutoModelForCausalLM.from_pretrained("gpt2")
tokenizer = AutoTokenizer.from_pretrained("gpt2")

model.save_pretrained("./model", safe_serialization=True)
tokenizer.save_pretrained("./model")

model.push_to_hub(model_id, private=True)
tokenizer.push_to_hub(model_id, private=True)
```

CLI alternative with Git:

```bash theme={null}
cp -r ./model/* .
git add .
git commit -m "Add model weights, config, and tokenizer"
git push
```

For more details, see the [Hugging Face upload guide](https://huggingface.co/docs/hub/models-uploading).

## Verify repository readiness

* Confirm all required files are present (weights, config, tokenizer, processors).
* Confirm weights are in `.safetensors` format.
* Ensure `README.md` includes a pipeline tag:

```markdown theme={null}
pipeline_tag: text-generation
```

Next, proceed to [Deploy a model](/guides/deploy-model).
