Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,33 @@

---

## Start in 5 minutes

SKaiNET is a Kotlin Multiplatform AI framework. New here? Choose the path that
matches what you want to try first.

| Goal | Start here | Time |
|---|---|---:|
| Run tensor operations | [Quickstart](#quickstart) (below) | 2–5 min |
| Build and train a neural net | [Hello Neural Net](#hello-neural-net) (below) | 5 min |
| Run a local GGUF model | [SKaiNET Transformers starter](https://github.com/SKaiNET-developers/SKaiNET-transformers#start-in-5-minutes) | 5 min after model setup |

Working in Java? SKaiNET ships first-class Java support — see the
[Java getting-started guide](docs/modules/ROOT/pages/tutorials/java-getting-started.adoc).

Use the version shown in this README as the source of truth for first-run snippets.
If another page shows a different version, please open an issue or PR.

---

## Quickstart

Add the core dependencies (Gradle Kotlin DSL):

```kotlin
dependencies {
// Recommended: import the umbrella BOM and drop versions on the engine modules.
implementation(platform("sk.ainet:skainet-bom:0.23.0"))
implementation(platform("sk.ainet:skainet-bom:0.23.1"))

implementation("sk.ainet.core:skainet-lang-core")
implementation("sk.ainet.core:skainet-backend-cpu")
Expand Down
29 changes: 27 additions & 2 deletions docs/modules/ROOT/pages/tutorials/java-getting-started.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
== Java Getting Started Guide

[NOTE]
====
This tutorial is one of the canonical SKaiNET *five-minute start paths*.
If you are choosing between the Tensor, Transformers, and Java entry points,
start from the repository
https://github.com/SKaiNET-developers/SKaiNET#start-in-5-minutes[README "Start in 5 minutes"]
section. The version shown there is the source of truth for first-run snippets.
====

[NOTE]
====
**Audience: Java consumers.** This page uses Java syntax and the
Expand Down Expand Up @@ -37,7 +46,7 @@ The `skainet-bom` manages all SKaiNET module versions so you never have to keep
----
<project>
<properties>
<skainet.version>0.22.2</skainet.version>
<skainet.version>0.23.1</skainet.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -135,7 +144,7 @@ repositories {

dependencies {
// Import BOM for version alignment
implementation(platform("sk.ainet:skainet-bom:0.22.2"))
implementation(platform("sk.ainet:skainet-bom:0.23.1"))

// Core tensor library
implementation("sk.ainet:skainet-lang-core-jvm")
Expand Down Expand Up @@ -211,6 +220,22 @@ mvn compile exec:java
./gradlew run
----

==== Success looks like this

A successful first run prints a `2 x 2` result shape and the activated tensor
values `58, 64, 139, 154` (the matmul of the two matrices above; all values are
positive, so ReLU leaves them unchanged):

....
matmul result shape: [2, 2]
after relu: [[58.0, 64.0], [139.0, 154.0]]
....

If you see this output, SKaiNET is installed correctly and you are ready to
move on to the next steps. If the run fails with a `module jdk.incubator.vector
not found` error, confirm the JVM flags from the
xref:tutorials/java-getting-started.adoc#_jvm_flags[JVM Flags] section are applied.

'''''

=== Key Entry Points
Expand Down
34 changes: 34 additions & 0 deletions scripts/check-doc-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Checks that the start-path docs reference the same SKaiNET version as the
# README. The README "Start in 5 minutes" / Quickstart block is the documented
# source of truth for first-run snippets.
set -euo pipefail

cd "$(dirname "$0")/.."

readme_version="$(grep -oE 'sk\.ainet:skainet-bom:[0-9]+\.[0-9]+\.[0-9]+' README.md \
| head -n1 | cut -d: -f3)"

if [[ -z "${readme_version}" ]]; then
echo "FAIL: could not find a skainet-bom version in README.md"
exit 1
fi

echo "README source-of-truth version: ${readme_version}"

status=0
check() {
local file="$1"
local found
found="$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' "${file}" | sort -u | tr '\n' ' ' || true)"
if grep -q "${readme_version}" "${file}"; then
echo "OK ${file}"
else
echo "FAIL ${file} does not reference ${readme_version} (found: ${found})"
status=1
fi
}

check docs/modules/ROOT/pages/tutorials/java-getting-started.adoc

exit "${status}"
Loading