Skip to content

Configuration

charles edited this page Jul 12, 2026 · 2 revisions

Configuration

Reference for all config.toml and models.json settings.

config.toml

The main configuration file lives in your CP repo directory (~/.swan/computing by default, or the path you pass to --repo).

[API]

[API]
  Port = 9085                              # HTTP API port for the local dashboard/REST API
  MultiAddress = "/ip4/127.0.0.1/tcp/9085" # libp2p multiaddress (optional for Inference mode)
  Domain = ""                              # Wildcard domain for container services (unused in inference mode)
  NodeName = "my-provider"                 # Human-readable name shown in the marketplace
  pricing = false                          # Enable resource pricing
  AutoDeleteImage = false                  # Auto-remove Docker images after task completion
  ClearLogDuration = 0                     # Log retention in hours (0 = keep forever)
  GpuUtilizationRejectThreshold = 0.0      # Reject tasks above this GPU utilization (0 = disabled)

[Inference]

[Inference]
  Enable = true
  WebSocketURL = "wss://inference-ws.swanchain.io"  # NOTE: no /ws suffix — client appends it
  ApiKey = "sk-prov-xxxxxxxxxxxxxxxxxxxx"            # Provider key from signup
  Models = ["meta-llama/Llama-3.2-3B-Instruct"]     # Must match keys in models.json
  ServiceURL = ""                                    # Auto-derived from WebSocketURL if empty
Field Required Description
Enable No Enable inference mode (default: true)
WebSocketURL Yes Swan Inference WebSocket endpoint. Do not add /ws — the client appends it automatically
ApiKey Yes sk-prov-* key issued when you upgrade to provider
Models Yes Model IDs to advertise. Must match keys in models.json
ServiceURL No HTTP URL for status checks. Auto-derived from WebSocketURL if empty

Environment variable overrides:

export INFERENCE_WS_URL=ws://localhost:8081   # useful for local dev
export INFERENCE_API_KEY=sk-prov-your-key

[RPC]

[RPC]
  SWAN_CHAIN_RPC = "https://mainnet-rpc01.swanchain.io"

models.json

Maps model IDs to local inference server endpoints. Watched by fsnotifychanges take effect without restart.

{
  "meta-llama/Llama-3.2-3B-Instruct": {
    "endpoint": "http://localhost:30000",
    "gpu_memory": 8000,
    "category": "text-generation"
  },
  "Qwen/Qwen2.5-7B-Instruct": {
    "endpoint": "http://localhost:11434",
    "gpu_memory": 14000,
    "category": "text-generation",
    "local_model": "qwen2.5:7b"
  }
}
Field Required Description
endpoint Yes Base URL of the OpenAI-compatible inference server
api_key No API key sent in Authorization: Bearer header to the endpoint
gpu_memory No VRAM required in MB (informational)
category No Model category: text-generation, image-generation, embedding
local_model No Model name the local server uses internally (e.g. Ollama's qwen2.5:7b vs the HuggingFace ID)
format No Weight format: fp16, fp8, awq, gptq, gguf
quantization No Quantization detail: q4_k_m, q8_0, w4a16, etc.

Note: The keys in models.json must match the IDs listed in [Inference] Models in config.toml. The computing-provider only advertises and health-checks models that appear in both.


Reload models without restart

curl -X POST http://localhost:9085/api/v1/computing/inference/models/reload

Or just edit models.json — the file watcher picks up changes automatically.


Verify your configuration

computing-provider inference config   # show active inference settings
computing-provider inference status   # check registration on Swan Inference
computing-provider info               # show provider identity and wallet

Clone this wiki locally