Skip to main content

Model Backends

Blindference Node uses a pluggable backend registry to support multiple inference providers. You can add custom backends without modifying core code.

Built-in Backends

Backend Architecture

All backends implement the ModelBackend abstract base class:

Adding Custom Backends

1. Config Dotted Path (Fastest)

Write a Python module anywhere on your PYTHONPATH:
Register via CLI:
The path is validated (imported + instantiated), then persisted in ~/.blindference/config.json:

2. Entry-Point Plugins (For Published Packages)

Declare in your pyproject.toml:
Users install your package:
The node auto-discovers it on startup via importlib.metadata.

3. Fork & Extend

Add your backend class under blindference_node/models/ and register it in backend_loader.py::_register_builtin().

CLI Backend Management

Registration Order & Precedence

  1. Built-in (vLLM, Groq, Gemini, Mock)
  2. Entry-point plugins (third-party pip packages)
  3. Config dotted paths (custom_backends in config.json)
Later registrations override earlier ones for the same model_id.

Determinism Requirement

All backends must produce byte-identical output for the same (model_id, prompt) pair. Required for quorum consensus. Tips:
  • Set temperature=0, top_p=1, top_k=-1
  • Use fixed seed=42 (Groq supports this)
  • Document any backend-specific non-determinism