# Open WebUI OCI

Open WebUI is an extensible, self-hosted AI interface that adapts to your workflow, all while operating entirely offline.

View the [*synix* NixOS module on Forgejo](https://git.sid.ovh/sid/synix/tree/master/modules/nixos/open-webui-oci).

## References

- [Homepage](https://openwebui.com/)
- [GitHub](https://github.com/open-webui/open-webui)
- [Environment Configuration](https://docs.openwebui.com/getting-started/env-configuration/)
- [Nixpkgs Docker tools](https://github.com/NixOS/nixpkgs/blob/master/doc/build-helpers/images/dockertools.section.md)

## Configuration

```nix
{
  imports = [ inputs.synix.nixosModules.open-webui-oci ];

  services.open-webui-oci.enable = true;

  # You can provide an image to use:
  services.open-webui-oci.image = pkgs.dockerTools.pullImage {
    imageName = "ghcr.io/open-webui/open-webui";
    imageDigest = "sha256:2deb90b0423473d8f97febced2e62b8fd898aa3eb61877bb3aa336370214c258";
    hash = "sha256-2cdKfvZGUyPUm7TFXcf5OcG9ey4BvOZPUOVim1S2C+s=";
    finalImageName = "ghcr.io/open-webui/open-webui";
    finalImageTag = "0.8.5";
  };
}
```

You can use `nix-prefetch-docker` to get the attribute set to pass to `dockerTools.pullImage`:

```bash
nix run nixpkgs#nix-prefetch-docker -- --image-name ghcr.io/open-webui/open-webui --arch amd64 --os linux --image-tag 0.8.5
```

## Usage

Visit the web interface at your specified location to create an admin account.

> The default location is `http://127.0.0.1:8080`.

## Troubleshooting

### JSON parse error

If you get this error in the web interface:

```
SyntaxError: Unexpected token 'd', "data: {"id"... is not valid JSON category
```

Clear your browser cache. Steps on Chromium based browsers:

1. Open DevTools (F12) → Right-click refresh button
1. Click "Empty Cache and Hard Reload"
