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
Binary file added .DS_Store
Binary file not shown.
21 changes: 19 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master

- name: Install Rust toolchain
uses: dtolnay/[email protected]
with:
toolchain: 1.90.0
components: rustfmt, clippy

- name: Cache cargo
uses: actions/cache@v4
with:
Expand All @@ -37,3 +39,18 @@ jobs:

- name: Run check
run: just check

- name: Install ISO tooling
run: |
sudo apt-get update
sudo apt-get install -y xorriso

- name: Build installer ISO
run: ./scripts/make_iso.sh

- name: Upload installer ISO artifact
uses: actions/upload-artifact@v4
with:
name: tiles-installer-iso
path: dist/*.iso
if-no-files-found: error
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
.tiles_dev
dist/
119 changes: 117 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name = "tiles"
version = "0.1.0"
edition = "2024"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Invalid Rust edition specified.

edition = "2024" is not a valid Rust edition. Valid editions are 2015, 2018, and 2021. This will cause compilation errors.

Apply this diff to use the latest stable edition:

-edition = "2024"
+edition = "2021"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
edition = "2024"
edition = "2021"
🤖 Prompt for AI Agents
In Cargo.toml around line 4, the edition is set to "2024", which is invalid;
update the edition field to a supported Rust edition (use "2021" for the latest
stable) by replacing edition = "2024" with edition = "2021" so the project
compiles with a valid Rust edition.


[[bin]]
name = "Tiles"
path = "src/main.rs"

[dependencies]
clap = { version = "4.5.48", features = ["derive"] }
nom = "8"
Expand All @@ -11,3 +15,4 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
tokio = { version = "1" , features = ["macros", "rt-multi-thread"]}
chrono = "0.4"
122 changes: 122 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
# Tilekit
Modelfile-based SDK that lets developers to lets developers customize local models and agent experiences within [Tiles](https://www.tiles.run/).

## Quick Start

### Installation

Download and run the installer for your platform from the [releases page](https://github.com/tilesprivacy/tilekit/releases).

On macOS, double-click `Tiles.app` from the mounted ISO to start installation.

### Basic Usage

```bash
# Start a model (runs in background)
Tiles run memgpt

# List running models
Tiles ls

# Stop a model
Tiles stop memgpt

# View help
Tiles --help
```

### Recommended Setup

**For the best experience with Tiles, we recommend:**

- **[Tailscale](https://tailscale.com)** - Access your Tiles instance securely from anywhere, on any device
- **[Amphetamine](https://amphetamine.en.softonic.com/mac)** (macOS) - Keep your Mac awake when running models
- **[rsync](https://rsync.samba.org/)** - Sync your memory and data across devices

These tools ensure your models stay accessible, responsive, and synced 24/7.

## Dev setup

- Clone the repo
Expand All @@ -15,6 +49,94 @@ Modelfile-based SDK that lets developers to lets developers customize local mode
- Go to root and run `just serve` in another terminal to run the server
- Run the rust cli using cargo as usual

### Directory Structure

Tiles uses a single `~/.tiles/` directory for all data, making it portable and environment-agnostic:

```
~/.tiles/
├── registry/ # Model definitions
│ ├── memgpt/
│ │ └── Modelfile
│ └── other-model/
│ └── Modelfile
├── memory/ # AI memory storage
├── server/ # Python server (production only)
├── server.pid # Server process ID
└── models.json # Running models state
```

Models are organized in the `registry/` folder. Each model has its own folder with a `Modelfile` inside.

To run a model:
```bash
cargo run run memgpt # Runs the model defined in ~/.tiles/registry/memgpt/Modelfile
```

The folder name becomes the model name that you use with the CLI.

### Running Models

Models run in the background and persist after the CLI exits:

```bash
# Start a model (runs in background)
cargo run run memgpt # Dev
Tiles run memgpt # Production

# List running models
cargo run ls # Dev
Tiles ls # Production

# Stop a specific model
cargo run stop memgpt # Dev
Tiles stop memgpt # Production
```

**How it works:**
1. When you start a model with `Tiles run`, it loads into the server and runs in the background
2. The CLI exits immediately - your model keeps running
3. On macOS (production), Tiles Agent keeps a dock icon visible while models are active
4. Use `Tiles ls` anytime to see what's running
5. When you stop the last model, the server and agent shut down automatically

**Production Features (macOS):**
- Tiles Agent.app appears in dock while models are running
- Models persist even if you close Terminal
- Access via `Tiles` command from anywhere

When you stop the last running model, the server automatically stops as well.

### Server Management

**The server starts automatically** when you run a model and stops when no models are running.

**Manual server control (if needed):**
```bash
# Start server manually
cargo run start # Dev
tiles start # Production

# Stop server manually (only if no models running)
cargo run stop --server # Dev
tiles stop --server # Production
```

**Both development and production builds:**
- Use the same `~/.tiles/` directory structure (environment-agnostic)
- Server starts automatically on first model run
- Models run in background and persist after CLI exits
- Use `Tiles ls` to see running models
- Use `Tiles stop <model>` to stop individual models
- Server auto-starts and auto-stops based on running models

**Note:** Development builds use the local `server/` directory for the Python server, while production installs it to `~/.tiles/server/`.

### Packaging installers

- `just bundle` creates a tarball that includes the CLI binary and Python server.
- `just iso` wraps the bundle and installer script into an ISO that can be flashed with tools like Balena Etcher.

## License

This project is dual-licensed under MIT and Apache 2.0 terms:
Expand Down
Loading
Loading