Instructions to use heavylildude/magnus-one with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use heavylildude/magnus-one with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf heavylildude/magnus-one # Run inference directly in the terminal: llama cli -hf heavylildude/magnus-one
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf heavylildude/magnus-one # Run inference directly in the terminal: llama cli -hf heavylildude/magnus-one
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf heavylildude/magnus-one # Run inference directly in the terminal: ./build/bin/llama cli -hf heavylildude/magnus-one
Use Docker
docker model run hf.co/heavylildude/magnus-one
- Llama new
- LM Studio
- Jan
- Ollama
How to use heavylildude/magnus-one with Ollama:
ollama run hf.co/heavylildude/magnus-one
- Unsloth Desktop
- Pi
How to use heavylildude/magnus-one with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf heavylildude/magnus-one
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "heavylildude/magnus-one" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use heavylildude/magnus-one with Docker Model Runner:
docker model run hf.co/heavylildude/magnus-one
- Lemonade
How to use heavylildude/magnus-one with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull heavylildude/magnus-one
Run and chat with the model
lemonade run user.magnus-one-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use heavylildude/magnus-one with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf heavylildude/magnus-one
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default heavylildude/magnus-one
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use heavylildude/magnus-one with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf heavylildude/magnus-one
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "heavylildude/magnus-one" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload 2 files
Browse files
config.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
| 1 |
export const MAGNUS_VERSION = "251026";
|
| 2 |
|
|
|
|
|
|
|
| 3 |
export const LLM_SERVER_BASE_URL = "http://127.0.0.1:8080";
|
| 4 |
export const API_URL = `${LLM_SERVER_BASE_URL}/v1/chat/completions`;
|
| 5 |
export const MEMORY_LIMIT = 10;
|
| 6 |
-
export const CACHE_TTL = 10 * 60 * 1000;
|
| 7 |
|
| 8 |
-
export const USER_ALIAS = "
|
| 9 |
-
|
| 10 |
-
export const
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
export const MAGNUS_VERSION = "251026";
|
| 2 |
|
| 3 |
+
// --- LLM SERVER CONFIG ---
|
| 4 |
+
// Point this to your local llama-server instance
|
| 5 |
export const LLM_SERVER_BASE_URL = "http://127.0.0.1:8080";
|
| 6 |
export const API_URL = `${LLM_SERVER_BASE_URL}/v1/chat/completions`;
|
| 7 |
export const MEMORY_LIMIT = 10;
|
|
|
|
| 8 |
|
| 9 |
+
export const USER_ALIAS = "chris, heavylildude, christo";
|
| 10 |
+
|
| 11 |
+
export const CACHE_TTL = 10 * 60 * 1000; // 10 minutes in milliseconds
|
| 12 |
+
|
| 13 |
+
export const BRAVE_API_KEY = "BSA03WdBwNgVWwMJHN6wYiZNTOyQQxh";
|
| 14 |
+
export const GOOGLE_API_KEY = "AIzaSyBBuXlCrsdqgsvID9dWgN3tLWKlvw_WDJg";
|
| 15 |
+
export const GOOGLE_CX_ID = "30c7bfc02547e42ca";
|
| 16 |
+
|
| 17 |
+
export const GGUF = "../GGUF/magnus-supernova-3.9B-Q4_K_M.gguf";
|
magnus.js
CHANGED
|
@@ -1,127 +1,136 @@
|
|
| 1 |
-
#!/usr/bin/env node
|
| 2 |
-
import readline from "readline";
|
| 3 |
-
import { spawn, execSync } from "child_process";
|
| 4 |
-
import { initializeDatabase, db } from "./modules/database.js";
|
| 5 |
-
import { bootUp, getPrompt, log, C, setReadline } from "./modules/ui.js";
|
| 6 |
-
import { commandHandlers } from "./modules/commands.js";
|
| 7 |
-
import { route } from "./modules/router.js";
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
let
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
rl.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
rl.
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
rl.
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
main().catch(err => { console.error(err); shutdown(1); });
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
import readline from "readline";
|
| 3 |
+
import { spawn, execSync } from "child_process";
|
| 4 |
+
import { initializeDatabase, db } from "./modules/database.js";
|
| 5 |
+
import { bootUp, getPrompt, log, C, setReadline } from "./modules/ui.js";
|
| 6 |
+
import { commandHandlers } from "./modules/commands.js";
|
| 7 |
+
import { route } from "./modules/router.js";
|
| 8 |
+
import { GGUF } from "./config.js";
|
| 9 |
+
|
| 10 |
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
| 11 |
+
setReadline(rl); // Give the UI module access to the readline instance
|
| 12 |
+
|
| 13 |
+
let multiline = false;
|
| 14 |
+
let multiBuf = [];
|
| 15 |
+
|
| 16 |
+
function refreshPrompt() {
|
| 17 |
+
const newPrompt = getPrompt();
|
| 18 |
+
rl.setPrompt(newPrompt);
|
| 19 |
+
rl.prompt(true);
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
function handleMultiline(line) {
|
| 23 |
+
if (line.trim() === "```") {
|
| 24 |
+
if (!multiline) {
|
| 25 |
+
multiline = true;
|
| 26 |
+
multiBuf = [];
|
| 27 |
+
log.gray("(multiline ON — type ``` to send)");
|
| 28 |
+
rl.setPrompt(''); // Use a blank prompt for multiline input
|
| 29 |
+
rl.prompt();
|
| 30 |
+
} else {
|
| 31 |
+
multiline = false;
|
| 32 |
+
return multiBuf.join("\n");
|
| 33 |
+
}
|
| 34 |
+
return null;
|
| 35 |
+
}
|
| 36 |
+
if (multiline) {
|
| 37 |
+
multiBuf.push(line);
|
| 38 |
+
return null;
|
| 39 |
+
}
|
| 40 |
+
return line.trim();
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
async function processInput(input, source = 'terminal') {
|
| 44 |
+
if (!input) return false;
|
| 45 |
+
|
| 46 |
+
try {
|
| 47 |
+
const lowerInput = input.trim().toLowerCase();
|
| 48 |
+
|
| 49 |
+
if (lowerInput === 'exit' || lowerInput === 'quit' || lowerInput === 'bye') {
|
| 50 |
+
await commandHandlers.quit();
|
| 51 |
+
// Return a special value to signal that we are quitting and should not refresh the prompt.
|
| 52 |
+
return { isQuitting: true };
|
| 53 |
+
} else if (input.trim().startsWith('/')) {
|
| 54 |
+
const [command] = input.substring(1).split(/\s+/);
|
| 55 |
+
const handler = commandHandlers[command];
|
| 56 |
+
if (handler) {
|
| 57 |
+
await handler(input);
|
| 58 |
+
} else {
|
| 59 |
+
log.warn(`Unknown command, brah. Sending to router anyway...`);
|
| 60 |
+
await route(input);
|
| 61 |
+
}
|
| 62 |
+
} else {
|
| 63 |
+
await route(input);
|
| 64 |
+
}
|
| 65 |
+
// Return a default object if not quitting.
|
| 66 |
+
return { isQuitting: false };
|
| 67 |
+
} catch (err) {
|
| 68 |
+
log.error(`Magnus error: An unhandled exception occurred.`);
|
| 69 |
+
console.error(err);
|
| 70 |
+
return { isQuitting: false };
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
let serverProcess = null; // Keep the server process in a higher scope
|
| 75 |
+
|
| 76 |
+
function startServer() { // No longer returns the process
|
| 77 |
+
log.info('[SERVER] Firing up the llama-server engine...');
|
| 78 |
+
serverProcess = spawn('llama-server', ['-m', GGUF, '--jinja'], {
|
| 79 |
+
detached: true,
|
| 80 |
+
stdio: 'ignore'
|
| 81 |
+
});
|
| 82 |
+
serverProcess.unref(); // Let the main process exit independently
|
| 83 |
+
log.gray(`[SERVER] Llama-server is shredding on PID: ${serverProcess.pid}`);
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
function shutdown(exitCode = 0) {
|
| 87 |
+
log.warn("\n[CLEANUP] Taking down the server... Catch ya later, legend!");
|
| 88 |
+
if (serverProcess && serverProcess.pid) {
|
| 89 |
+
try {
|
| 90 |
+
if (process.platform === "win32") {
|
| 91 |
+
// Bitchin' Fix: Use execSync to block until the command finishes. No more zombies!
|
| 92 |
+
execSync(`taskkill /pid ${serverProcess.pid} /f /t`);
|
| 93 |
+
} else {
|
| 94 |
+
// Kill the entire process group. The `-` is the magic here.
|
| 95 |
+
process.kill(-serverProcess.pid, 'SIGTERM');
|
| 96 |
+
}
|
| 97 |
+
log.success("[CLEANUP] Server process terminated.");
|
| 98 |
+
} catch (e) {
|
| 99 |
+
log.error(`[CLEANUP] Bogus! Couldn't kill server process ${serverProcess.pid}: ${e.message}`);
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
process.exit(exitCode);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
async function main() {
|
| 106 |
+
startServer();
|
| 107 |
+
log.gray('[SYSTEM] Giving the server 5 seconds to warm up...');
|
| 108 |
+
await new Promise(resolve => setTimeout(resolve, 5000)); // Simple 5-second delay
|
| 109 |
+
log.success('[SERVER] Aight, server should be ready. Let\'s rock!');
|
| 110 |
+
|
| 111 |
+
initializeDatabase();
|
| 112 |
+
await bootUp();
|
| 113 |
+
|
| 114 |
+
rl.setPrompt(getPrompt());
|
| 115 |
+
rl.prompt();
|
| 116 |
+
rl.on("line", async (line) => {
|
| 117 |
+
const processedLine = handleMultiline(line);
|
| 118 |
+
|
| 119 |
+
if (processedLine === null) return; // Multiline is active, just wait.
|
| 120 |
+
|
| 121 |
+
rl.pause(); // Pause the prompt while processing and streaming
|
| 122 |
+
const { isQuitting } = await processInput(processedLine, 'terminal');
|
| 123 |
+
if (isQuitting) {
|
| 124 |
+
shutdown(0); // Gracefully shutdown if command handler signals a quit
|
| 125 |
+
return;
|
| 126 |
+
}
|
| 127 |
+
if (!multiline) refreshPrompt();
|
| 128 |
+
rl.resume();
|
| 129 |
+
});
|
| 130 |
+
|
| 131 |
+
// Catch Ctrl+C and other termination signals for a graceful shutdown
|
| 132 |
+
process.on('SIGINT', () => shutdown(0));
|
| 133 |
+
process.on('SIGTERM', () => shutdown(0));
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
main().catch(err => { console.error(err); shutdown(1); });
|