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
| # Server build and tests | |
| name: Server | |
| on: | |
| workflow_dispatch: # allows manual triggering | |
| inputs: | |
| sha: | |
| description: 'Commit SHA1 to build' | |
| required: false | |
| type: string | |
| slow_tests: | |
| description: 'Run slow tests' | |
| required: true | |
| type: boolean | |
| push: | |
| branches: | |
| - master | |
| paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'tools/server/**.*'] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths: ['.github/workflows/server.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.swift', '**/*.m', 'tools/server/**.*'] | |
| env: | |
| LLAMA_LOG_COLORS: 1 | |
| LLAMA_LOG_PREFIX: 1 | |
| LLAMA_LOG_TIMESTAMPS: 1 | |
| LLAMA_LOG_VERBOSITY: 10 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| server: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| sanitizer: [ADDRESS, UNDEFINED] # THREAD is broken | |
| build_type: [RelWithDebInfo] | |
| include: | |
| - build_type: Release | |
| sanitizer: "" | |
| fail-fast: false # While -DLLAMA_SANITIZE_THREAD=ON is broken | |
| steps: | |
| - name: Dependencies | |
| id: depends | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install \ | |
| build-essential \ | |
| xxd \ | |
| git \ | |
| cmake \ | |
| curl \ | |
| wget \ | |
| language-pack-en \ | |
| libcurl4-openssl-dev | |
| - name: Clone | |
| id: checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }} | |
| - name: Python setup | |
| id: setup_python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Tests dependencies | |
| id: test_dependencies | |
| run: | | |
| pip install -r tools/server/tests/requirements.txt | |
| # Setup nodejs (to be used for verifying bundled index.html) | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.11.0' | |
| - name: WebUI - Install dependencies | |
| id: webui_lint | |
| run: | | |
| cd tools/server/webui | |
| npm ci | |
| - name: WebUI - Check code format | |
| id: webui_format | |
| run: | | |
| git config --global --add safe.directory $(realpath .) | |
| cd tools/server/webui | |
| git status | |
| npm run format | |
| git status | |
| modified_files="$(git status -s)" | |
| echo "Modified files: ${modified_files}" | |
| if [ -n "${modified_files}" ]; then | |
| echo "Files do not follow coding style. To fix: npm run format" | |
| echo "${modified_files}" | |
| exit 1 | |
| fi | |
| - name: Verify bundled index.html | |
| id: verify_server_index_html | |
| run: | | |
| git config --global --add safe.directory $(realpath .) | |
| cd tools/server/webui | |
| git status | |
| npm run build | |
| git status | |
| modified_files="$(git status -s)" | |
| echo "Modified files: ${modified_files}" | |
| if [ -n "${modified_files}" ]; then | |
| echo "Repository is dirty or server/webui is not built as expected" | |
| echo "Hint: You may need to follow Web UI build guide in server/README.md" | |
| echo "${modified_files}" | |
| exit 1 | |
| fi | |
| - name: Build (no OpenMP) | |
| id: cmake_build_no_openmp | |
| if: ${{ matrix.sanitizer == 'THREAD' }} | |
| run: | | |
| cmake -B build \ | |
| -DGGML_NATIVE=OFF \ | |
| -DLLAMA_BUILD_SERVER=ON \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON \ | |
| -DGGML_OPENMP=OFF ; | |
| cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server | |
| - name: Build (sanitizers) | |
| id: cmake_build_sanitizers | |
| if: ${{ matrix.sanitizer != '' && matrix.sanitizer != 'THREAD' }} | |
| run: | | |
| cmake -B build \ | |
| -DGGML_NATIVE=OFF \ | |
| -DLLAMA_BUILD_SERVER=ON \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DLLAMA_SANITIZE_${{ matrix.sanitizer }}=ON ; | |
| cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server | |
| - name: Build (sanitizers) | |
| id: cmake_build | |
| if: ${{ matrix.sanitizer == '' }} | |
| run: | | |
| cmake -B build \ | |
| -DGGML_NATIVE=OFF \ | |
| -DLLAMA_BUILD_SERVER=ON \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ; | |
| cmake --build build --config ${{ matrix.build_type }} -j $(nproc) --target llama-server | |
| - name: Tests | |
| id: server_integration_tests | |
| if: ${{ matrix.sanitizer == '' }} | |
| env: | |
| GITHUB_ACTIONS: "true" | |
| run: | | |
| cd tools/server/tests | |
| ./tests.sh | |
| - name: Tests (sanitizers) | |
| id: server_integration_tests_sanitizers | |
| if: ${{ matrix.sanitizer != '' }} | |
| run: | | |
| cd tools/server/tests | |
| LLAMA_SANITIZE=1 ./tests.sh | |
| - name: Slow tests | |
| id: server_integration_tests_slow | |
| if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }} | |
| run: | | |
| cd tools/server/tests | |
| SLOW_TESTS=1 ./tests.sh | |
| server-windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Clone | |
| id: checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }} | |
| - name: libCURL | |
| id: get_libcurl | |
| uses: ./.github/actions/windows-setup-curl | |
| - name: Build | |
| id: cmake_build | |
| env: | |
| CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} | |
| run: | | |
| cmake -B build -DCURL_LIBRARY="$env:CURL_PATH/lib/libcurl.dll.a" -DCURL_INCLUDE_DIR="$env:CURL_PATH/include" | |
| cmake --build build --config Release -j ${env:NUMBER_OF_PROCESSORS} --target llama-server | |
| - name: Python setup | |
| id: setup_python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Tests dependencies | |
| id: test_dependencies | |
| run: | | |
| pip install -r tools/server/tests/requirements.txt | |
| - name: Copy Libcurl | |
| id: prepare_libcurl | |
| env: | |
| CURL_PATH: ${{ steps.get_libcurl.outputs.curl_path }} | |
| run: | | |
| cp $env:CURL_PATH/bin/libcurl-x64.dll ./build/bin/Release/libcurl-x64.dll | |
| - name: Tests | |
| id: server_integration_tests | |
| if: ${{ !matrix.disabled_on_pr || !github.event.pull_request }} | |
| run: | | |
| cd tools/server/tests | |
| $env:PYTHONIOENCODING = ":replace" | |
| pytest -v -x -m "not slow" | |
| - name: Slow tests | |
| id: server_integration_tests_slow | |
| if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }} | |
| run: | | |
| cd tools/server/tests | |
| $env:SLOW_TESTS = "1" | |
| pytest -v -x | |