Files
2026-03-16 09:52:57 -04:00

5.6 KiB

Podman bifrost

Setup bifrost Project

  • Copy and rename this folder to active/container_bifrost
  • Find and replace bifrost with the name of the service.
  • Create the rootless user to run the podman containers
  • Write the compose.yaml spec for your service
  • Convert the compose.yaml spec to a quadlet
  • Install the quadlet on the podman server
  • Expose the quadlet service
  • Install a backup service and timer

Install bifrost

Create the ai user

# SSH into your podman server as root
useradd ai
loginctl enable-linger $(id -u ai)
systemctl --user --machine=ai@.host enable podman-restart
systemctl --user --machine=ai@.host enable --now podman.socket
mkdir -p /home/ai/.config/containers/systemd

Write the bifrost compose spec

Edit the compose.yaml at active/container_bifrost/compose/compose.yaml

A Note on Volumes

Named volumes are stored at /home/bifrost/.local/share/containers/storage/volumes/.

Convert bifrost compose spec to quadlets

Run the following to convert a compose.yaml into the various .container files for systemd:

# Generate the systemd service
podman run \
--security-opt label=disable \
--rm \
-v $(pwd)/active/container_bifrost/compose:/compose \
-v $(pwd)/active/container_bifrost/quadlets:/quadlets \
quay.io/k9withabone/podlet \
-f /quadlets \
-i \
--overwrite \
compose /compose/compose.yaml

# Copy the files to the server
export PODMAN_SERVER=ai-ai
scp -r active/container_bifrost/quadlets/. $PODMAN_SERVER:/home/ai/.config/containers/systemd/

Start and enable your systemd quadlet

SSH into your podman server as root:

systemctl --user daemon-reload
systemctl --user restart bifrost
journalctl --user -u bifrost -f
# Enable auto-update service which will pull new container images automatically every day
systemctl --user enable --now podman-auto-update.timer

Expose bifrost

  1. If you need a domain, follow the DDNS instructions
  2. For a web service, follow the Caddy instructions
  3. Finally, follow your OS's guide for opening ports via its firewall service.

Using bifrost

Adding Models

// qwen3.5-35b-a3b-thinking
{
    "temperature": 1,
    "top_p": 0.95,
    "presence_penalty": 1.5,
    "extra_body": {
        "top_k": 20,
        "min_p": 0,
        "repetition_penalty": 1,
        "chat_template_kwargs": {
            "enable_thinking": true
        }
    }
}

// qwen3.5-35b-a3b-coding
{
    "temperature": 0.6,
    "top_p": 0.95,
    "presence_penalty": 0,
    "extra_body": {
        "top_k": 20,
        "min_p": 0,
        "repetition_penalty": 1,
        "chat_template_kwargs": {
            "enable_thinking": true
        }
    }
}

// qwen3.5-35b-a3b-instruct
{
    "temperature": 0.7,
    "top_p": 0.8,
    "presence_penalty": 1.5,
    "extra_body": {
        "top_k": 20,
        "min_p": 0,
        "repetition_penalty": 1,
        "chat_template_kwargs": {
            "enable_thinking": false
        }
    }
}

Testing Models

# List models
curl -L -X GET 'https://aipi.reeseapps.com/v1/models' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234'

curl -L -X POST 'https://aipi.reeseapps.com/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-d '{
    "model": "gpt-4o-mini", # 👈 REPLACE with 'public model name' for any db-model
    "messages": [
        {
            "content": "Hey, how's it going",
            "role": "user"
        }
    ],
}'

Backup bifrost

Follow the Borg Backup instructions

Upgrade bifrost

Upgrade Quadlets

Upgrades should be a repeat of writing the compose spec and installing the quadlets

export PODMAN_SERVER=
scp -r quadlets/. $PODMAN_SERVER$:/home/bifrost/.config/containers/systemd/
ssh bifrost systemctl --user daemon-reload
ssh bifrost systemctl --user restart bifrost

Uninstall

# Stop the user's services
systemctl --user disable podman-restart
podman container stop --all
systemctl --user disable --now podman.socket
systemctl --user disable --now podman-auto-update.timer

# Delete the user (this won't delete their home directory)
# userdel might spit out an error like:
# userdel: user bifrost is currently used by process 591255
# kill those processes and try again
userdel bifrost

Notes

SELinux

https://blog.christophersmart.com/2021/01/31/podman-volumes-and-selinux/

:z allows a container to share a mounted volume with all other containers.

:Z allows a container to reserve a mounted volume and prevents any other container from accessing.