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
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
# user. Manual `cargo publish` to crates.io is a follow-up step
# (we don't auto-publish from CI to keep approvals explicit).
#
# Two artifact sets per platform:
# Artifact flavors:
# * `kimetsu-<version>-<target>-lean` — built with
# `--no-default-features`: NoopEmbedder + FTS-only retrieval.
# Smallest binary, no model download on install.
# * `kimetsu-<version>-<target>-embeddings` — default build.
# * `kimetsu-<version>-<target>-embeddings` — opt-in semantic build.
# Larger binary; fastembed-rs + ONNX runtime linked statically
# when possible.
# when possible. Not built for x86_64-apple-darwin because `ort`
# does not publish a prebuilt ONNX Runtime for that target.

name: release

Expand All @@ -42,16 +43,15 @@ jobs:
include:
# Linux
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, flavor: lean, extra_features: "--no-default-features" }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, flavor: embeddings, extra_features: "" }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, flavor: embeddings, extra_features: "--features embeddings" }
# macOS Intel
- { os: macos-15-intel, target: x86_64-apple-darwin, flavor: lean, extra_features: "--no-default-features" }
- { os: macos-15-intel, target: x86_64-apple-darwin, flavor: embeddings, extra_features: "" }
# macOS Apple Silicon
- { os: macos-14, target: aarch64-apple-darwin, flavor: lean, extra_features: "--no-default-features" }
- { os: macos-14, target: aarch64-apple-darwin, flavor: embeddings, extra_features: "" }
- { os: macos-14, target: aarch64-apple-darwin, flavor: embeddings, extra_features: "--features embeddings" }
# Windows
- { os: windows-latest, target: x86_64-pc-windows-msvc, flavor: lean, extra_features: "--no-default-features" }
- { os: windows-latest, target: x86_64-pc-windows-msvc, flavor: embeddings, extra_features: "" }
- { os: windows-latest, target: x86_64-pc-windows-msvc, flavor: embeddings, extra_features: "--features embeddings" }
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -255,8 +255,8 @@ jobs:
echo "" >> $GITHUB_STEP_SUMMARY
echo "Users can now install with:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "cargo install kimetsu-cli" >> $GITHUB_STEP_SUMMARY
echo "cargo install kimetsu-cli --no-default-features # lean build" >> $GITHUB_STEP_SUMMARY
echo "cargo install kimetsu-cli # lean build" >> $GITHUB_STEP_SUMMARY
echo "cargo install kimetsu-cli --features embeddings # semantic build where ort supports the target" >> $GITHUB_STEP_SUMMARY
echo "kimetsu update --check" >> $GITHUB_STEP_SUMMARY
echo "kimetsu uninstall --dry-run" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,24 @@ detection? See **[docs/HOW-KIMETSU-WORKS.md](docs/HOW-KIMETSU-WORKS.md)**.
Kimetsu is a single Rust binary. Pick your flavor:

```bash
# Default — semantic search enabled (fastembed + ONNX; first run downloads BGE-small)
# Default lean build — fast lexical (FTS) retrieval, no model download
cargo install kimetsu-cli

# Lean — fast lexical (FTS) retrieval, no model download
cargo install kimetsu-cli --no-default-features
# Semantic build — fastembed + ONNX; first run downloads BGE-small
cargo install kimetsu-cli --features embeddings

# From source
cargo install --path crates/kimetsu-cli # add --no-default-features for lean
cargo install --path crates/kimetsu-cli # add --features embeddings for semantic search
```

Prefer not to touch the Rust toolchain? Pre-built binaries for
**Linux / macOS / Windows** ship on every
[GitHub Release](https://github.com/RodCor/kimetsu/releases). Extract the archive and put
`kimetsu` / `kimetsu.exe` somewhere on `PATH` (`~/.local/bin`, `/usr/local/bin`,
or `%USERPROFILE%\.cargo\bin`). macOS prebuilt archives are published for both
Intel and Apple Silicon.
or `%USERPROFILE%\.cargo\bin`). Lean archives are published for Linux,
macOS Intel, macOS Apple Silicon, and Windows. Embeddings archives are
published where ONNX Runtime prebuilts are available: Linux x86_64,
macOS Apple Silicon, and Windows x86_64.

Confirm it's healthy:

Expand Down
6 changes: 4 additions & 2 deletions crates/kimetsu-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ categories = ["command-line-utilities", "development-tools"]
# Fan-out covers every kimetsu-* dep that kimetsu-cli actually
# imports (kimetsu-harbor-rs is NOT among them — that crate's
# binary is built separately by the release workflow).
# v0.7.1: embeddings on by default (requires VS2022 C++ runtime — ort prebuilts).
default = ["embeddings"]
# v0.7.3: keep the default install lean so `cargo install kimetsu-cli`
# works on every supported target. Embeddings remain available with
# `--features embeddings` on targets where `ort` ships prebuilts.
default = []
embeddings = [
"kimetsu-agent/embeddings",
"kimetsu-brain/embeddings",
Expand Down
28 changes: 27 additions & 1 deletion crates/kimetsu-cli/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,28 @@ fn select_asset<'a>(
}

fn default_flavor() -> &'static str {
if cfg!(feature = "embeddings") {
default_flavor_for(
env::consts::OS,
env::consts::ARCH,
cfg!(feature = "embeddings"),
)
}

fn default_flavor_for(os: &str, arch: &str, embeddings_enabled: bool) -> &'static str {
if embeddings_enabled && embeddings_assets_supported(os, arch) {
"embeddings"
} else {
"lean"
}
}

fn embeddings_assets_supported(os: &str, arch: &str) -> bool {
matches!(
(os, arch),
("linux", "x86_64") | ("macos", "aarch64") | ("windows", "x86_64")
)
}

fn release_target() -> Option<&'static str> {
match (env::consts::OS, env::consts::ARCH) {
("linux", "x86_64") => Some("x86_64-unknown-linux-gnu"),
Expand Down Expand Up @@ -752,4 +767,15 @@ mod tests {
"kimetsu-0.7.3-x86_64-pc-windows-msvc-embeddings.zip"
);
}

#[test]
fn auto_flavor_falls_back_to_lean_for_intel_macos() {
assert_eq!(
default_flavor_for("macos", "x86_64", true),
"lean",
"the release workflow does not publish x86_64 macOS embeddings assets"
);
assert_eq!(default_flavor_for("macos", "aarch64", true), "embeddings");
assert_eq!(default_flavor_for("linux", "x86_64", false), "lean");
}
}
Loading