Instructions to use CyberCoder225/maira-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use CyberCoder225/maira-model with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="CyberCoder225/maira-model", filename="SmolLM2-360M-Instruct.Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use CyberCoder225/maira-model with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf CyberCoder225/maira-model:Q4_K_M # Run inference directly in the terminal: llama-cli -hf CyberCoder225/maira-model:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf CyberCoder225/maira-model:Q4_K_M # Run inference directly in the terminal: llama-cli -hf CyberCoder225/maira-model: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 CyberCoder225/maira-model:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf CyberCoder225/maira-model: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 CyberCoder225/maira-model:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf CyberCoder225/maira-model:Q4_K_M
Use Docker
docker model run hf.co/CyberCoder225/maira-model:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use CyberCoder225/maira-model with Ollama:
ollama run hf.co/CyberCoder225/maira-model:Q4_K_M
- Unsloth Studio new
How to use CyberCoder225/maira-model 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 CyberCoder225/maira-model 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 CyberCoder225/maira-model to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CyberCoder225/maira-model to start chatting
- Docker Model Runner
How to use CyberCoder225/maira-model with Docker Model Runner:
docker model run hf.co/CyberCoder225/maira-model:Q4_K_M
- Lemonade
How to use CyberCoder225/maira-model with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull CyberCoder225/maira-model:Q4_K_M
Run and chat with the model
lemonade run user.maira-model-Q4_K_M
List all available models
lemonade list
Update Dockerfile
Browse files- Dockerfile +43 -0
Dockerfile
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# ---- HF-required environment ----
|
| 4 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 5 |
+
PORT=7860
|
| 6 |
+
|
| 7 |
+
# ---- System deps ----
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
build-essential \
|
| 11 |
+
curl \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# ---- Create non-root user (MANDATORY for HF) ----
|
| 15 |
+
RUN useradd -m -u 1000 user
|
| 16 |
+
|
| 17 |
+
# ---- App directory ----
|
| 18 |
+
WORKDIR /home/user/app
|
| 19 |
+
|
| 20 |
+
# ---- Copy project files ----
|
| 21 |
+
COPY . .
|
| 22 |
+
|
| 23 |
+
# ---- Fix permissions ----
|
| 24 |
+
RUN chown -R user:user /home/user/app
|
| 25 |
+
|
| 26 |
+
# ---- Switch to non-root ----
|
| 27 |
+
USER user
|
| 28 |
+
|
| 29 |
+
# ---- Python deps (CPU-safe) ----
|
| 30 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 31 |
+
pip install --no-cache-dir \
|
| 32 |
+
fastapi \
|
| 33 |
+
uvicorn \
|
| 34 |
+
transformers \
|
| 35 |
+
sentencepiece \
|
| 36 |
+
llama-cpp-python \
|
| 37 |
+
psutil
|
| 38 |
+
|
| 39 |
+
# ---- HF ONLY exposes this port ----
|
| 40 |
+
EXPOSE 7860
|
| 41 |
+
|
| 42 |
+
# ---- RUN app.py (THIS IS THE FIX) ----
|
| 43 |
+
CMD ["python", "app.py"]
|