Text Generation
Transformers
Safetensors
GGUF
llama
chatbot
multilingual
arabic
french
tamazight
english
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use kaisser/LLM-Maroc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kaisser/LLM-Maroc with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kaisser/LLM-Maroc") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kaisser/LLM-Maroc") model = AutoModelForCausalLM.from_pretrained("kaisser/LLM-Maroc", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use kaisser/LLM-Maroc 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 kaisser/LLM-Maroc:BF16 # Run inference directly in the terminal: llama cli -hf kaisser/LLM-Maroc:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kaisser/LLM-Maroc:BF16 # Run inference directly in the terminal: llama cli -hf kaisser/LLM-Maroc:BF16
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 kaisser/LLM-Maroc:BF16 # Run inference directly in the terminal: ./llama-cli -hf kaisser/LLM-Maroc:BF16
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 kaisser/LLM-Maroc:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf kaisser/LLM-Maroc:BF16
Use Docker
docker model run hf.co/kaisser/LLM-Maroc:BF16
- LM Studio
- Jan
- vLLM
How to use kaisser/LLM-Maroc with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kaisser/LLM-Maroc" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaisser/LLM-Maroc", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kaisser/LLM-Maroc:BF16
- SGLang
How to use kaisser/LLM-Maroc 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 "kaisser/LLM-Maroc" \ --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": "kaisser/LLM-Maroc", "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 "kaisser/LLM-Maroc" \ --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": "kaisser/LLM-Maroc", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use kaisser/LLM-Maroc with Ollama:
ollama run hf.co/kaisser/LLM-Maroc:BF16
- Unsloth Studio
How to use kaisser/LLM-Maroc 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 kaisser/LLM-Maroc 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 kaisser/LLM-Maroc to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kaisser/LLM-Maroc to start chatting
- Docker Model Runner
How to use kaisser/LLM-Maroc with Docker Model Runner:
docker model run hf.co/kaisser/LLM-Maroc:BF16
- Lemonade
How to use kaisser/LLM-Maroc with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kaisser/LLM-Maroc:BF16
Run and chat with the model
lemonade run user.LLM-Maroc-BF16
List all available models
lemonade list
- Atomic Chat
| #!/usr/bin/env python3 | |
| """ | |
| This script parses docs/ops/*.csv and creates the ops.md, which is a table documenting supported operations on various ggml backends. | |
| """ | |
| import csv | |
| import logging | |
| import sys | |
| from pathlib import Path | |
| from collections import defaultdict | |
| class DocsGenerator: | |
| def __init__(self, ggml_root: str, output_filename: str = "ops.md"): | |
| self.ggml_root = Path(ggml_root) | |
| self.ops_dir = self.ggml_root / "docs" / "ops" | |
| self.output_filename = output_filename | |
| self.backend_support: dict[str, dict[str, list[bool]]] = defaultdict( | |
| lambda: defaultdict(list) | |
| ) | |
| self.all_operations: set[str] = set() | |
| self.all_backends: set[str] = set() | |
| self.logger = logging.getLogger(__name__) | |
| def parse_support_files(self) -> None: | |
| if not self.ops_dir.exists(): | |
| self.logger.warning(f"ops directory not found: {self.ops_dir}") | |
| return | |
| self.logger.info(f"Parsing support files from {self.ops_dir}...") | |
| for support_file in self.ops_dir.glob("*.csv"): | |
| self.logger.info(f" Reading: {support_file.name}") | |
| self._parse_support_file(support_file) | |
| def _parse_support_file(self, file_path: Path) -> None: | |
| try: | |
| with open(file_path, "r", newline='') as f: | |
| reader = csv.DictReader(f) | |
| for row in reader: | |
| # Skip rows that don't have support mode | |
| if row.get('test_mode') != 'support': | |
| continue | |
| backend_name = row.get('backend_name', '').strip() | |
| operation = row.get('op_name', '').strip() | |
| supported_str = row.get('error_message', '').strip() # "yes" or "no" | |
| backend_reg_name = row.get('backend_reg_name', '').strip() | |
| # Skip invalid or error operations | |
| if not operation or not backend_name or operation in [ | |
| "CONTEXT_ERROR", | |
| "BUILD_ERROR", | |
| ]: | |
| continue | |
| is_supported = supported_str.lower() == "yes" | |
| # Use backend_reg_name for grouping, fallback to backend_name | |
| backend_key = backend_reg_name if backend_reg_name else backend_name | |
| self.all_backends.add(backend_key) | |
| self.backend_support[backend_key][operation].append(is_supported) | |
| self.all_operations.add(operation) | |
| except Exception as e: | |
| self.logger.error(f" Error parsing {file_path}: {e}") | |
| def get_backend_support_status(self, backend: str, operation: str) -> str: | |
| support_list = self.backend_support[backend].get(operation, []) | |
| if not support_list: | |
| return "unsupported" | |
| all_supported = all(support_list) | |
| any_supported = any(support_list) | |
| if all_supported: | |
| return "supported" | |
| elif any_supported: | |
| return "partially supported" | |
| else: | |
| return "unsupported" | |
| def get_support_status(self, operation: str) -> str: | |
| if operation not in self.all_operations: | |
| return "unsupported" | |
| support_count = 0 | |
| total_backends = len(self.all_backends) | |
| for backend in self.all_backends: | |
| if self.backend_support[backend].get(operation, False): | |
| support_count += 1 | |
| if support_count == 0: | |
| return "unsupported" | |
| elif support_count == total_backends: | |
| return "supported" | |
| else: | |
| return "partially supported" | |
| def get_support_symbol(self, status: str) -> str: | |
| symbols = {"supported": "✅", "partially supported": "🟡", "unsupported": "❌"} | |
| return symbols.get(status, "❓") | |
| def generate_markdown(self) -> str: | |
| lines = [] | |
| lines.append("# GGML Operations") | |
| lines.append("") | |
| lines.append("List of GGML operations and backend support status.") | |
| lines.append("") | |
| lines.append("Legend:") | |
| lines.append("- ✅ Fully supported by this backend") | |
| lines.append("- 🟡 Partially supported by this backend") | |
| lines.append("- ❌ Not supported by this backend") | |
| lines.append("") | |
| backends = sorted(self.all_backends) | |
| header = "| Operation |" | |
| for backend in backends: | |
| header += f" {backend} |" | |
| separator = "|-----------|" | |
| for _ in backends: | |
| separator += "------|" | |
| lines.append(header) | |
| lines.append(separator) | |
| sorted_operations = sorted(self.all_operations) | |
| for operation in sorted_operations: | |
| row = f"| {operation:>32} |" | |
| for backend in backends: | |
| status = self.get_backend_support_status(backend, operation) | |
| if status == "supported": | |
| symbol = "✅" | |
| elif status == "partially supported": | |
| symbol = "🟡" | |
| else: | |
| symbol = "❌" | |
| row += f" {symbol} |" | |
| lines.append(row) | |
| lines.append("") | |
| return "\n".join(lines) | |
| def run(self) -> None: | |
| self.logger.info("Parsing GGML operation support files...") | |
| self.parse_support_files() | |
| if not self.all_operations: | |
| self.logger.error( | |
| "No operations found. Make sure to run test-backend-ops support --output csv > docs/ops/file.csv first." | |
| ) | |
| return | |
| self.logger.info( | |
| f"Found {len(self.all_operations)} operations across {len(self.all_backends)} backends" | |
| ) | |
| self.logger.info("Generating markdown...") | |
| markdown_content = self.generate_markdown() | |
| docs_dir = self.ggml_root / "docs" | |
| docs_dir.mkdir(exist_ok=True) | |
| ops_file = docs_dir / self.output_filename | |
| with open(ops_file, "w") as f: | |
| f.write(markdown_content) | |
| self.logger.info(f"Generated: {ops_file}") | |
| self.logger.info(f"Operations: {len(self.all_operations)}") | |
| self.logger.info(f"Backends: {len(self.all_backends)}") | |
| def main(): | |
| logging.basicConfig(level=logging.INFO) | |
| if len(sys.argv) > 1: | |
| output_filename = sys.argv[1] | |
| else: | |
| output_filename = "ops.md" | |
| generator = DocsGenerator(".", output_filename) | |
| generator.run() | |
| if __name__ == "__main__": | |
| main() | |