Skip to content

Commit 4279a0a

Browse files
committed
Migrate separate onnx, gguf tool to one cli tool
1 parent eaac442 commit 4279a0a

41 files changed

Lines changed: 277 additions & 41154 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 98 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,96 @@
11
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENCE)
2-
[![Maven Central](https://img.shields.io/maven-central/v/sk.ainet.core/skainet-lang-core.svg)](https://central.sonatype.com/artifact/sk.ainet.core/skainet-lang-core)
2+
[![Maven Central](https://img.shields.io/maven-central/v/sk.ainet.core/SKaiNET-lang-core.svg)](https://central.sonatype.com/artifact/sk.ainet.core/skainet-lang-core)
33

4-
# SKaiNET
4+
<img src="docs//SKaiNET-logo.png" alt="SKaiNET logo" width="150">
55

66
**SKaiNET** is an open-source deep learning framework written in Kotlin Multiplatform, designed with developers in mind to enable the creation modern AI powered applications with ease.
77

8+
## Key features at a glance
9+
10+
### SKaiNET is Data
11+
12+
- Data loaders (MNIST, JSON datasets, image helpers)
13+
- Type‑safe tensors across JVM/JS/Native
14+
15+
```kotlin
16+
// data loaders
17+
val ds = MNIST.load(train = true)
18+
val (x, y) = ds.nextBatch(64)
19+
20+
// Type-safe tensor creation via tensor DSL
21+
val ctx = DefaultNeuralNetworkExecutionContext()
22+
val mask = data<FP32, Float>(ctx) {
23+
tensor{
24+
shape(3, 3) {
25+
from(
26+
1f, 0f, 0f,
27+
1f, 1f, 0f,
28+
1f, 1f, 1f,
29+
)
30+
}
31+
}
32+
}
33+
34+
val t = tensor<FP32, Float>(ctx, FP32::class) {
35+
tensor {
36+
shape(2, 3) {
37+
from(
38+
0f, 1f, 2f,
39+
10f, 11f, 12f
40+
)
41+
}
42+
}
43+
}
44+
println("shape=${t.shape} first=${t.data[0,0]}")
45+
```
46+
47+
### SKaiNET is Language
48+
49+
- Kotlin DSLs for Data, Neural Nets, and Pipelines
50+
51+
```kotlin
52+
// Neural network DSL
53+
val model = nn {
54+
input(28 * 28)
55+
dense(out = 128)
56+
relu()
57+
dense(out = 10)
58+
}
59+
```
60+
61+
### SKaiNET is Tools
62+
63+
- Kotlin Notebook support Explorer and Notebook-friendly APIs
64+
65+
```kotlin
66+
// Works smoothly in Kotlin Notebooks
67+
display(model.summary())
68+
println(ds.describe())
69+
```
70+
71+
### SKaiNET is Compiler
72+
73+
- MLIR/StableHLO based lowering (modules provided in `SKaiNET-compile-*`)
74+
75+
```kotlin
76+
// Illustrative: export graph to JSON/StableHLO IR
77+
val ir = Compile.toStableHlo(model)
78+
println(ir.pretty())
79+
```
80+
81+
### SKaiNET is for Developers
82+
83+
- Clean APIs, growing docs, Maven Central artifacts
84+
- Get productive in minutes with minimal deps
85+
86+
```kotlin
87+
dependencies {
88+
implementation("sk.ainet.core:SKaiNET-lang-core:0.5.0")
89+
implementation("sk.ainet.core:SKaiNET-backend-cpu:0.5.0")
90+
}
91+
// Ready to build & run in ~8 minutes
92+
```
93+
894
## Use it
995

1096
- From Kotlin code in apps, libraries, CLIs
@@ -26,15 +112,15 @@ dependencyResolutionManagement {
26112

27113
dependencies {
28114
// minimal dependency with simple CPU backend
29-
implementation("sk.ainet.core:skainet-lang-core:0.5.0")
30-
implementation("sk.ainet.core:skainet-backend-cpu:0.5.0")
115+
implementation("sk.ainet.core:SKaiNET-lang-core:0.5.0")
116+
implementation("sk.ainet.core:SKaiNET-backend-cpu:0.5.0")
31117

32118
// simple model zoo
33-
implementation("sk.ainet.core:skainet-lang-models:0.5.0")
119+
implementation("sk.ainet.core:SKaiNET-lang-models:0.5.0")
34120

35121
// Optional I/O (e.g., GGUF loader, JSON)
36-
implementation("sk.ainet.core:skainet-io-core:0.5.0")
37-
implementation("sk.ainet.core:skainet-io-gguf:0.5.0")
122+
implementation("sk.ainet.core:SKaiNET-io-core:0.5.0")
123+
implementation("sk.ainet.core:SKaiNET-io-gguf:0.5.0")
38124
}
39125
```
40126

@@ -43,15 +129,15 @@ Maven:
43129
```xml
44130
<dependency>
45131
<groupId>sk.ainet.core</groupId>
46-
<artifactId>skainet-lang-core</artifactId>
132+
<artifactId>SKaiNET-lang-core</artifactId>
47133
<version>0.5.0</version>
48134
</dependency>
49135
```
50136

51137
## Samples and notebooks
52138

53-
- Sample app: https://github.com/sk-ai-net/skainet-samples/tree/feature/MNIST/SinusApproximator
54-
- Kotlin Notebook: https://github.com/sk-ai-net/skainet-notebook
139+
- Sample app: https://github.com/sk-ai-net/SKaiNET-samples/tree/feature/MNIST/SinusApproximator
140+
- Kotlin Notebook: https://github.com/sk-ai-net/SKaiNET-notebook
55141

56142
## Architecture
57143

@@ -141,8 +227,8 @@ Notes and limitations:
141227
- You can customize initializers for the mixing weights, basis, and bias via the DSL block.
142228

143229
See source for details:
144-
- skainet-lang/skainet-kan/src/commonMain/kotlin/sk/ainet/lang/kan/KanDsl.kt
145-
- skainet-lang/skainet-kan/src/commonMain/kotlin/sk/ainet/lang/kan/KanLayer.kt
230+
- SKaiNET-lang/SKaiNET-kan/src/commonMain/kotlin/sk/ainet/lang/kan/KanDsl.kt
231+
- SKaiNET-lang/SKaiNET-kan/src/commonMain/kotlin/sk/ainet/lang/kan/KanLayer.kt
146232

147233
## License
148234

docs/SKaiNET-logo.png

266 KB
Loading

settings.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,4 @@ include("skainet-models:skainet-model-yolo")
5858

5959
// ====== APPS
6060
//include("skainet-apps:skainet-KGPChat")
61-
include("skainet-apps:skainet-onnx-tools")
62-
include("skainet-apps:skainet-onnx-detect")
61+
include("skainet-apps:skainet-tensor-tools")

skainet-apps/skainet-KGPChat/build.gradle.kts

Lines changed: 0 additions & 122 deletions
This file was deleted.

skainet-apps/skainet-KGPChat/src/commonMain/kotlin/sk/ainet/apps/knanogpt/CharTokenizer.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

skainet-apps/skainet-KGPChat/src/commonMain/kotlin/sk/ainet/apps/knanogpt/Tokenizer.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

skainet-apps/skainet-KGPChat/src/commonMain/kotlin/sk/ainet/apps/knanogpt/data/BatchProvider.kt

Lines changed: 0 additions & 43 deletions
This file was deleted.

skainet-apps/skainet-KGPChat/src/commonMain/kotlin/sk/ainet/apps/knanogpt/data/DataProvider.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.

skainet-apps/skainet-KGPChat/src/commonMain/kotlin/sk/ainet/apps/knanogpt/data/ResourcesDataProvider.kt

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)