Text Generation
Transformers
Safetensors
GGUF
Korean
English
llama
3b
korean
from-scratch
orpo
instruction-tuned
preference-aligned
fp8
b200
Eval Results (legacy)
text-generation-inference
Instructions to use pathcosmos/frankenstallm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pathcosmos/frankenstallm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pathcosmos/frankenstallm")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pathcosmos/frankenstallm") model = AutoModelForCausalLM.from_pretrained("pathcosmos/frankenstallm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use pathcosmos/frankenstallm 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 pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: llama cli -hf pathcosmos/frankenstallm:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: llama cli -hf pathcosmos/frankenstallm: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 pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf pathcosmos/frankenstallm: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 pathcosmos/frankenstallm:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf pathcosmos/frankenstallm:Q4_K_M
Use Docker
docker model run hf.co/pathcosmos/frankenstallm:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use pathcosmos/frankenstallm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pathcosmos/frankenstallm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pathcosmos/frankenstallm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pathcosmos/frankenstallm:Q4_K_M
- SGLang
How to use pathcosmos/frankenstallm with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "pathcosmos/frankenstallm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pathcosmos/frankenstallm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "pathcosmos/frankenstallm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pathcosmos/frankenstallm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use pathcosmos/frankenstallm with Ollama:
ollama run hf.co/pathcosmos/frankenstallm:Q4_K_M
- Unsloth Studio
How to use pathcosmos/frankenstallm 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 pathcosmos/frankenstallm 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 pathcosmos/frankenstallm to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for pathcosmos/frankenstallm to start chatting
- Docker Model Runner
How to use pathcosmos/frankenstallm with Docker Model Runner:
docker model run hf.co/pathcosmos/frankenstallm:Q4_K_M
- Lemonade
How to use pathcosmos/frankenstallm with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull pathcosmos/frankenstallm:Q4_K_M
Run and chat with the model
lemonade run user.frankenstallm-Q4_K_M
List all available models
lemonade list
- Atomic Chat
| #!/usr/bin/env python3 | |
| """ | |
| Standalone Telegram notification helper for FRANKENSTALLM 3B training. | |
| Usage: | |
| python3 scripts/telegram_notify.py "Your message here" | |
| python3 scripts/telegram_notify.py "<b>Bold</b> message" --parse-mode HTML | |
| Function API: | |
| from scripts.telegram_notify import send_telegram | |
| send_telegram("message text") | |
| """ | |
| import os | |
| import sys | |
| import json | |
| import urllib.request | |
| import urllib.parse | |
| import urllib.error | |
| import logging | |
| from typing import Optional | |
| # βββ Configuration ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| BOT_TOKEN = os.environ.get("TELEGRAM_BOT_TOKEN", "") | |
| CHAT_ID = os.environ.get("TELEGRAM_CHAT_ID", "") | |
| TIMEOUT = 15 # seconds | |
| MAX_MSG_LEN = 4096 # Telegram limit | |
| logging.basicConfig( | |
| level=logging.WARNING, | |
| format="%(asctime)s [telegram_notify] %(levelname)s: %(message)s", | |
| ) | |
| log = logging.getLogger("telegram_notify") | |
| def send_telegram( | |
| message: str, | |
| parse_mode: str = "HTML", | |
| token: str = BOT_TOKEN, | |
| chat_id: str = CHAT_ID, | |
| disable_web_page_preview: bool = True, | |
| ) -> bool: | |
| """ | |
| Send a Telegram message via Bot API using urllib (curl-free). | |
| Args: | |
| message: Text to send (HTML or Markdown depending on parse_mode). | |
| parse_mode: "HTML" or "Markdown" or "" (plain). | |
| token: Bot token (defaults to module-level BOT_TOKEN). | |
| chat_id: Recipient chat/channel ID. | |
| disable_web_page_preview: Suppress link previews. | |
| Returns: | |
| True on success, False on any error. | |
| """ | |
| if not message: | |
| log.warning("Empty message β skipping send.") | |
| return False | |
| # Truncate if over Telegram limit, with notice | |
| if len(message) > MAX_MSG_LEN: | |
| truncated_notice = "\n\n<i>[message truncated]</i>" if parse_mode == "HTML" else "\n\n[message truncated]" | |
| message = message[: MAX_MSG_LEN - len(truncated_notice)] + truncated_notice | |
| url = f"https://api.telegram.org/bot{token}/sendMessage" | |
| payload: dict = { | |
| "chat_id": chat_id, | |
| "text": message, | |
| "disable_web_page_preview": disable_web_page_preview, | |
| } | |
| if parse_mode: | |
| payload["parse_mode"] = parse_mode | |
| data = urllib.parse.urlencode(payload).encode("utf-8") | |
| try: | |
| req = urllib.request.Request( | |
| url, | |
| data=data, | |
| method="POST", | |
| headers={"Content-Type": "application/x-www-form-urlencoded"}, | |
| ) | |
| with urllib.request.urlopen(req, timeout=TIMEOUT) as resp: | |
| body = resp.read().decode("utf-8") | |
| result = json.loads(body) | |
| if result.get("ok"): | |
| return True | |
| else: | |
| log.error("Telegram API error: %s", result.get("description", result)) | |
| return False | |
| except urllib.error.HTTPError as e: | |
| try: | |
| err_body = e.read().decode("utf-8") | |
| except Exception: | |
| err_body = str(e) | |
| log.error("HTTP %d from Telegram: %s", e.code, err_body) | |
| return False | |
| except urllib.error.URLError as e: | |
| log.error("Network error sending Telegram message: %s", e.reason) | |
| return False | |
| except json.JSONDecodeError as e: | |
| log.error("Failed to parse Telegram response: %s", e) | |
| return False | |
| except Exception as e: # noqa: BLE001 | |
| log.error("Unexpected error in send_telegram: %s", e) | |
| return False | |
| def send_telegram_safe(message: str, **kwargs) -> bool: | |
| """ | |
| Wrapper that catches ALL exceptions β guaranteed never to crash the caller. | |
| Suitable for embedding in training loops where stability is critical. | |
| """ | |
| try: | |
| return send_telegram(message, **kwargs) | |
| except Exception as e: # noqa: BLE001 | |
| log.error("send_telegram_safe caught unhandled exception: %s", e) | |
| return False | |
| # βββ CLI entry point ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| if __name__ == "__main__": | |
| import argparse | |
| parser = argparse.ArgumentParser( | |
| description="Send a Telegram message from the command line." | |
| ) | |
| parser.add_argument("message", nargs="?", help="Message text to send") | |
| parser.add_argument( | |
| "--parse-mode", | |
| default="HTML", | |
| choices=["HTML", "Markdown", "MarkdownV2", ""], | |
| help="Telegram parse_mode (default: HTML)", | |
| ) | |
| parser.add_argument( | |
| "--token", default=BOT_TOKEN, help="Override bot token" | |
| ) | |
| parser.add_argument( | |
| "--chat-id", default=CHAT_ID, help="Override chat ID" | |
| ) | |
| args = parser.parse_args() | |
| # Allow piped stdin if no positional arg given | |
| if args.message is None: | |
| if not sys.stdin.isatty(): | |
| args.message = sys.stdin.read().strip() | |
| else: | |
| parser.print_help() | |
| sys.exit(1) | |
| ok = send_telegram( | |
| args.message, | |
| parse_mode=args.parse_mode, | |
| token=args.token, | |
| chat_id=args.chat_id, | |
| ) | |
| if ok: | |
| print("Telegram message sent successfully.") | |
| sys.exit(0) | |
| else: | |
| print("ERROR: Failed to send Telegram message.", file=sys.stderr) | |
| sys.exit(1) | |