semif-api-rocm

SemIf HTTP API and rocm flake
Log | Files | Refs | README | LICENSE

README.md (2563B)


semif-api

An HTTP API around SemIf (consumed as a library — no fork), with two serving backends, plus a browser UI with self-learning game demos: an agent plays a platformer and a puzzle room by asking the model to decide, and rewrites its own rules from a transcript of failures.

Two ways to score a decision:

Quickstart

nix develop            # ROCm torch (gfx1151), transformers, fastapi, uvicorn

# torch (default model Qwen/Qwen3.5-4B):
.venv/bin/python -m uvicorn semif_api.app:app --host 127.0.0.1 --port 8321

# or llama (default server http://127.0.0.1:8080, alias Qwen3.5-4B):
SEMIF_BACKEND=llama .venv/bin/python -m uvicorn semif_api.app:app --host 127.0.0.1 --port 8321

Open http://127.0.0.1:8321/ui/ — a request builder for /decide and /decide-batch, plus four demo tabs (platformer and puzzle room, each in ruled and self-learning variants).

Layout

Tests

node --test "tests/**/*.cjs"
.venv/bin/python -m unittest discover -s tests -p 'test_llama*.py'

NixOS module

services.semif-api = {
  enable = true;
  backend = "llama";          # or "torch"
  llamaUrl = "http://127.0.0.1:8080";
  llamaModel = "Qwen3.5-4B";  # any alias served by llama-server
};

Options: backend, host (127.0.0.1), port (8321), model, revision, user, openFirewall, maxTokens, and the llama* settings in docs/llama-backend.md.

Notes