跳轉到主要內容

Documentation Index

Fetch the complete documentation index at: https://docs.bricks.tools/llms.txt

Use this file to discover all available pages before exploring further.

Buttress 伺服器透過 --config 讀取單一 TOML 檔案。每個區段皆為選填,省略時會使用預設值。

最小範例

[server]
port = 2080

[[generators]]
type = "ggml-llm"
[generators.model]
repo_id = "ggml-org/gpt-oss-20b-GGUF"
quantization = "mxfp4"
n_ctx = 12800

[server]

型別預設值說明
portnumber2080HTTP/WebSocket 連接埠
log_levelstring"info"debuginfowarnerror
idstringbuttress-<machineId>用於繫結與探索的穩定伺服器 id
namestring自動生成顯示於 BRICKS Controller 的友善名稱
max_body_sizenumber 或 string52428800(50 MB)最大上傳大小;接受 "50MB""1GB" 等寫法
session_timeoutnumber 或 string60000(1 分鐘)WebSocket 閒置逾時;接受 "1m""30s"
temp_file_dirstring<os-tmpdir>/.buttressSTT 音訊上傳與其他暫存檔案的目錄

[runtime]

伺服器存放下載模型的位置。
[runtime]
cache_dir = "~/.buttress/models"
huggingface_token = ""
預設值說明
cache_dir~/.buttress/models下載模型檔案的存放位置
huggingface_token""Hugging Face 認證 token;若為空會回退至 HF_TOKEN 環境變數

[runtime.session_cache]

針對 ggml-llm generator,伺服器可在請求之間保留 KV cache 狀態,讓共用相同 prompt 前綴的後續完成可省略 prompt 處理。
[runtime.session_cache]
enabled = true
max_size_bytes = "10GB"
max_entries = 1000
預設值說明
enabledtrue啟用持久化的 KV cache
max_size_bytes"10GB"磁碟總預算;接受 "500MB""50GB" 或數值
max_entries1000最大快取項目數(採 LRU 淘汰)
快取檔案存放於 {cache_dir}/.session-state-cache/

[[generators]]

每個 [[generators]] 區段宣告一組伺服器要提供的模型。可重複多次以提供多個模型。

LLM(llama.cpp / GGML)

[[generators]]
type = "ggml-llm"

[generators.backend]
variant_preference = ["cuda", "vulkan", "default"]

[generators.model]
repo_id = "ggml-org/gpt-oss-20b-GGUF"
quantization = "mxfp4"
n_ctx = 12800

LLM(MLX,僅限 Apple Silicon)

[[generators]]
type = "mlx-llm"

[generators.model]
repo_id = "mlx-community/Llama-3.2-3B-Instruct-4bit"
n_ctx = 8192

語音辨識(Whisper / GGML)

[[generators]]
type = "ggml-stt"

[generators.backend]
variant_preference = ["coreml", "default"]

[generators.model]
repo_id = "BricksDisplay/whisper-ggml"
filename = "ggml-small.bin"
說明
typeggml-llmmlx-llmggml-stt 之一
backend.variant_preference後端變體的優先順序清單。LLM 接受 cudavulkansnapdragondefault;STT 接受 coremldefault
model.repo_idHugging Face repo id
model.filenamerepo 內的特定檔案(僅 STT)
model.quantization對應 repo 的量化標籤(僅 LLM)
model.n_ctx以 token 計算的 context window 長度(僅 LLM)

[autodiscover]

伺服器會於 UDP 8089 廣播自己,以便相同區域網路上的 Foundation 裝置能找到。預設啟用自動探索。
[autodiscover]
[autodiscover.udp]
port = 8089

[autodiscover.udp.announcements]
enabled = true
interval = 5000

[autodiscover.udp.requests]
enabled = true
responseDelay = 100

[autodiscover.http]
enabled = true
path = "/buttress/info"
cors = true
設為 [autodiscover] = false 可完全停用自動探索。協定細節請參閱自動探索參考

[env]

啟動時套用的環境變數,但僅在系統環境中尚未設定時生效。系統變數與命令列匯出值的優先順序更高。
[env]
HF_TOKEN = "hf_..."
CUDA_VISIBLE_DEVICES = "0"

相容性端點

以下端點為實驗性功能,schema、錯誤格式與 CORS 預設值未來可能變動。
伺服器除原生 WebSocket RPC 外,可額外開放 OpenAI 與 Anthropic 相容的 HTTP 路由。每項皆需明確啟用。
[openai_compat]
enabled = true
# cors_allowed_origins = "*"

[anthropic_messages]
enabled = true
# cors_allowed_origins = ["http://localhost:3000"]
端點設定旗標
POST /oai-compat/v1/chat/completions[openai_compat] enabled = true
GET /oai-compat/v1/models[openai_compat] enabled = true
POST /anthropic-messages/v1/messages[anthropic_messages] enabled = true
POST /anthropic-messages/v1/messages/count_tokens[anthropic_messages] enabled = true
每項端點亦可透過環境變數啟用:ENABLE_OPENAI_COMPAT_ENDPOINT=1ENABLE_ANTHROPIC_MESSAGES_ENDPOINT=1

下一步

工作區繫結

將伺服器與 BRICKS 工作區配對並啟用認證。

區域網路自動探索

Foundation 裝置如何於區域網路上找到您的伺服器。