Instructions to use XenocodeRCE/qwen_socraticGGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use XenocodeRCE/qwen_socraticGGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="XenocodeRCE/qwen_socraticGGUF", filename="qwen3-4b-instruct-2507.Q4_K_M.gguf", )
llm.create_chat_completion( messages = "{\n \"question\": \"What is my name?\",\n \"context\": \"My name is Clara and I live in Berkeley.\"\n}" ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use XenocodeRCE/qwen_socraticGGUF 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 XenocodeRCE/qwen_socraticGGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf XenocodeRCE/qwen_socraticGGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf XenocodeRCE/qwen_socraticGGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf XenocodeRCE/qwen_socraticGGUF: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 XenocodeRCE/qwen_socraticGGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf XenocodeRCE/qwen_socraticGGUF: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 XenocodeRCE/qwen_socraticGGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf XenocodeRCE/qwen_socraticGGUF:Q4_K_M
Use Docker
docker model run hf.co/XenocodeRCE/qwen_socraticGGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use XenocodeRCE/qwen_socraticGGUF with Ollama:
ollama run hf.co/XenocodeRCE/qwen_socraticGGUF:Q4_K_M
- Unsloth Studio
How to use XenocodeRCE/qwen_socraticGGUF 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 XenocodeRCE/qwen_socraticGGUF 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 XenocodeRCE/qwen_socraticGGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for XenocodeRCE/qwen_socraticGGUF to start chatting
- Pi
How to use XenocodeRCE/qwen_socraticGGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf XenocodeRCE/qwen_socraticGGUF: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": "XenocodeRCE/qwen_socraticGGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use XenocodeRCE/qwen_socraticGGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf XenocodeRCE/qwen_socraticGGUF: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 XenocodeRCE/qwen_socraticGGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use XenocodeRCE/qwen_socraticGGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf XenocodeRCE/qwen_socraticGGUF: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 "XenocodeRCE/qwen_socraticGGUF: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 XenocodeRCE/qwen_socraticGGUF with Docker Model Runner:
docker model run hf.co/XenocodeRCE/qwen_socraticGGUF:Q4_K_M
- Lemonade
How to use XenocodeRCE/qwen_socraticGGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull XenocodeRCE/qwen_socraticGGUF:Q4_K_M
Run and chat with the model
lemonade run user.qwen_socraticGGUF-Q4_K_M
List all available models
lemonade list
qwen_socraticGGUF : Modèle Philosophique Socratique
Ce modèle a été fine-tuné pour adopter la méthode socratique et converti au format GGUF en utilisant Unsloth.
🎯 Particularité du modèle
Contrairement aux modèles classiques qui donnent des réponses directes, ce modèle adopte l'approche philosophique de Socrate en répondant par des questions qui encouragent la réflexion personnelle et l'introspection.
Exemples d'utilisation :
"Doit-on toujours dire la vérité ?"
Réponse : "La vérité est-elle toujours bonne à dire ? Il y a des situations où la vérité fait mal, et des situations où dire la vérité peut protéger quelqu'un. Mais une fois que tu as dit la vérité, comment l'as-tu dit ?"
"Peut-on tout dire ?"
Réponse :"Le silence est-il toujours une faiblesse ? Et l'authenticité exige-t-elle toujours toute la vérité ?"
🚀 Utilisation
Avec llama.cpp :
- Pour les modèles texte :
llama-cli -hf XenocodeRCE/qwen_socraticGGUF --jinja - Pour les modèles multimodaux :
llama-mtmd-cli -hf XenocodeRCE/qwen_socraticGGUF --jinja
Avec Ollama :
ollama run hf.co/XenocodeRCE/qwen_socraticGGUF:Q8_0
⚠️ Note importante : Utilisez /clear régulièrement dans Ollama si le modèle cesse de répondre (problème de contexte). Ce problème vient du fait que pour CE modèle la réponse est dans le champ 'thinking' au lieu du champ 'content' !
Voici un petit script python pour discuter avec de façon convenable :
import ollama
import json
class SocraticWrapper:
def __init__(self, model_name="hf.co/XenocodeRCE/qwen_socraticGGUF:Q8_0"):
self.model = model_name
self.client = ollama.Client()
self.conversation_history = []
self.max_context_pairs = 3
print(f"🏛️ Initialisation du modèle socratique: {self.model}")
self._test_connection()
def _test_connection(self):
"""Teste si le modèle est accessible"""
try:
models = self.client.list()
available_models = [model['name'] for model in models['models']]
if not any(self.model in model for model in available_models):
print(f"⚠️ Modèle {self.model} non trouvé")
else:
print(f"✅ Modèle trouvé et prêt")
except Exception as e:
print(f"❌ Erreur de connexion: {e}")
def ask(self, question):
"""Pose une question au modèle socratique"""
try:
# Prépare les messages (sans historique pour éviter les bugs pour l'instant)
messages = [{'role': 'user', 'content': question}]
# Ajoute un contexte minimal si on a un historique
if len(self.conversation_history) > 0:
# Prend seulement les 2 derniers échanges
recent_history = self.conversation_history[-4:]
messages = recent_history + messages
# Appel au modèle
response = self.client.chat(
model=self.model,
messages=messages,
options={
'temperature': 0.7,
'num_predict': 200,
'top_p': 0.9
}
)
# ✨ CORRECTION : Récupère la réponse depuis 'thinking' si 'content' est vide
if 'message' in response:
content = response['message'].get('content', '')
thinking = response['message'].get('thinking', '')
# Si le contenu principal est vide, utilise le thinking
assistant_response = content if content.strip() else thinking
if assistant_response:
# Mise à jour de l'historique
self.conversation_history.append({'role': 'user', 'content': question})
self.conversation_history.append({'role': 'assistant', 'content': assistant_response})
self._trim_history()
return assistant_response
else:
return "🤔 Le modèle semble réfléchir mais ne répond pas..."
else:
return "❌ Réponse invalide du modèle"
except Exception as e:
print(f"❌ Erreur: {e}")
# En cas d'erreur, essaie de reset le contexte
if len(self.conversation_history) > 0:
print("🧹 Reset automatique du contexte...")
self.clear_context()
return self.ask(question) # Réessaie
return f"Erreur: {e}"
def _trim_history(self):
"""Garde seulement les échanges récents"""
if len(self.conversation_history) > self.max_context_pairs * 2:
self.conversation_history = self.conversation_history[-(self.max_context_pairs * 2):]
def clear_context(self):
"""Vide l'historique"""
self.conversation_history = []
print("🧹 Contexte vidé - nouveau départ !")
def auto_clear_if_needed(self):
"""Clear automatique si l'historique devient trop long"""
total_tokens = sum(len(msg['content']) for msg in self.conversation_history) // 4
if total_tokens > 1000: # Seuil de sécurité
print("⚠️ Contexte trop long - nettoyage automatique...")
self.clear_context()
return True
return False
def get_stats(self):
"""Statistiques de la session"""
total_chars = sum(len(msg['content']) for msg in self.conversation_history)
exchanges = len(self.conversation_history) // 2
return {
'exchanges': exchanges,
'estimated_tokens': total_chars // 4,
'messages_in_history': len(self.conversation_history)
}
if __name__ == "__main__":
print("🏛️ Chat Socratique - Prêt pour philosopher !")
print("Commandes spéciales: /quit, /clear, /stats")
print("-" * 50)
socrate = SocraticWrapper()
while True:
question = input("\n🤔 Vous >>> ")
if question.lower() in ['/quit', '/bye', 'quit', 'exit']:
print("🏛️ À bientôt ! Continue de questionner le monde.")
break
elif question.lower() == '/clear':
socrate.clear_context()
continue
elif question.lower() == '/stats':
stats = socrate.get_stats()
print(f"📊 Stats: {stats['exchanges']} échanges, ~{stats['estimated_tokens']} tokens, {stats['messages_in_history']} messages en mémoire")
continue
elif question.strip() == "":
continue
# Auto-clear si nécessaire
socrate.auto_clear_if_needed()
# Pose la question
response = socrate.ask(question)
print(f"\n🏛️ Socrate >>> {response}")
📁 Fichiers de modèle disponibles :
qwen3-4b-instruct-2507.Q8_0.gguf(Qualité maximale - recommandé)qwen3-4b-instruct-2507.Q5_K_M.gguf(Bon équilibre qualité/taille)qwen3-4b-instruct-2507.Q4_K_M.gguf(Plus léger, pour ressources limitées)
🎓 Formation
Modèle basé sur Qwen3-4B-Instruct-2507 et fine-tuné sur un dataset de questions philosophiques utilisant la méthode socratique. L'entraînement s'est fait 2x plus rapidement grâce à Unsloth.
📚 Dataset
Entraîné sur le dataset Philosophie-questions-Socrate créé spécifiquement pour ce projet.
- Downloads last month
- 15
4-bit
5-bit
8-bit
Model tree for XenocodeRCE/qwen_socraticGGUF
Base model
Qwen/Qwen3-4B-Instruct-2507