diff --git a/Makefile.toml b/Makefile.toml index ed5f760..d94ab39 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -56,10 +56,15 @@ args = ["leptos", "watch", "--hot-reload"] [tasks.docset] workspace = false -script = ''' -cargo docset --workspace --platform-family redvault-ai \ - && cp -r target/docset/redvault-ai.docset ~/.local/share/Zeal/Zeal/docsets/ -''' +dependencies = ["make-docset", "cp-docset"] + +[tasks.make-docset] +workspace = false +script = "cargo docset --workspace --platform-family redvault-ai " + +[tasks.cp-docset] +workspace = false +script = "cp -r target/docset/redvault-ai.docset ~/.local/share/Zeal/Zeal/docsets/" [tasks.watch-test] command = "cargo" diff --git a/llama_forge_rs/src/app/mod.rs b/llama_forge_rs/src/app/mod.rs index 8ed0adb..6287b0c 100644 --- a/llama_forge_rs/src/app/mod.rs +++ b/llama_forge_rs/src/app/mod.rs @@ -27,22 +27,22 @@ pub fn App() -> impl IntoView { provide_context(Arc::new(span)); view! { - + // sets the document title - + <Title text="LLama Forge RS" /> <Router fallback=|| { let mut outside_errors = Errors::default(); outside_errors.insert_with_default_key(AppError::NotFound); - view! { <ErrorTemplate outside_errors/> }.into_view() + view! { <ErrorTemplate outside_errors /> }.into_view() }> <main> <Routes> <Route path="" view=MainPage> - <Route path="/chat" view=ChatPage/> - // TODO make settings page for proxy-man - // <SettingsRoutes/> + <Route path="/chat" view=ChatPage /> + // TODO make settings page for proxy-man + // <SettingsRoutes/> </Route> </Routes> </main> diff --git a/llama_forge_rs/src/app/pages/chat.rs b/llama_forge_rs/src/app/pages/chat.rs index 1ebd5b4..4bfe255 100644 --- a/llama_forge_rs/src/app/pages/chat.rs +++ b/llama_forge_rs/src/app/pages/chat.rs @@ -49,14 +49,9 @@ fn ChatMessageBubble( let inner_p = move || { if edit_mode.get() { - view! { - - <p inner_html=move || { msg_str() }></p> - } + view! { <p inner_html=move || { msg_str() }></p> } } else { - view! { - <p inner_html=move || { md_str() }></p> - } + view! { <p inner_html=move || { md_str() }></p> } } }; @@ -96,7 +91,7 @@ fn ChatMessageBubble( on:click=exit_edit_mode class="absolute top-2 right-2 btn btn-xs btn-ghost btn-circle" > - <CheckmarkSvg/> + <CheckmarkSvg /> </button> } .into_view() @@ -106,7 +101,7 @@ fn ChatMessageBubble( on:click=enter_edit_mode class="absolute top-2 right-2 btn btn-xs btn-ghost btn-circle" > - <PencilSvg/> + <PencilSvg /> </button> } .into_view() @@ -120,7 +115,7 @@ fn ChatMessageBubble( on:click=move |_e| trash_message() class="absolute right-2 bottom-2 btn btn-xs btn-ghost btn-circle" > - <TrashSvg/> + <TrashSvg /> </button> } .into_view() @@ -182,7 +177,7 @@ pub fn ChatHistory( } children=move |msg| { - view! { <ChatMessageBubble msg history/> } + view! { <ChatMessageBubble msg history /> } } /> @@ -306,7 +301,7 @@ fn ChatPrompt( } > - <SendSvg/> + <SendSvg /> </button> <button on:click=refresh_last_message @@ -317,7 +312,7 @@ fn ChatPrompt( } > - <RefreshSvg/> + <RefreshSvg /> </button> </div> } @@ -337,8 +332,8 @@ pub fn ChatPage() -> impl IntoView { view! { <Card> <div class="flex flex-col justify-between h-full"> - <ChatHistory receiving_response history response/> - <ChatPrompt receiving_response history response/> + <ChatHistory receiving_response history response /> + <ChatPrompt receiving_response history response /> </div> </Card> } diff --git a/llama_forge_rs/src/app/pages/main.rs b/llama_forge_rs/src/app/pages/main.rs index 846c6ca..1ac2904 100644 --- a/llama_forge_rs/src/app/pages/main.rs +++ b/llama_forge_rs/src/app/pages/main.rs @@ -11,7 +11,7 @@ fn Navbar() -> impl IntoView { <div class="navbar-start"> <div class="dropdown"> <div tabindex="0" role="button" class="btn btn-ghost btn-circle"> - <HamburgerSvg/> + <HamburgerSvg /> </div> <ul tabindex="0" @@ -32,7 +32,7 @@ fn Navbar() -> impl IntoView { <div class="navbar-end"> <button class="btn btn-ghost btn-circle"> - <img class="w-12 h-12" src="/logo.svg"/> + <img class="w-12 h-12" src="/logo.svg" /> </button> </div> </div> @@ -54,7 +54,7 @@ fn Footer() -> impl IntoView { pub fn Main(children: Children) -> impl IntoView { view! { <div class="flex flex-col w-screen h-screen"> - <Navbar/> + <Navbar /> <div class="grid place-items-center p-4 grow">{children()}</div> // <Footer/> </div> @@ -65,7 +65,7 @@ pub fn Main(children: Children) -> impl IntoView { pub fn MainPage() -> impl IntoView { view! { <Main> - <Outlet/> + <Outlet /> </Main> } } diff --git a/llama_forge_rs/src/app/pages/settings/backend.rs b/llama_forge_rs/src/app/pages/settings/backend.rs index 1552fd7..c7aac1a 100644 --- a/llama_forge_rs/src/app/pages/settings/backend.rs +++ b/llama_forge_rs/src/app/pages/settings/backend.rs @@ -131,7 +131,7 @@ pub fn SettingsForm() -> impl IntoView { </FormControl> <div class="w-full form-control"> <button class="btn btn-primary" type="submit"> - <SaveSvg/> + <SaveSvg /> </button> </div> </ActionForm> diff --git a/llama_forge_rs/src/app/pages/settings/mod.rs b/llama_forge_rs/src/app/pages/settings/mod.rs index c194a49..a023620 100644 --- a/llama_forge_rs/src/app/pages/settings/mod.rs +++ b/llama_forge_rs/src/app/pages/settings/mod.rs @@ -33,10 +33,10 @@ fn BackendSettingsPage() -> impl IntoView { view! { <div class="flex justify-around"> <div class="flex flex-col p-4 w-1/3"> - <ProcessForm/> + <ProcessForm /> </div> <div class="flex flex-col p-4 w-2/3"> - <SettingsForm/> + <SettingsForm /> </div> </div> } @@ -67,18 +67,18 @@ fn SettingsPage() -> impl IntoView { role="tablist" class="shadow-xl border-b-2 border-base-200 bg-base-300 rounded-none !rounded-t-lg shrink tabs tabs-boxed" > - <TabButton path="/settings/backend" label="Backend"/> - <TabButton path="/settings/model" label="Model"/> + <TabButton path="/settings/backend" label="Backend" /> + <TabButton path="/settings/model" label="Model" /> </div> <div class="shadow-xl border-b-2 border-base-200 bg-base-300 rounded-none !rounded-t-lg shrink tabs tabs-boxed"> <button class="btn btn-sm" on:click=increment_gen> - <RefreshSvg/> + <RefreshSvg /> </button> </div> </div> <div class="grow"> <TabCard> - <Outlet/> + <Outlet /> </TabCard> </div> </div> @@ -89,8 +89,8 @@ fn SettingsPage() -> impl IntoView { pub fn SettingsRoutes() -> impl IntoView { view! { <Route path="/settings" view=SettingsPage> - <Route path="/backend" view=BackendSettingsPage/> - <Route path="/model" view=ModelSettingsPage/> + <Route path="/backend" view=BackendSettingsPage /> + <Route path="/model" view=ModelSettingsPage /> </Route> } } diff --git a/llama_forge_rs/src/server/fileserv.rs b/llama_forge_rs/src/server/fileserv.rs index 55375b3..356de52 100644 --- a/llama_forge_rs/src/server/fileserv.rs +++ b/llama_forge_rs/src/server/fileserv.rs @@ -49,7 +49,7 @@ pub async fn file_and_error_handler( move || { provide_context(app_state.pool.clone()); }, - move || view! { <App/> }, + move || view! { <App /> }, ); handler(req).await.into_response() } diff --git a/llama_proxy_man/config.yaml b/llama_proxy_man/config.yaml index ee89000..a19d518 100644 --- a/llama_proxy_man/config.yaml +++ b/llama_proxy_man/config.yaml @@ -1,7 +1,7 @@ -hardware: +system_resources: ram: 48G vram: 30G -models: +model_specs: - name: "tabby-code" port: 18080 # internal_port: 28080 # Optional diff --git a/llama_proxy_man/src/config.rs b/llama_proxy_man/src/config.rs index 186cf16..0d90974 100644 --- a/llama_proxy_man/src/config.rs +++ b/llama_proxy_man/src/config.rs @@ -22,7 +22,7 @@ impl AppConfig { if model.internal_port.is_none() { model.internal_port = Some( openport::pick_random_unused_port() - .expect(&format!("No open port found for {:?}", model)), + .unwrap_or_else(|| panic!("No open port found for {:?}", model)), ); } } diff --git a/llama_proxy_man/src/error.rs b/llama_proxy_man/src/error.rs index 01c7fae..59d5973 100644 --- a/llama_proxy_man/src/error.rs +++ b/llama_proxy_man/src/error.rs @@ -1,10 +1,10 @@ +use anyhow::Error as AnyError; use axum::{http, response::IntoResponse}; use hyper; use reqwest; use reqwest_middleware; use std::io; use thiserror::Error; -use anyhow::Error as AnyError; #[derive(Error, Debug)] pub enum AppError { diff --git a/llama_proxy_man/src/main.rs b/llama_proxy_man/src/main.rs index 9e98ffd..f7cd786 100644 --- a/llama_proxy_man/src/main.rs +++ b/llama_proxy_man/src/main.rs @@ -1,5 +1,4 @@ use llama_proxy_man::{config::AppConfig, logging, start_server}; -use tokio; #[tokio::main] async fn main() { diff --git a/llama_proxy_man/src/util.rs b/llama_proxy_man/src/util.rs index de1c849..d13fab6 100644 --- a/llama_proxy_man/src/util.rs +++ b/llama_proxy_man/src/util.rs @@ -3,7 +3,7 @@ pub fn parse_size(size_str: &str) -> Option<u64> { let mut unit = String::new(); for c in size_str.chars() { - if c.is_digit(10) || c == '.' { + if c.is_ascii_digit() || c == '.' { num.push(c); } else { unit.push(c);