Connect Your Repository

Link a Git repository to your Valohai project

Connect your Git repository to enable version-controlled ML experiments. Valohai will fetch your code at the start of each execution and automatically track which commit was used.

Before You Start

Make sure you have:

  • A Valohai project (create one from the dashboard)

  • A Git repository with your ML code

  • (For private repos) SSH access configured

Connect a Public Repository

Public repositories are the fastest way to get started—no authentication needed.

Navigate to your project settings:

  1. Open your Valohai project

  2. Go to SettingsRepository

  3. Enter your repository URL in HTTPS format:

    https://github.com/username/repository.git
  4. Click Save

Valohai will fetch your repository immediately. You'll see the available commits in the execution creation dialog.

Connect a Private Repository

Private repositories require SSH authentication. Valohai uses deploy keys for secure, read-only access.

Generate SSH Key in Valohai

The easiest method is to let Valohai generate the key pair:

  1. Go to SettingsRepository

  2. Click Generate SSH Key

  3. Download or copy both keys:

    • Public key (.pub) – Add this to your Git provider

    • Private key (.pem) – Paste this into Valohai

Add Public Key to Your Git Provider

The exact steps depend on your provider:

Add Private Key to Valohai

Back in Valohai's repository settings:

  1. Enter your SSH repository URL:

    [email protected]:username/repository.git
  2. Paste the entire private key into the SSH private key field

  3. The key should start with -----BEGIN RSA PRIVATE KEY-----

  4. Click Save

Valohai will attempt to fetch the repository. If successful, you'll see your commits.

Repository URL Formats

Use the correct URL format for your connection type:

Public HTTPS repositories:

https://github.com/username/repository.git
https://gitlab.com/username/repository.git

Private SSH repositories:

[email protected]:username/repository.git
[email protected]:username/repository.git
[email protected]:v3/org/project/repository
[email protected]:username/repository.git

Private HTTPS with credentials (not recommended):

git+https://username:[email protected]/username/repository.git

💡 Use SSH for private repos. Embedding credentials in URLs is less secure and harder to manage.

Verify the Connection

After connecting, verify everything works:

  1. Go to ExecutionsCreate Execution

  2. Check the Commit dropdown—you should see your commits listed

  3. If commits are missing, click Fetch Repository in settings

Fetch New Commits

Valohai caches your repository state. After pushing new commits, manually fetch to update:

  1. Go to SettingsRepository

  2. Click Fetch Repository

  3. New commits appear immediately in execution dialogs

Automate fetching with webhooks:

Troubleshooting

"Repository not found" or "Permission denied"

  • Double-check the repository URL format

  • Ensure the SSH public key is added to your Git provider

  • Verify the private key was pasted completely (including header/footer)

"Fetch timeout" or "Slow fetches"

  • Your repository may be too large (>100 MB compressed)

  • Use .vhignore to exclude unnecessary files

  • Consider using Git submodules for large dependencies

"Old code is running"

  • You need to fetch after pushing new commits

  • Click Fetch Repository in project settings

  • Consider setting up webhooks for automatic fetching

"Can't see my private key field"

  • Make sure you're using the SSH URL format (git@...)

  • The private key field only appears for SSH URLs

Next Steps

Configure your repository:

Advanced workflows:

Last updated

Was this helpful?