Instructions to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF", dtype="auto") - llama-cpp-python
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF", filename="KafkaLM-8x7b-German-V0.1-DPO-Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF 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 LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF: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 LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF: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 LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M
Use Docker
docker model run hf.co/LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M
- SGLang
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF 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 "LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF" \ --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": "LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF", "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 "LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF" \ --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": "LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF with Ollama:
ollama run hf.co/LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M
- Unsloth Studio
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF 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 LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF 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 LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF with Docker Model Runner:
docker model run hf.co/LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M
- Lemonade
How to use LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull LoneStriker/KafkaLM-8x7b-German-V0.1-DPO-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.KafkaLM-8x7b-German-V0.1-DPO-GGUF-Q4_K_M
List all available models
lemonade list
KafkaLM-8x7b-German-V0.1
KafkaLM 8x7b is a MoE model based on Mistral AI´s Mixtral 8x7b which was finetuned on an ensemble of popular high-quality open-source instruction sets (translated from English to German).
KafkaLM 8x7b is a Seedbox project trained by Dennis Dickmann.
Why Kafka? The models are proficient, yet creative, have some tendencies to linguistically push boundaries 😊
Model Details
The purpose of releasing the KafkaLM series is to contribute to the German AI community with a set of fine-tuned LLMs that are easy to use in everyday applications across a variety of tasks.
The main goal was to provide LLMs proficient in German, especially to be used in German-speaking business contexts where English alone is not sufficient.
DPO
The model has been aligned with a german and modified version of the ultra feedback dataset from huggingface.
Dataset
I used a 8k filtered version of the following seedboxai/multitask_german_examples_32k
Prompt Format
This model follows the subsequent prompt format:
<|system|>
Du bist ein freundlicher und hilfsbereiter KI-Assistent. Du beantwortest Fragen faktenorientiert und präzise, ohne dabei relevante Fakten auszulassen.</s>
<|user|>
Welche Möglichkeiten der energetischen Sanierung habe ich neben Solar und Energiespeicher?</s>
<|assistant|>
Inference
Getting started with the model is straightforward
import transformers
model_id = "seedboxai/KafkaLM-8x7B-German-V0.1-DPO"
model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_id)
def generate_prompt(input):
prompt = ''
sys_prompt = "Du bist ein freundlicher und hilfsbereiter KI-Assistent. Du beantwortest Fragen faktenorientiert und präzise, ohne dabei relevante Fakten auszulassen."
prompt += f"<|system|>\n{sys_prompt.strip()}</s>\n"
prompt += f"<|user|>\n{input.strip()}</s>\n"
prompt += f"<|assistant|>\n"
return prompt.strip()
generate_text = transformers.pipeline(
model=model, tokenizer=tokenizer,
return_full_text=True,
task='text-generation',
temperature=0.5,
max_new_tokens=512,
top_p=0.95,
top_k=50,
do_sample=True,
)
print(generate_text(generate_prompt("Wer ist eigentlich dieser Kafka?"))
Disclaimer
The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. This model should only be used for research purposes. The original Llama2 license and all restrictions of datasets used to train this model apply.
- Downloads last month
- 63
2-bit
3-bit
4-bit
5-bit
6-bit
