Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs: add a Zensical documentation site with a GitHub Pages deploy (#266)

Maxfield Allison1a36d392ee46
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 00000000..defb723e
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,58 @@
+name: Docs
+
+# Builds the documentation site from docs/ and publishes it to GitHub Pages.
+# Enable Pages before deploying: Settings -> Pages -> Source: GitHub Actions.
+
+on:
+ pull_request:
+ paths: [docs/**, zensical.toml, requirements-docs.txt, .github/workflows/docs.yml]
+ push:
+ branches: [main]
+ paths: [docs/**, zensical.toml, requirements-docs.txt, .github/workflows/docs.yml]
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+# Cancel outdated pull request builds; let an active deploy on main finish.
+concurrency:
+ group: docs-${{ github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+jobs:
+ build:
+ name: docs (strict build)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+ cache: pip
+ cache-dependency-path: requirements-docs.txt
+ - run: pip install -r requirements-docs.txt
+
+ # --strict fails on every warning, including links the site cannot resolve.
+ # Use absolute GitHub URLs for files outside docs/ so links work when pages in docs/
+ # are read on GitHub or on the site.
+ - run: zensical build --strict
+
+ - uses: actions/upload-pages-artifact@v5
+ if: github.event_name != 'pull_request'
+ with:
+ path: site
+
+ deploy:
+ name: docs (deploy)
+ needs: build
+ if: github.event_name != 'pull_request'
+ runs-on: ubuntu-latest
+ permissions:
+ pages: write
+ id-token: write
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ steps:
+ - id: deployment
+ uses: actions/deploy-pages@v5
diff --git a/.gitignore b/.gitignore
index 79806eb9..941841d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,3 +66,6 @@ credentials.json
# terminal transcripts dumped by the CLI (they quote whatever was pasted, including tokens)
[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-*-local-command-*.txt
*-local-command-*.txt
+
+# Documentation site build output (zensical build)
+site/
diff --git a/docs/docker.md b/docs/docker.md
index 48622078..bc672e79 100644
--- a/docs/docker.md
+++ b/docs/docker.md
@@ -10,14 +10,14 @@ From the repository root:
docker compose run --build --rm laya
```
-This builds the checkout, runs the [sample request](../examples/docker/request.json)
+This builds the checkout, runs the [sample request](https://github.com/NandhaKishorM/laya/blob/main/examples/docker/request.json)
on CPU and prints JSON covering `choice`, `score` and `noul`. The first request
downloads the selected public Hugging Face checkpoint; no account is needed.
Allow several minutes for its first download.
Weights stay in a named volume. Subsequent runs use `docker compose run --rm laya`.
Predictions and confidence still need evaluation on your workload. See the
-[benchmark limits](../BENCHMARKS.md).
+[benchmark limits](https://github.com/NandhaKishorM/laya/blob/main/BENCHMARKS.md).
For ARM64 hosts, DGX Spark and Apple Silicon, see
[ARM64 and DGX Spark containers](docker-platforms.md).
@@ -98,7 +98,7 @@ docker compose run --rm --volume "$PWD/request.json:/inputs/request.json:ro" \
```
For a commented configuration with request, checkpoint and secret-file mounts,
-see [`compose.example.yml`](../compose.example.yml):
+see [`compose.example.yml`](https://github.com/NandhaKishorM/laya/blob/main/compose.example.yml):
```bash
docker compose -f compose.yaml -f compose.example.yml run --build --rm laya
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 00000000..e8636b8e
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,14 @@
+# Laya
+
+Multilingual, non-autoregressive System 1 decision engine: typed `choice`, `score` and `noul`
+decisions over any state, in a single forward pass.
+
+The [README](https://github.com/NandhaKishorM/laya#readme) is the main guide. It covers
+installation, the `Router` quickstart, the HTTP server, calibration, benchmarks and known limits.
+These guides cover individual topics:
+
+- [Docker quickstart](docker.md): run the SDK in a container, on CPU or an NVIDIA GPU.
+- [LangChain & LangGraph](langchain.md): Laya as router, guardrail, triage and evaluator
+ components, in process or over HTTP.
+- [Fine-tuning example: browser agent](finetune_browser_agent.md): specialising Laya as the
+ decision head of a browser agent, end to end.
diff --git a/requirements-docs.txt b/requirements-docs.txt
new file mode 100644
index 00000000..7edf5a0d
--- /dev/null
+++ b/requirements-docs.txt
@@ -0,0 +1,2 @@
+# Documentation build only; not a runtime dependency of the laya package.
+zensical==0.0.64
diff --git a/zensical.toml b/zensical.toml
new file mode 100644
index 00000000..300dff85
--- /dev/null
+++ b/zensical.toml
@@ -0,0 +1,38 @@
+# Documentation site, built with Zensical (https://zensical.org). Preview locally:
+# pip install -r requirements-docs.txt && zensical serve
+
+[project]
+site_name = "Laya"
+site_description = "Multilingual, non-autoregressive System 1 decision engine"
+site_url = "https://nandhakishorm.github.io/laya/"
+repo_url = "https://github.com/NandhaKishorM/laya"
+repo_name = "NandhaKishorM/laya"
+edit_uri = "edit/main/docs/"
+copyright = "Apache 2.0. Developed by Convai Innovations."
+nav = [
+ { "Home" = "index.md" },
+ { "Docker quickstart" = "docker.md" },
+ { "LangChain & LangGraph" = "langchain.md" },
+ { "Fine-tuning example: browser agent" = "finetune_browser_agent.md" },
+]
+
+[project.theme]
+# Reuse the README logo to avoid maintaining a second copy.
+logo = "https://raw.githubusercontent.com/NandhaKishorM/laya/main/assets/logo-mark.svg"
+favicon = "https://raw.githubusercontent.com/NandhaKishorM/laya/main/assets/logo-mark.svg"
+features = [
+ "content.code.copy",
+ "navigation.footer",
+]
+
+[[project.theme.palette]]
+media = "(prefers-color-scheme: light)"
+scheme = "default"
+toggle.icon = "lucide/sun"
+toggle.name = "Switch to dark mode"
+
+[[project.theme.palette]]
+media = "(prefers-color-scheme: dark)"
+scheme = "slate"
+toggle.icon = "lucide/moon"
+toggle.name = "Switch to light mode"