-
Notifications
You must be signed in to change notification settings - Fork 0
Python Bridge
Mike edited this page May 28, 2026
·
1 revision
Bridge и NativeBridge - локальный HTTP control plane xlocllm.
Они поднимают loopback endpoint, через который runtime управляет моделями и отдает OpenAI-compatible API.
Обычно вы не создаете bridge вручную: Runtime сам выбирает NativeBridge для mode="native"
и Bridge для mode="web". Отдельный bridge API нужен для manual control, health checks,
logs, cache operations, registry lookup и интеграции с уже запущенным local server.
| Свойство | Описание |
|---|---|
bridge.port |
локальный port |
bridge.base_url |
http://127.0.0.1:<port> |
bridge.url |
http://127.0.0.1:<port>/v1 OpenAI-compatible URL |
bridge.token |
browser pairing token для web bridge |
bridge.ttl |
reserved lifetime field |
bridge.live_time |
optional server lifetime in seconds |
| Метод | Зачем нужен | Ключевые параметры |
|---|---|---|
activate(daemon=False) |
запустить bridge, если он еще не healthy | daemon |
close() |
shutdown bridge и убрать registry entry | - |
status() |
полный /xlocllm/v1/status snapshot |
- |
health() |
проверить /health
|
- |
processes() |
bridge/window PIDs и alive flags | - |
models() |
backend catalog/model states или local fallback | - |
units() |
unit definitions | - |
logs(limit=200) |
bridge/backend logs | limit |
wait_ready(timeout=None, require_browser=False) |
дождаться health и optional browser pairing |
timeout, require_browser
|
reload(units=None) |
перезапустить backend runtime с units | units |
set_active(unit, active=True, model=None) |
активировать или деактивировать model |
unit, active, model
|
delete_model(unit_or_model, model=None) |
удалить cache одной модели |
unit_or_model, model
|
delete_all_models(confirm=True) |
удалить все model cache entries | confirm=True |
invoke(endpoint, payload, timeout=None) |
вызвать /xlocllm/v1/invoke/{endpoint}
|
endpoint, payload, timeout
|
| Класс | Режим | Когда используется |
|---|---|---|
NativeBridge |
native |
default для локальных native engines: llama.cpp/GGUF и ONNX Runtime |
Bridge |
web |
browser-backed runtime: paired browser, WebGPU/WebNN/WASM |
BridgeGroup |
registry helper | возвращается GetBridge() без port и агрегирует несколько bridges |
- xlocllm
- Quickstart
- About
- Functions Python
- Functions TypeScript
- Use cases
- Examples Python
- Examples TypeScript
- Shared GPU mode
-
Models catalog
- Models The best
- Models Full model list
- Models Use your model
- For native mode
- Models Native LLM tiny small
- Models Native LLM medium
- Models Native LLM large
- Models Native embedding
- Models Native reranker
- Models Native translator
- Models Native tts
- Models Native vlm
- Models Native asr
- Models Native ocr
- Models Native image-classification
- Models Native object-detection
- Models Native image-segmentation
- Models Native depth-estimation
- Models Native document-layout
- Models Native table-detection
- Models Native document-qa
- Models Native language-id
- Models Native audio-classification
- Models Native text-classification
- Models Native ner
- Models Native zero-shot-text
- Models Native summarization
- Models Native text2text
- Models Native code
- For webgpu mode
- For web mode
- Models Web LLM
- Models Web embedding
- Models Web reranker
- Models Web translator
- Models Web tts
- Models Web vlm
- Models Web asr
- Models Web ocr
- Models Web image-classification
- Models Web object-detection
- Models Web image-segmentation
- Models Web depth-estimation
- Models Web document-layout
- Models Web table-detection
- Models Web document-qa
- Models Web zero-shot-image
- Models Web language-id
- Models Web audio-classification
- Models Web text-classification
- Models Web ner
- Models Web zero-shot-text
- Models Web summarization
- Models Web text2text
- Models Web code
- Dev