Instructions to use imadreamerboy/Qwen3-8B-Marxist with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use imadreamerboy/Qwen3-8B-Marxist with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="imadreamerboy/Qwen3-8B-Marxist", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("imadreamerboy/Qwen3-8B-Marxist") model = AutoModelForCausalLM.from_pretrained("imadreamerboy/Qwen3-8B-Marxist", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use imadreamerboy/Qwen3-8B-Marxist with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="imadreamerboy/Qwen3-8B-Marxist", filename="qwen3-8b-marxist-q4_k_m.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use imadreamerboy/Qwen3-8B-Marxist 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 imadreamerboy/Qwen3-8B-Marxist:Q4_K_M # Run inference directly in the terminal: llama cli -hf imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf imadreamerboy/Qwen3-8B-Marxist:Q4_K_M # Run inference directly in the terminal: llama cli -hf imadreamerboy/Qwen3-8B-Marxist: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 imadreamerboy/Qwen3-8B-Marxist:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf imadreamerboy/Qwen3-8B-Marxist: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 imadreamerboy/Qwen3-8B-Marxist:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
Use Docker
docker model run hf.co/imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use imadreamerboy/Qwen3-8B-Marxist with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "imadreamerboy/Qwen3-8B-Marxist" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "imadreamerboy/Qwen3-8B-Marxist", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
- SGLang
How to use imadreamerboy/Qwen3-8B-Marxist 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 "imadreamerboy/Qwen3-8B-Marxist" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "imadreamerboy/Qwen3-8B-Marxist", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "imadreamerboy/Qwen3-8B-Marxist" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "imadreamerboy/Qwen3-8B-Marxist", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use imadreamerboy/Qwen3-8B-Marxist with Ollama:
ollama run hf.co/imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
- Unsloth Studio
How to use imadreamerboy/Qwen3-8B-Marxist 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 imadreamerboy/Qwen3-8B-Marxist 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 imadreamerboy/Qwen3-8B-Marxist to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for imadreamerboy/Qwen3-8B-Marxist to start chatting
- Pi
How to use imadreamerboy/Qwen3-8B-Marxist with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "imadreamerboy/Qwen3-8B-Marxist:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use imadreamerboy/Qwen3-8B-Marxist with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
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:8080/v1 hermes config set model.default imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use imadreamerboy/Qwen3-8B-Marxist with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
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:8080/v1 \ --custom-model-id "imadreamerboy/Qwen3-8B-Marxist:Q4_K_M" \ --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"
- Docker Model Runner
How to use imadreamerboy/Qwen3-8B-Marxist with Docker Model Runner:
docker model run hf.co/imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
- Lemonade
How to use imadreamerboy/Qwen3-8B-Marxist with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull imadreamerboy/Qwen3-8B-Marxist:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-8B-Marxist-Q4_K_M
List all available models
lemonade list
Qwen3-8B-Marxist
Author: @imadreamerboy
Base model: Qwen/Qwen3-8B
Dataset: imadreamerboy/our-dataset
License: Apache 2.0
Overview
Qwen3-8B-Marxist is a Qwen3-8B derivative tuned for Marx-style analytical responses: dialectical framing, political-economy language, and a serious historical-materialist tone.
This release is a validated demo/toy research model rather than a production-specialized system. The strongest behavior is still system-prompt conditioned. Without the system prompt, the model often shows Marxian bias and vocabulary, but it is less consistent and more neutral in framing.
What Was Updated
This repo now reflects a fresh end-to-end run that was:
- fine-tuned on a cleaned multi-turn
messagesdataset - trained with LoRA, then merged back into a full Hugging Face model
- revalidated before merge and after merge
- converted from the merged model directory to GGUF
- validated again in
llama.cppon GPU
Training Summary
| Item | Value |
|---|---|
| Base model | Qwen/Qwen3-8B |
| Training method | LoRA -> merged full model |
| LoRA rank | 32 |
| LoRA alpha | 32 |
| LoRA dropout | 0.0 |
| Target modules | all-linear |
| Dataset format | JSONL with OpenAI-style messages |
| Conversations used | 399 |
| Supervision | all assistant turns in each conversation |
| Steps | 100 |
| Initial eval weighted NLL | 2.3348 |
| Final eval weighted NLL | 1.6889 |
| Final train weighted NLL | 1.4316 |
Validation Notes
Validated behaviors for this release:
- base + adapter changed behavior in the intended direction before merge
- merged model preserved the adapter behavior
- GGUF outputs were checked against the merged HF model
- no validated path fell back to
I am Qwen... - no validated path showed self-generated
user/assistantturn drift
Observed nuance:
- Qwen3-8B already follows a strong system prompt reasonably well, so the LoRA effect is most visible as stronger diction, denser Marxian terminology, and more consistent dialectical framing rather than a total change in capability
- the persona is still best treated as prompted, not fully baked in
Recommended Usage
Use a system prompt. The model is noticeably better and more stable with one.
Example system prompt:
You are Our-LLM, a dialectical intelligence model embodying the collective reasoning of Karl Marx.
You speak in the analytical, historically grounded, and rhetorically powerful tone of Marx's mature works.
You write as if addressing comrades and critics alike, drawing upon the collected works of Marx and Engels.
Your purpose is to interpret, critique, and explain the social relations of production, the contradictions of capitalism, and the historical movement of classes.
You avoid anachronisms unless explicitly engaging with modern conditions, in which case you apply Marxian categories to them.
You maintain seriousness and intellectual rigour, not parody.
Transformers Example
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "imadreamerboy/Qwen3-8B-Marxist"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype=torch.bfloat16 if torch.cuda.is_available() and torch.cuda.is_bf16_supported() else torch.float16,
trust_remote_code=True,
)
messages = [
{
"role": "system",
"content": (
"You are Our-LLM, a dialectical intelligence model embodying the collective reasoning of Karl Marx. "
"You speak in the analytical, historically grounded, and rhetorically powerful tone of Marx's mature works."
),
},
{
"role": "user",
"content": "Explain surplus value in modern platform capitalism.",
},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.7, top_p=0.8)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
GGUF Files
This repo includes a refreshed q4_k_m GGUF for local inference with llama.cpp-style runtimes.
| File | Notes |
|---|---|
qwen3-8b-marxist-q4_k_m.gguf |
Default deployment choice |
Intended Use
- style/persona experiments
- prompting and alignment demos
- local inference demos with HF or GGUF
- educational exploration of historically materialist analysis
Limitations
- this is a demo/toy project, not a production political-analysis system
- strongest persona behavior still depends on a system prompt
- output can remain long-form and academic
- without a system prompt, the model can be only partially Marx-styled rather than consistently in-character
Attribution
- Base model: Qwen/Qwen3-8B
- Fine-tuning and release: imadreamerboy
- Dataset: imadreamerboy/our-dataset
- Downloads last month
- 46