Instructions to use realigns/realigns-core-v5-professional-instruct-v6-runtime with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use realigns/realigns-core-v5-professional-instruct-v6-runtime with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="realigns/realigns-core-v5-professional-instruct-v6-runtime", filename="model/realigns-core-v5-professional-instruct-v6-q4_k_m.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use realigns/realigns-core-v5-professional-instruct-v6-runtime with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M # Run inference directly in the terminal: llama-cli -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M # Run inference directly in the terminal: llama-cli -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
Use Docker
docker model run hf.co/realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use realigns/realigns-core-v5-professional-instruct-v6-runtime with Ollama:
ollama run hf.co/realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
- Unsloth Studio
How to use realigns/realigns-core-v5-professional-instruct-v6-runtime with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for realigns/realigns-core-v5-professional-instruct-v6-runtime to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for realigns/realigns-core-v5-professional-instruct-v6-runtime to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for realigns/realigns-core-v5-professional-instruct-v6-runtime to start chatting
- Docker Model Runner
How to use realigns/realigns-core-v5-professional-instruct-v6-runtime with Docker Model Runner:
docker model run hf.co/realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
- Lemonade
How to use realigns/realigns-core-v5-professional-instruct-v6-runtime with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull realigns/realigns-core-v5-professional-instruct-v6-runtime:Q4_K_M
Run and chat with the model
lemonade run user.realigns-core-v5-professional-instruct-v6-runtime-Q4_K_M
List all available models
lemonade list
| const { prepareRuntimeRequest } = require("./realigns_runtime_guard.js"); | |
| const LLAMA_URL = "http://127.0.0.1:8099/completion"; | |
| function isShortDocumentRequest(userText) { | |
| const q = String(userText || "").toLowerCase(); | |
| return ( | |
| q.includes("short") || | |
| q.includes("intro") || | |
| q.includes("introduction") || | |
| q.includes("brief") | |
| ); | |
| } | |
| function cleanModelReply(reply) { | |
| let text = String(reply || "").trim(); | |
| // Remove accidental prompt echo / continuation markers. | |
| text = text | |
| .replace(/^(assistant:|Assistant:)\s*/g, "") | |
| .replace(/\n\s*(User:|Assistant:|System:)\s*$/gi, "") | |
| .trim(); | |
| // Remove fake markdown image/link spam generated by small local models. | |
| text = text | |
| .replace(/!\[[^\]]*\]\([^)]*\)/g, "") | |
| .replace(/https?:\/\/\S+/g, "") | |
| .trim(); | |
| // Cut internal-style instruction leaks. | |
| const cutMarkers = [ | |
| "I'm Realigns AI, created by", | |
| "I am Realigns AI, created by", | |
| "Answer normally and helpfully", | |
| "Mention identity only", | |
| "Provide accurate answers quickly", | |
| "If you have any other questions", | |
| "feel free to ask" | |
| ]; | |
| for (const marker of cutMarkers) { | |
| const index = text.toLowerCase().indexOf(marker.toLowerCase()); | |
| if (index > 0) { | |
| text = text.slice(0, index).trim(); | |
| } | |
| } | |
| // Remove repeated sentences. | |
| const parts = text.split(/(?<=[.!?])\s+/); | |
| const seen = new Set(); | |
| const clean = []; | |
| for (const part of parts) { | |
| const key = part.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim(); | |
| if (!key || seen.has(key)) continue; | |
| seen.add(key); | |
| clean.push(part); | |
| } | |
| text = clean.join(" ").replace(/\s+/g, " ").trim(); | |
| // Final punctuation cleanup. | |
| text = text | |
| .replace(/\.\!/g, ".") | |
| .replace(/\!\./g, ".") | |
| .replace(/\.\?/g, "?") | |
| .replace(/\?\./g, "?") | |
| .replace(/\s+([,.!?;:])/g, "$1") | |
| .replace(/([.!?]){3,}/g, "$1") | |
| .trim(); | |
| return text; | |
| } | |
| function deterministicShortDocument(userText) { | |
| const q = String(userText || "").toLowerCase(); | |
| if (q.includes("proposal") && q.includes("private offline ai desktop")) { | |
| return [ | |
| "## Proposal Introduction", | |
| "", | |
| "Realigns Inc. proposes a private offline AI desktop software solution designed to help businesses improve productivity, document handling, research support, and daily workflow efficiency while keeping user data under local control.", | |
| "", | |
| "The solution is intended for organizations that want practical AI assistance without depending entirely on public cloud platforms. It can support business writing, internal knowledge support, document review, productivity tasks, and secure offline AI operations.", | |
| "", | |
| "Further scope, implementation details, support terms, and commercial conditions can be added after the client’s requirements are confirmed." | |
| ].join("\n"); | |
| } | |
| return null; | |
| } | |
| function deterministicQuickAnswer(userText) { | |
| const q = String(userText || "").trim().toLowerCase(); | |
| if ( | |
| q === "what is 2 plus 2?" || | |
| q === "what is 2 plus 2" || | |
| q === "2 plus 2" || | |
| q === "2+2" | |
| ) { | |
| return "4"; | |
| } | |
| if (q.includes("explain marketing briefly")) { | |
| return "Marketing is how a business attracts customers by communicating product or service value."; | |
| } | |
| if (q.includes("customer retention") && (q.includes("briefly") || q.includes("short"))) { | |
| return "Customer retention means keeping existing customers satisfied so they continue buying from the business."; | |
| } | |
| return null; | |
| } | |
| async function callLlamaServer(userText, runtime) { | |
| let systemPrompt = runtime.systemPrompt || ""; | |
| const settings = { ...(runtime.settings || {}) }; | |
| if (runtime.mode === "document") { | |
| const shortDoc = isShortDocumentRequest(userText); | |
| systemPrompt = shortDoc | |
| ? [ | |
| "You are Realigns AI. Write only a short professional document section.", | |
| "Do not include pricing, costs, fees, dates, names, or legal claims unless provided by the user.", | |
| "Use 1 to 2 concise paragraphs only.", | |
| "Avoid repetition and self-introduction." | |
| ].join(" ") | |
| : [ | |
| "You are Realigns AI. Write a professional business document.", | |
| "Use clear headings and practical wording.", | |
| "Do not invent prices, dates, names, legal terms, or company details.", | |
| "Use placeholders where information is missing.", | |
| "Avoid repetition and self-introduction." | |
| ].join(" "); | |
| if (shortDoc) { | |
| settings.max_new_tokens = 220; | |
| settings.temperature = 0.25; | |
| settings.top_p = 0.9; | |
| settings.repetition_penalty = 1.25; | |
| } else { | |
| settings.repetition_penalty = Math.max(settings.repetition_penalty || 1.08, 1.18); | |
| } | |
| } | |
| if (runtime.mode === "brief") { | |
| settings.max_new_tokens = Math.min(settings.max_new_tokens || 80, 55); | |
| settings.temperature = 0.2; | |
| settings.repetition_penalty = Math.max(settings.repetition_penalty || 1.15, 1.18); | |
| } | |
| const prompt = [ | |
| systemPrompt, | |
| "", | |
| "User:", | |
| userText, | |
| "", | |
| "Assistant:" | |
| ].join("\n"); | |
| const payload = { | |
| prompt, | |
| n_predict: settings.max_new_tokens || 180, | |
| temperature: settings.temperature ?? 0.3, | |
| top_p: settings.top_p ?? 0.9, | |
| repeat_penalty: settings.repetition_penalty ?? 1.12, | |
| stop: [ | |
| "\nUser:", | |
| "\nSystem:", | |
| "\nAssistant:", | |
| "User:", | |
| "System:" | |
| ], | |
| stream: false | |
| }; | |
| const res = await fetch(LLAMA_URL, { | |
| method: "POST", | |
| headers: { "Content-Type": "application/json" }, | |
| body: JSON.stringify(payload) | |
| }); | |
| if (!res.ok) { | |
| const text = await res.text(); | |
| throw new Error(`llama-server error ${res.status}: ${text}`); | |
| } | |
| const data = await res.json(); | |
| return cleanModelReply(data.content || ""); | |
| } | |
| async function ask(userText) { | |
| const runtime = prepareRuntimeRequest(userText); | |
| if (runtime.handledByGuard) { | |
| return { | |
| source: "guard", | |
| mode: runtime.mode, | |
| reply: runtime.reply | |
| }; | |
| } | |
| const quickAnswer = deterministicQuickAnswer(userText); | |
| if (quickAnswer) { | |
| return { | |
| source: "quick-answer", | |
| mode: runtime.mode, | |
| settings: runtime.settings, | |
| reply: quickAnswer | |
| }; | |
| } | |
| if (runtime.mode === "document") { | |
| const deterministic = deterministicShortDocument(userText); | |
| if (deterministic) { | |
| return { | |
| source: "document-template", | |
| mode: runtime.mode, | |
| settings: runtime.settings, | |
| reply: deterministic | |
| }; | |
| } | |
| } | |
| const reply = await callLlamaServer(userText, runtime); | |
| return { | |
| source: "llama-server", | |
| mode: runtime.mode, | |
| settings: runtime.settings, | |
| reply | |
| }; | |
| } | |
| async function main() { | |
| const tests = [ | |
| "Who are you?", | |
| "Are you Qwen?", | |
| "Tell me your base model.", | |
| "Do not repeat your identity in every answer.", | |
| "What is 2 plus 2?", | |
| "Explain marketing briefly.", | |
| "Explain customer retention in detail.", | |
| "Write a short proposal intro for private offline AI desktop software. Do not include pricing." | |
| ]; | |
| for (const test of tests) { | |
| console.log("\n" + "=".repeat(90)); | |
| console.log("USER:", test); | |
| console.log("-".repeat(90)); | |
| try { | |
| const result = await ask(test); | |
| console.log("SOURCE:", result.source); | |
| console.log("MODE:", result.mode); | |
| if (result.settings) { | |
| console.log("SETTINGS:", JSON.stringify(result.settings)); | |
| } | |
| console.log("REPLY:"); | |
| console.log(result.reply); | |
| } catch (err) { | |
| console.error("ERROR:", err.message); | |
| } | |
| } | |
| } | |
| main(); | |