-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aisuko <[email protected]>
- Loading branch information
Showing
5 changed files
with
89 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug executable 'lupinIII'", | ||
"cargo": { | ||
"args": [ | ||
"build", | ||
"--bin=lupinIII", | ||
"--package=lupinIII" | ||
], | ||
"filter": { | ||
"name": "lupinIII", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "lldb", | ||
"request": "launch", | ||
"name": "Debug unit tests in executable 'lupinIII'", | ||
"cargo": { | ||
"args": [ | ||
"test", | ||
"--no-run", | ||
"--bin=lupinIII", | ||
"--package=lupinIII" | ||
], | ||
"filter": { | ||
"name": "lupinIII", | ||
"kind": "bin" | ||
} | ||
}, | ||
"args": [], | ||
"cwd": "${workspaceFolder}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# lupin | ||
inference engine on GPUs | ||
|
||
Inference API aggregator for performance requirements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
use axum::{response::Html, routing::get, Router}; | ||
// coding=utf-8 | ||
|
||
// Copyright [2024] [SkywardAI] | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
|
||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
pub mod routing; | ||
|
||
use routing::routers::create_router; | ||
|
||
|
||
#[tokio::main] | ||
async fn main() { | ||
// single router | ||
let app = Router::new().route("/", get(handler)); | ||
|
||
let listener = tokio::net::TcpListener::bind("127.0.0.1:8000") | ||
.await | ||
.unwrap(); | ||
let app = create_router(); | ||
|
||
let listener = tokio::net::TcpListener::bind("0.0.0.0:8000").await.unwrap(); | ||
|
||
println!("Listening on: {}", listener.local_addr().unwrap()); | ||
|
||
axum::serve(listener, app).await.unwrap(); | ||
} | ||
|
||
async fn handler() -> Html<&'static str> { | ||
Html("<h1>Hello, World!</h1>") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod routers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// routers.rs | ||
use axum::{response::Html, routing::get, Router}; | ||
|
||
pub fn create_router() -> Router { | ||
let inference = Router::new() | ||
.route("/", get(inference)); | ||
|
||
Router::new() | ||
.route("/", get(handler)) | ||
.nest("/inference", inference) | ||
} | ||
|
||
async fn handler() -> Html<&'static str> { | ||
Html("<h1>Welcome!</h1>") | ||
} | ||
|
||
async fn inference() -> Html<&'static str> { | ||
Html("<h1>Inference!</h1>") | ||
} |