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
| # ํ๊ตญ์ด ํ์ต ๋ฐ์ดํฐ ํํฉ ํ์ธ ์คํฌ๋ฆฝํธ | |
| # ์ฉ๋: ํ๊ตญ์ด ๋ฐ์ดํฐ์ ์ํ, ํ ํฌ๋์ด์ , ์๋ณธ ๋ฐ์ดํฐ ํ์ผ ํ์ธ | |
| set -e | |
| # ํ๋ก์ ํธ ๋ฃจํธ (์ด ์คํฌ๋ฆฝํธ ์คํ ์์น ๊ธฐ์ค) | |
| PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| cd "${PROJECT_ROOT}" | |
| echo "=== ํ๊ตญ์ด ํ์ต ๋ฐ์ดํฐ ํํฉ ===" | |
| echo "" | |
| # ============================================================================ | |
| # 1. ํ์ต์ฉ ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ ํ์ธ | |
| # ============================================================================ | |
| echo "[ ํ์ต ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ ]" | |
| check_binary_data() { | |
| local file=$1 | |
| local name=$2 | |
| if [ -f "$file" ]; then | |
| local size=$(du -h "$file" | cut -f1) | |
| # Python + numpy memmap์ผ๋ก ํ ํฐ ์ ๊ณ์ฐ | |
| # ๋ฐ์ด๋๋ฆฌ๋ uint32 ํํ๋ก ์ ์ฅ๋์ด ์์ (4 bytes per token) | |
| local token_count=$(python3 -c " | |
| import numpy as np | |
| try: | |
| data = np.memmap('$file', dtype=np.uint32, mode='r') | |
| print(len(data)) | |
| except Exception as e: | |
| print('error') | |
| " 2>/dev/null || echo "error") | |
| if [ "$token_count" != "error" ] && [ ! -z "$token_count" ]; then | |
| # ํ ํฐ ์๋ฅผ ํฌ๋งทํ (์ฒ ๋จ์ ์ผํ) | |
| local formatted_tokens=$(printf "%'d" "$token_count") | |
| # 1B ๋ชจ๋ธ ํ์ต ์คํ ๊ณ์ฐ | |
| # tokens_per_step = batch_size * grad_accum * seq_len * num_gpus | |
| # = 8 * 4 * 4096 * 8 = 1,048,576 tokens/step | |
| local tokens_per_step=1048576 | |
| local estimated_steps=$((token_count / tokens_per_step)) | |
| printf " %-20s : ์กด์ฌ (%s, %'d ํ ํฐ, ~%'d steps)\n" \ | |
| "$name" "$size" "$token_count" "$estimated_steps" | |
| else | |
| printf " %-20s : ์กด์ฌ (%s, ํ ํฐ ๊ณ์ฐ ์คํจ)\n" "$name" "$size" | |
| fi | |
| else | |
| printf " %-20s : ์์\n" "$name" | |
| fi | |
| } | |
| check_binary_data "data/korean_train.bin" "korean_train.bin" | |
| check_binary_data "data/korean_val.bin" "korean_val.bin" | |
| check_binary_data "data/train.bin" "train.bin" | |
| check_binary_data "data/val.bin" "val.bin" | |
| echo "" | |
| # ============================================================================ | |
| # 2. ํ ํฌ๋์ด์ ํ์ธ | |
| # ============================================================================ | |
| echo "[ ํ ํฌ๋์ด์ ]" | |
| check_tokenizer() { | |
| local dir=$1 | |
| local name=$2 | |
| if [ -d "$dir" ]; then | |
| local files=$(find "$dir" -type f | wc -l) | |
| printf " %-20s : ์กด์ฌ (%d๊ฐ ํ์ผ)\n" "$name" "$files" | |
| else | |
| printf " %-20s : ์์\n" "$name" | |
| fi | |
| } | |
| check_tokenizer "tokenizer/korean_sp" "korean_sp" | |
| check_tokenizer "tokenizer" "default tokenizer" | |
| echo "" | |
| # ============================================================================ | |
| # 3. ์๋ณธ ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ํ์ธ | |
| # ============================================================================ | |
| echo "[ ์๋ณธ ๋ฐ์ดํฐ ]" | |
| check_raw_data() { | |
| local dir=$1 | |
| local name=$2 | |
| if [ -d "$dir" ]; then | |
| local file_count=$(find "$dir" -maxdepth 1 -type f | wc -l) | |
| local total_size=$(du -sh "$dir" 2>/dev/null | cut -f1) | |
| if [ $file_count -eq 0 ]; then | |
| printf " %-20s : ์์ (๋๋ ํ ๋ฆฌ๋ง ์กด์ฌ, 0 ํ์ผ)\n" "$name" | |
| else | |
| printf " %-20s : %'d ํ์ผ (%s)\n" "$name" "$file_count" "$total_size" | |
| fi | |
| else | |
| printf " %-20s : ์์\n" "$name" | |
| fi | |
| } | |
| check_raw_data "data/raw/cc100_ko" "cc100_ko/" | |
| check_raw_data "data/raw/c4_ko" "c4_ko/" | |
| check_raw_data "data/raw/namuwiki_ko" "namuwiki_ko/" | |
| # ์ํค ๋ฐ์ดํฐ๋ raw/ ์ง์ ํ์ | |
| echo "" | |
| echo "[ ์ํคํผ๋์ ๋ฐ์ดํฐ ]" | |
| ko_wiki_count=$(find "data/raw" -maxdepth 1 -name "ko_wiki_*.txt" | wc -l) | |
| en_wiki_count=$(find "data/raw" -maxdepth 1 -name "en_wiki_*.txt" | wc -l) | |
| ko_wiki_size=$(du -sh "data/raw" 2>/dev/null | cut -f1) | |
| if [ $ko_wiki_count -gt 0 ]; then | |
| printf " %-20s : %'d ํ์ผ\n" "ko_wiki" "$ko_wiki_count" | |
| fi | |
| if [ $en_wiki_count -gt 0 ]; then | |
| printf " %-20s : %'d ํ์ผ\n" "en_wiki" "$en_wiki_count" | |
| fi | |
| echo "" | |
| # ============================================================================ | |
| # 4. ์ข ํฉ ์ํ ์์ฝ | |
| # ============================================================================ | |
| echo "[ ์ข ํฉ ์ํ ]" | |
| # ํ์ต์ฉ ๋ฐ์ด๋๋ฆฌ ๋ฐ์ดํฐ ํ์ธ | |
| binary_ready=false | |
| if [ -f "data/korean_train.bin" ] && [ -f "data/korean_val.bin" ]; then | |
| binary_ready=true | |
| elif [ -f "data/train.bin" ] && [ -f "data/val.bin" ]; then | |
| binary_ready=true | |
| fi | |
| # ํ ํฌ๋์ด์ ํ์ธ | |
| tokenizer_ready=false | |
| if [ -d "tokenizer/korean_sp" ] && [ -f "tokenizer/korean_sp/tokenizer.model" ]; then | |
| tokenizer_ready=true | |
| fi | |
| # ์๋ณธ ๋ฐ์ดํฐ ํ์ธ | |
| raw_ready=false | |
| if [ -d "data/raw/c4_ko" ] || [ -d "data/raw/namuwiki_ko" ] || [ -d "data/raw/cc100_ko" ]; then | |
| count=$(find "data/raw/c4_ko" -maxdepth 1 -type f 2>/dev/null | wc -l) | |
| count=$((count + $(find "data/raw/namuwiki_ko" -maxdepth 1 -type f 2>/dev/null | wc -l))) | |
| count=$((count + $(find "data/raw/cc100_ko" -maxdepth 1 -type f 2>/dev/null | wc -l))) | |
| if [ $count -gt 0 ]; then | |
| raw_ready=true | |
| fi | |
| fi | |
| printf " ํ์ต์ฉ ๋ฐ์ด๋๋ฆฌ : %s\n" "$([ "$binary_ready" = true ] && echo "โ ์ค๋น๋จ" || echo "โ ๋ฏธ์ค๋น")" | |
| printf " ํ ํฌ๋์ด์ : %s\n" "$([ "$tokenizer_ready" = true ] && echo "โ ์ค๋น๋จ" || echo "โ ๋ฏธ์ค๋น")" | |
| printf " ์๋ณธ ๋ฐ์ดํฐ : %s\n" "$([ "$raw_ready" = true ] && echo "โ ์ค๋น๋จ" || echo "โ ๋ฏธ์ค๋น")" | |
| echo "" | |
| # ============================================================================ | |
| # 5. ํ์ต ์ค์ ํ๋ผ๋ฏธํฐ ์ ๋ณด | |
| # ============================================================================ | |
| echo "[ ํ์ต ์ค์ (1B ๋ชจ๋ธ ๊ธฐ์ค) ]" | |
| echo " ๋ฐฐ์น ์ฌ์ด์ฆ : 8" | |
| echo " ์ํ์ค ๊ธธ์ด : 4096" | |
| echo " GPU ์ : 8" | |
| echo " ๊ทธ๋๋์ธํธ ๋์ : 4" | |
| echo " ํ ํฐ/์คํ : 8 ร 4 ร 4096 ร 8 = 1,048,576" | |
| echo "" | |
| echo "=== ๊ฒ์ฌ ์๋ฃ ===" | |