Skip to content
Open
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
16 changes: 9 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[workspace]
members = [
"crates/slai",
# "crates/slai-bench",
# "crates/slai-bench",
"crates/slai-chat",
"crates/slai-chat"
]
resolver = "2"

Expand All @@ -19,7 +18,7 @@ encase = { version = "0.11.0", features = ["nalgebra"] }

[workspace.lints]
rust.unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("dim2", "dim3"))'
'cfg(feature, values("dim2", "dim3"))',
] }

[profile.release]
Expand All @@ -36,7 +35,10 @@ inherits = "dev"
inherits = "dev"

[patch.crates-io]
#slang-hal-derive = { path = "../slang-hal/crates/slang-hal-derive" }
#slang-hal = { path = "../slang-hal/crates/slang-hal" }
#minislang = { path = "../slang-hal/crates/minislang" }
#stensor = { path = "../stensor" }
# slang-hal-derive = { path = "../slang-hal/crates/slang-hal-derive" }
# slang-hal = { path = "../slang-hal/crates/slang-hal" }
# minislang = { path = "../slang-hal/crates/minislang" }
# stensor = { path = "../stensor" }
slang-hal-derive = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" }
slang-hal = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" }
minislang = { git = "https://github.com/vrixyz/slang-hal.git", branch = "static_build" }
7 changes: 3 additions & 4 deletions crates/slai-chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ default = ["web"]
web = ["dioxus/web"]
desktop = ["dioxus/desktop"]
mobile = ["dioxus/mobile"]
cuda = [ "slai/cuda" ]
comptime_checks = [ "slai/comptime_checks" ]
cuda = ["slai/cuda"]
comptime_checks = ["slai/comptime_checks"]

[dependencies]
slang-hal = "0.1"
slai = { version = "0.1", path = "../slai" }
slai = { version = "0.1", path = "../slai" }

nalgebra = "0.34"
async-channel = "2"
Expand Down Expand Up @@ -54,4 +54,3 @@ colored = "3.0.0"
# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"

10 changes: 9 additions & 1 deletion crates/slai-chat/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# slai-chat

This is a basic chat interface for testing **slai**. Currently only supports:

- Models of the Llama family.
- Qwen 2.
- Segment Anything.

In order to compile and run `slai-chat`, be sure to define the `SLANG_DIR` environment variable:
1. Download the Slang compiler libraries for your platform: https://github.com/shader-slang/slang/releases/tag/v2025.16

1. Download the Slang compiler libraries for your platform: <https://github.com/shader-slang/slang/releases/tag/v2025.16>
2. Unzip the downloaded directory, and use its path as value to the `SLANG_DIR` environment variable: `SLANG_DIR=/path/to/slang`.
Note that the variable must point to the root of the slang installation (i.e. the directory that contains `bin` and `lib`).

1 more environment variables is needed because we link statically slang and its dependencies:

1. `SLANG_EXTERNAL_DIR`: typically set to '[<slang_source_directory>](https://github.com/shader-slang/slang)/build/external'

To run the GUI natively:

```bash
dx run --release --features desktop
```

To run the CLI version natively (the CLI doesn’t support segment-anything currently):

```bash
cargo run --release --features desktop -- --headless --inspect '/path/to/model.gguf'
```
Loading