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
| import daisyuiThemes from 'daisyui/theme/object'; | |
| import { isNumeric } from './utils/misc'; | |
| export const isDev = import.meta.env.MODE === 'development'; | |
| // constants | |
| export const BASE_URL = new URL('.', document.baseURI).href | |
| .toString() | |
| .replace(/\/$/, ''); | |
| export const CONFIG_DEFAULT = { | |
| // Note: in order not to introduce breaking changes, please keep the same data type (number, string, etc) if you want to change the default value. Do not use null or undefined for default value. | |
| // Do not use nested objects, keep it single level. Prefix the key if you need to group them. | |
| apiKey: '', | |
| systemMessage: '', | |
| showTokensPerSecond: false, | |
| showThoughtInProgress: false, | |
| excludeThoughtOnReq: true, | |
| pasteLongTextToFileLen: 2500, | |
| pdfAsImage: false, | |
| // make sure these default values are in sync with `common.h` | |
| samplers: 'edkypmxt', | |
| temperature: 0.8, | |
| dynatemp_range: 0.0, | |
| dynatemp_exponent: 1.0, | |
| top_k: 40, | |
| top_p: 0.95, | |
| min_p: 0.05, | |
| xtc_probability: 0.0, | |
| xtc_threshold: 0.1, | |
| typical_p: 1.0, | |
| repeat_last_n: 64, | |
| repeat_penalty: 1.0, | |
| presence_penalty: 0.0, | |
| frequency_penalty: 0.0, | |
| dry_multiplier: 0.0, | |
| dry_base: 1.75, | |
| dry_allowed_length: 2, | |
| dry_penalty_last_n: -1, | |
| max_tokens: -1, | |
| custom: '', // custom json-stringified object | |
| // experimental features | |
| pyIntepreterEnabled: false, | |
| }; | |
| export const CONFIG_INFO: Record<string, string> = { | |
| apiKey: 'Set the API Key if you are using --api-key option for the server.', | |
| systemMessage: 'The starting message that defines how model should behave.', | |
| pasteLongTextToFileLen: | |
| 'On pasting long text, it will be converted to a file. You can control the file length by setting the value of this parameter. Value 0 means disable.', | |
| samplers: | |
| 'The order at which samplers are applied, in simplified way. Default is "dkypmxt": dry->top_k->typ_p->top_p->min_p->xtc->temperature', | |
| temperature: | |
| 'Controls the randomness of the generated text by affecting the probability distribution of the output tokens. Higher = more random, lower = more focused.', | |
| dynatemp_range: | |
| 'Addon for the temperature sampler. The added value to the range of dynamic temperature, which adjusts probabilities by entropy of tokens.', | |
| dynatemp_exponent: | |
| 'Addon for the temperature sampler. Smoothes out the probability redistribution based on the most probable token.', | |
| top_k: 'Keeps only k top tokens.', | |
| top_p: | |
| 'Limits tokens to those that together have a cumulative probability of at least p', | |
| min_p: | |
| 'Limits tokens based on the minimum probability for a token to be considered, relative to the probability of the most likely token.', | |
| xtc_probability: | |
| 'XTC sampler cuts out top tokens; this parameter controls the chance of cutting tokens at all. 0 disables XTC.', | |
| xtc_threshold: | |
| 'XTC sampler cuts out top tokens; this parameter controls the token probability that is required to cut that token.', | |
| typical_p: | |
| 'Sorts and limits tokens based on the difference between log-probability and entropy.', | |
| repeat_last_n: 'Last n tokens to consider for penalizing repetition', | |
| repeat_penalty: | |
| 'Controls the repetition of token sequences in the generated text', | |
| presence_penalty: | |
| 'Limits tokens based on whether they appear in the output or not.', | |
| frequency_penalty: | |
| 'Limits tokens based on how often they appear in the output.', | |
| dry_multiplier: | |
| 'DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling multiplier.', | |
| dry_base: | |
| 'DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the DRY sampling base value.', | |
| dry_allowed_length: | |
| 'DRY sampling reduces repetition in generated text even across long contexts. This parameter sets the allowed length for DRY sampling.', | |
| dry_penalty_last_n: | |
| 'DRY sampling reduces repetition in generated text even across long contexts. This parameter sets DRY penalty for the last n tokens.', | |
| max_tokens: 'The maximum number of token per output.', | |
| custom: '', // custom json-stringified object | |
| }; | |
| // config keys having numeric value (i.e. temperature, top_k, top_p, etc) | |
| export const CONFIG_NUMERIC_KEYS = Object.entries(CONFIG_DEFAULT) | |
| .filter((e) => isNumeric(e[1])) | |
| .map((e) => e[0]); | |
| // list of themes supported by daisyui | |
| export const THEMES = ['light', 'dark'] | |
| // make sure light & dark are always at the beginning | |
| .concat( | |
| Object.keys(daisyuiThemes).filter((t) => t !== 'light' && t !== 'dark') | |
| ); | |