Skip to main content

Configuration Guide

CSGLite's runtime environment and parameters are managed by a JSON configuration file. This file is automatically created upon launching the client for the first time, allowing users to customize storage locations, API endpoints, access tokens, and server listen addresses.


Configuration Path

  • File Path: ~/.csghub-lite/config.json (located in the .csghub-lite folder within the user's home directory)

Configuration JSON Structure Example

{
"server_url": "https://hub.opencsg.com",
"ai_gateway_url": "https://ai.space.opencsg.com",
"token": "your-access-token-here",
"listen_addr": ":11435",
"model_dir": "/Users/user/.csghub-lite/models",
"dataset_dir": "/Users/user/.csghub-lite/datasets"
}

Tip: The CLI and Web settings page expose a convenient key named storage_dir (default is ~/.csghub-lite). When you modify storage_dir, the client automatically derives and expands the actual model and dataset folders to model_dir (<storage_dir>/models) and dataset_dir (<storage_dir>/datasets).


Settings Key Explanations

1. server_url

The API registry endpoint of the official or private CSGHub platform.

  • Default Value: https://hub.opencsg.com
  • Description: The base API address used for model searching, metadata lookups, and downloading files.
  • CLI Modification Example:
    csghub-lite config set server_url https://my-private-csghub.example.com

2. ai_gateway_url

The AI Gateway URL used for calling cloud-based remote models.

  • Default Value: https://ai.space.opencsg.com
  • Description: Re-routes default cloud gateway API calls, which is useful in proxy environments or private enterprise gateways.
  • CLI Modification Example:
    csghub-lite config set ai_gateway_url https://my-gateway.example.com

3. token

The Access Token used to authenticate when downloading private models or datasets from the registry.

  • Default Value: (None)
  • Description: Once set, the authentication header will be included automatically when pulling private models.
  • How to Configure:
    # Method A: Interactive login (recommended; does not leave tokens in shell history)
    csghub-lite login

    # Method B: Direct configuration write
    csghub-lite config set token your_token_here

4. listen_addr

The default socket address and port bound by the REST API server on startup.

  • Default Value: :11435
  • Description: Follows the format [Host-IP]:[Port].
  • CLI Modification Example:
    # 1. Change binding port
    csghub-lite config set listen_addr :8080

    # 2. Bind to local loopback address only (blocks outside traffic)
    csghub-lite config set listen_addr 127.0.0.1:11435

5. storage_dir

The shared root directory for local model weights and datasets.

  • Default Value: ~/.csghub-lite
  • Description: Use this to move all cache content to a larger external hard drive or SSD.
  • CLI Modification Example:
    csghub-lite config set storage_dir /Volumes/ExternalSSD/csghub-lite

6. model_dir / dataset_dir

The exact paths where models and datasets are cached. Usually derived from storage_dir, but can be explicitly overwritten if you require custom directory pathways.

  • CLI Modification Example:
    csghub-lite config set model_dir /data/models
    csghub-lite config set dataset_dir /data/datasets

Default Directory Structure

After running the Qwen3-0.6B-GGUF model for the first time, your ~/.csghub-lite folder will show the following structural layout:

~/.csghub-lite/
├── config.json # Client configuration file
├── models/ # Local models caching directory
│ └── Qwen/
│ └── Qwen3-0.6B-GGUF/
│ ├── manifest.json # Cached model metadata
│ ├── Qwen3-0.6B-Q8_0.gguf # Model weights binary file
│ ├── README.md # Model card description
│ └── LICENSE # License agreements
└── datasets/ # Local datasets caching directory