mirror of
https://github.com/KohakuBlueleaf/KohakuHub.git
synced 2026-05-23 19:51:02 -05:00
1.9 KiB
1.9 KiB
title, description, icon
| title | description | icon |
|---|---|---|
| Getting Started | Complete guide to using KohakuHub - from installation to advanced features | i-carbon-rocket |
Getting Started with KohakuHub
Everything you need to start using KohakuHub.
🚀 Quick Setup
1. Create Account
- Visit your KohakuHub instance
- Click Register
- Enter username, email, password
- If invitation-only: Use invitation link
- Log in
2. Create Access Token
- Settings → Access Tokens
- Create New Token
- Name it (e.g., "Dev Machine")
- Copy token (can't view again!)
3. Configure CLI
export HF_ENDPOINT=http://your-kohakuhub-instance:28080
export HF_TOKEN=your_token_here
# Permanent
echo 'export HF_ENDPOINT=http://localhost:28080' >> ~/.bashrc
📦 CLI Tools
huggingface-cli
pip install -U huggingface_hub
huggingface-cli login
huggingface-cli download username/model-name
huggingface-cli upload username/model-name file.safetensors
kohub-cli
pip install -e . # From KohakuHub repo
kohub-cli interactive # TUI mode
kohub-cli repo create username/model --type model
kohub-cli org create my-team
🐍 Python API
import os
os.environ['HF_ENDPOINT'] = 'http://localhost:28080'
os.environ['HF_TOKEN'] = 'your_token'
from huggingface_hub import HfApi
api = HfApi()
# Upload
api.upload_file(
path_or_fileobj="model.safetensors",
path_in_repo="model.safetensors",
repo_id="username/my-model"
)
# Download
from huggingface_hub import hf_hub_download
path = hf_hub_download(repo_id="username/model", filename="config.json")
🔄 Git Clone
git clone http://localhost:28080/username/repo.git
cd repo
git lfs install
git lfs pull # Get large files
🌐 Web Features
- Create repos via UI
- Upload via drag-drop
- Browse files and commits
- View YAML metadata
- Like repositories
- Join organizations
See full details in Features