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
9 changes: 0 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
5. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

#### What this PR does / why we need it

#### Which issue(s) this PR fixes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kube-workflow-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ on:

jobs:
init:
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes-init.yaml@v0.1.3
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes-init.yaml@main
secrets:
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/kube-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ on:

jobs:
event-handler:
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes.yaml@v0.1.3
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes.yaml@main
secrets:
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "puma"
version = "0.0.1"
edition = "2021"
description = "A lightweight, high-performance inference engine for heterogeneous devices."
description = "A lightweight, high-performance inference engine for local AI."
license = "Apache-2.0"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PUMA

Puma aims to be a lightweight, high-performance inference engine for heterogeneous devices. *Currently under active development.*
**PUMA** aims to be a lightweight, high-performance inference engine for local AI. Play for fun.

## How to Run

Expand Down
45 changes: 9 additions & 36 deletions src/cli/cmds.rs → src/cli/commands.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use clap::{Parser, Subcommand};
use prettytable::{format, row, Table};

use crate::downloader::ollama::OllamaDownloader;
use crate::util::file;

#[derive(Parser)]
#[command(name = "PUMA")]
#[command(about = "PUMA CLI")]
Expand All @@ -14,24 +11,22 @@ pub struct Cli {

#[derive(Subcommand)]
enum Commands {
/// List running inference services
/// List running models
PS,
/// List local models
LS,
/// Download a model from a model provider
PULL(PullArgs),
/// Create and run a new inference service from a model
/// Create and run a new model
RUN,
/// Stop one running inference service
/// Stop one running model
STOP,
/// Remove one model
RM,
/// Display system-wide information
INFO,
/// Return detailed information about inference service
/// Return detailed information about a model
INSPECT,
/// Return detailed information about model
SHOW,
/// Returns the version of PUMA.
VERSION,
}
Expand All @@ -47,7 +42,6 @@ struct PullArgs {
#[derive(Debug, Clone, clap::ValueEnum)]
pub enum Provider {
Huggingface,
Ollama,
Modelscope,
}

Expand All @@ -71,56 +65,39 @@ pub async fn run(cli: Cli) {
"Running",
"8m",
]);
table.add_row(row!["llama3-8b", "ollama", "llama3.1:8b", "Running", "2d",]);
table.add_row(row![
"llama3-70b",
"ollama",
"llama3.1:70b",
"Downloading",
"10s",
]);

table.printstd();
}

Commands::LS => {
let mut table = Table::new();
table.set_format(*format::consts::FORMAT_CLEAN);
table.add_row(row!["NAME", "PROVIDER", "REVISION", "SIZE", "CREATED"]);
table.add_row(row!["MODEl", "PROVIDER", "REVISION", "SIZE", "CREATED"]);
table.add_row(row![
"deepseek-ai/DeepSeek-R1",
"huggingface",
"main",
"2 weeks ago",
"800GB"
"80GB",
"2 weeks ago"
]);
table.add_row(row!["llama3.1", "ollama", "8b", "2 weeks ago", "4.9GB"]);
table.add_row(row!["llama3.1", "ollama", "70b", "2 weeks ago", "43GB"]);
table.add_row(row!["llama3.1", "ollama", "405b", "2 weeks ago", "243GB"]);
table.printstd();
}

Commands::PULL(args) => match args.provider {
Provider::Huggingface => {
println!("Downloading model from Huggingface...");
}
Provider::Ollama => {
let d = OllamaDownloader::new(&args.model);
let model_path = file::root_home().join(file::model_folder_name(&args.model));
file::create_folder_if_not_exists(&model_path).unwrap();
d.download_model(&model_path).await.unwrap();
}
Provider::Modelscope => {
println!("Downloading model from Modelscope...");
}
},

Commands::RUN => {
println!("Creating and running a new inference service from a model...");
println!("Creating and running a new model...");
}

Commands::STOP => {
println!("Stopping one running inference service...");
println!("Stopping one running model...");
}

Commands::RM => {
Expand All @@ -132,10 +109,6 @@ pub async fn run(cli: Cli) {
}

Commands::INSPECT => {
println!("Returning detailed information about inference service...");
}

Commands::SHOW => {
println!("Returning detailed information about model...");
}

Expand Down
2 changes: 1 addition & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod cmds;
pub mod commands;
1 change: 0 additions & 1 deletion src/downloader/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
mod downloader;
pub mod ollama;
159 changes: 0 additions & 159 deletions src/downloader/ollama.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use clap::Parser;
use env_logger;
use tokio::runtime::Builder;

use crate::cli::cmds::{run, Cli};
use crate::cli::commands::{run, Cli};
use crate::util::file;

fn main() {
env_logger::init();

// create the root folder.
// Create the root folder if it doesn't exist.
file::create_folder_if_not_exists(&file::root_home()).unwrap();

let runtime = Builder::new_multi_thread()
Expand Down
4 changes: 0 additions & 4 deletions src/util/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ pub fn create_folder_if_not_exists(folder_path: &PathBuf) -> std::io::Result<()>
Ok(())
}

pub fn model_folder_name(model_name: &str) -> String {
model_name.replace(":", "--").replace("/", "--")
}

pub fn root_home() -> PathBuf {
let home = home_dir().expect("Failed to get home directory");
home.join(".puma")
Expand Down
Loading