Skip to content

Commit 333b891

Browse files
Merge pull request #15 from kerthcet/feat/support-hf
remove ollama support
2 parents 89bde0b + 5639e0c commit 333b891

11 files changed

Lines changed: 16 additions & 216 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
<!-- Thanks for sending a pull request! Here are some tips for you:
2-
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
3-
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:
4-
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
5-
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
6-
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
7-
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
8-
-->
9-
101
#### What this PR does / why we need it
112

123
#### Which issue(s) this PR fixes

.github/workflows/kube-workflow-init.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ on:
55

66
jobs:
77
init:
8-
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes-init.yaml@v0.1.3
8+
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes-init.yaml@main
99
secrets:
1010
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}

.github/workflows/kube-workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ on:
1616

1717
jobs:
1818
event-handler:
19-
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes.yaml@v0.1.3
19+
uses: kerthcet/github-workflow-as-kube/.github/workflows/workflow-as-kubernetes.yaml@main
2020
secrets:
2121
AGENT_TOKEN: ${{ secrets.AGENT_TOKEN }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "puma"
33
version = "0.0.1"
44
edition = "2021"
5-
description = "A lightweight, high-performance inference engine for heterogeneous devices."
5+
description = "A lightweight, high-performance inference engine for local AI."
66
license = "Apache-2.0"
77

88
[dependencies]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PUMA
22

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

55
## How to Run
66

src/cli/cmds.rs renamed to src/cli/commands.rs

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
use clap::{Parser, Subcommand};
22
use prettytable::{format, row, Table};
33

4-
use crate::downloader::ollama::OllamaDownloader;
5-
use crate::util::file;
6-
74
#[derive(Parser)]
85
#[command(name = "PUMA")]
96
#[command(about = "PUMA CLI")]
@@ -14,24 +11,22 @@ pub struct Cli {
1411

1512
#[derive(Subcommand)]
1613
enum Commands {
17-
/// List running inference services
14+
/// List running models
1815
PS,
1916
/// List local models
2017
LS,
2118
/// Download a model from a model provider
2219
PULL(PullArgs),
23-
/// Create and run a new inference service from a model
20+
/// Create and run a new model
2421
RUN,
25-
/// Stop one running inference service
22+
/// Stop one running model
2623
STOP,
2724
/// Remove one model
2825
RM,
2926
/// Display system-wide information
3027
INFO,
31-
/// Return detailed information about inference service
28+
/// Return detailed information about a model
3229
INSPECT,
33-
/// Return detailed information about model
34-
SHOW,
3530
/// Returns the version of PUMA.
3631
VERSION,
3732
}
@@ -47,7 +42,6 @@ struct PullArgs {
4742
#[derive(Debug, Clone, clap::ValueEnum)]
4843
pub enum Provider {
4944
Huggingface,
50-
Ollama,
5145
Modelscope,
5246
}
5347

@@ -71,56 +65,39 @@ pub async fn run(cli: Cli) {
7165
"Running",
7266
"8m",
7367
]);
74-
table.add_row(row!["llama3-8b", "ollama", "llama3.1:8b", "Running", "2d",]);
75-
table.add_row(row![
76-
"llama3-70b",
77-
"ollama",
78-
"llama3.1:70b",
79-
"Downloading",
80-
"10s",
81-
]);
8268

8369
table.printstd();
8470
}
8571

8672
Commands::LS => {
8773
let mut table = Table::new();
8874
table.set_format(*format::consts::FORMAT_CLEAN);
89-
table.add_row(row!["NAME", "PROVIDER", "REVISION", "SIZE", "CREATED"]);
75+
table.add_row(row!["MODEl", "PROVIDER", "REVISION", "SIZE", "CREATED"]);
9076
table.add_row(row![
9177
"deepseek-ai/DeepSeek-R1",
9278
"huggingface",
9379
"main",
94-
"2 weeks ago",
95-
"800GB"
80+
"80GB",
81+
"2 weeks ago"
9682
]);
97-
table.add_row(row!["llama3.1", "ollama", "8b", "2 weeks ago", "4.9GB"]);
98-
table.add_row(row!["llama3.1", "ollama", "70b", "2 weeks ago", "43GB"]);
99-
table.add_row(row!["llama3.1", "ollama", "405b", "2 weeks ago", "243GB"]);
10083
table.printstd();
10184
}
10285

10386
Commands::PULL(args) => match args.provider {
10487
Provider::Huggingface => {
10588
println!("Downloading model from Huggingface...");
10689
}
107-
Provider::Ollama => {
108-
let d = OllamaDownloader::new(&args.model);
109-
let model_path = file::root_home().join(file::model_folder_name(&args.model));
110-
file::create_folder_if_not_exists(&model_path).unwrap();
111-
d.download_model(&model_path).await.unwrap();
112-
}
11390
Provider::Modelscope => {
11491
println!("Downloading model from Modelscope...");
11592
}
11693
},
11794

11895
Commands::RUN => {
119-
println!("Creating and running a new inference service from a model...");
96+
println!("Creating and running a new model...");
12097
}
12198

12299
Commands::STOP => {
123-
println!("Stopping one running inference service...");
100+
println!("Stopping one running model...");
124101
}
125102

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

134111
Commands::INSPECT => {
135-
println!("Returning detailed information about inference service...");
136-
}
137-
138-
Commands::SHOW => {
139112
println!("Returning detailed information about model...");
140113
}
141114

src/cli/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub mod cmds;
1+
pub mod commands;

src/downloader/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
mod downloader;
2-
pub mod ollama;

src/downloader/ollama.rs

Lines changed: 0 additions & 159 deletions
This file was deleted.

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use clap::Parser;
66
use env_logger;
77
use tokio::runtime::Builder;
88

9-
use crate::cli::cmds::{run, Cli};
9+
use crate::cli::commands::{run, Cli};
1010
use crate::util::file;
1111

1212
fn main() {
1313
env_logger::init();
1414

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

1818
let runtime = Builder::new_multi_thread()

0 commit comments

Comments
 (0)