A local-first private AI assistant for everyday use. Runs on-device models with encrypted P2P sync, and supports sharing chats publicly on ATProto.
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor refactoring (#46)

* refactor: renamed cli description

* fix: updated health check command

authored by

Anandu Pavanan and committed by
GitHub
0a62b970 5b48535d

+22 -25
+1 -1
Cargo.lock
··· 1521 1521 1522 1522 [[package]] 1523 1523 name = "tiles" 1524 - version = "0.3.0" 1524 + version = "0.3.1" 1525 1525 dependencies = [ 1526 1526 "anyhow", 1527 1527 "clap",
+2 -2
scripts/install.sh
··· 1 1 #!/usr/bin/env bash 2 2 set -euo pipefail 3 3 4 - ENV="dev" # prod is another env, try taking it from github env 4 + ENV="prod" # prod is another env, try taking it from github env 5 5 REPO="tilesprivacy/tiles" 6 6 # VERSION="${TILES_VERSION:-latest}" 7 - VERSION="0.3.0" 7 + VERSION="0.3.1" 8 8 INSTALL_DIR="$HOME/.local/bin" # CLI install location 9 9 SERVER_DIR="$HOME/.local/share/tiles/server" # Python server folder 10 10 TMPDIR="$(mktemp -d)"
+1 -1
tiles/Cargo.toml
··· 1 1 [package] 2 2 name = "tiles" 3 - version = "0.3.0" 3 + version = "0.3.1" 4 4 edition = "2024" 5 5 6 6 [dependencies]
+2 -2
tiles/src/commands/mod.rs
··· 20 20 } 21 21 } 22 22 } 23 - pub fn check_health() { 24 - health::check_health(); 23 + pub async fn check_health() { 24 + health::check_health().await; 25 25 } 26 26 27 27 pub async fn start_server(runtime: &Runtime) {
+9 -8
tiles/src/core/health.rs
··· 2 2 3 3 use std::{env, process::Command}; 4 4 5 - //TODO: In future we can install the dependencies if not there.. 6 - pub fn check_health() { 5 + use crate::runtime::mlx::ping; 6 + 7 + pub async fn check_health() { 7 8 let os = env::consts::OS; 8 9 println!("Running diagnosis..."); 9 10 check_python3(); 10 11 if os == "macos" { 11 - check_mlx_lm() 12 + check_server_status().await 12 13 } 13 14 } 14 15 ··· 25 26 println!("Python3: ❌ hint: Install Python3 for your OS") 26 27 } 27 28 } 28 - 29 - fn check_mlx_lm() { 30 - match Command::new("mlx_lm.chat").arg("--help").output() { 31 - Ok(_) => println!("mlx_lm: ✅"), 32 - _ => println!("mlx_lm: ❌ hint: run `pip install mlx-lm`"), 29 + async fn check_server_status() { 30 + if ping().await.is_ok() { 31 + println!("Model server is UP: ✅") 32 + } else { 33 + println!("Model server is DOWN: ❌, try `tiles server start`") 33 34 } 34 35 }
+2 -2
tiles/src/main.rs
··· 5 5 mod commands; 6 6 #[derive(Debug, Parser)] 7 7 #[command(name = "tiles")] 8 - #[command(version, about = "Run, fine-tune models locally with Modelfile", long_about = None)] 8 + #[command(version, about = "Your private AI assistant with offline memory.", long_about = None)] 9 9 struct Cli { 10 10 #[command(subcommand)] 11 11 command: Commands, ··· 88 88 commands::run(&runtime, run_args).await; 89 89 } 90 90 Commands::Health => { 91 - commands::check_health(); 91 + commands::check_health().await; 92 92 } 93 93 Commands::Server(server) => match server.command { 94 94 Some(ServerCommands::Start) => commands::start_server(&runtime).await,
+5 -9
tiles/src/runtime/mlx.rs
··· 59 59 } 60 60 }; 61 61 62 - let model = modelfile.from.as_ref().unwrap(); 63 - if model.starts_with("driaforall/mem-agent") { 64 - let _res = run_model_with_server(self, modelfile, &run_args) 65 - .await 66 - .inspect_err(|e| eprintln!("Failed to run the model due to {e}")); 67 - } else { 68 - run_model_by_sub_process(modelfile); 69 - } 62 + let _res = run_model_with_server(self, modelfile, &run_args) 63 + .await 64 + .inspect_err(|e| eprintln!("Failed to run the model due to {e}")); 70 65 } 71 66 72 67 #[allow(clippy::zombie_processes)] ··· 124 119 } 125 120 } 126 121 122 + #[allow(dead_code)] 127 123 fn run_model_by_sub_process(modelfile: Modelfile) { 128 124 // build the arg list from modelfile 129 125 let mut args: Vec<String> = vec![]; ··· 417 413 } 418 414 } 419 415 420 - async fn ping() -> Result<(), String> { 416 + pub async fn ping() -> Result<(), String> { 421 417 let client = Client::new(); 422 418 let res = client.get("http://127.0.0.1:6969/ping").send().await; 423 419