Instructions to use kofdai/nullai-phi-4-14b-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use kofdai/nullai-phi-4-14b-v2 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 kofdai/nullai-phi-4-14b-v2:F16 # Run inference directly in the terminal: llama cli -hf kofdai/nullai-phi-4-14b-v2:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kofdai/nullai-phi-4-14b-v2:F16 # Run inference directly in the terminal: llama cli -hf kofdai/nullai-phi-4-14b-v2:F16
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 kofdai/nullai-phi-4-14b-v2:F16 # Run inference directly in the terminal: ./llama-cli -hf kofdai/nullai-phi-4-14b-v2:F16
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 kofdai/nullai-phi-4-14b-v2:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf kofdai/nullai-phi-4-14b-v2:F16
Use Docker
docker model run hf.co/kofdai/nullai-phi-4-14b-v2:F16
- LM Studio
- Jan
- Ollama
How to use kofdai/nullai-phi-4-14b-v2 with Ollama:
ollama run hf.co/kofdai/nullai-phi-4-14b-v2:F16
- Unsloth Desktop
- Docker Model Runner
How to use kofdai/nullai-phi-4-14b-v2 with Docker Model Runner:
docker model run hf.co/kofdai/nullai-phi-4-14b-v2:F16
- Lemonade
How to use kofdai/nullai-phi-4-14b-v2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kofdai/nullai-phi-4-14b-v2:F16
Run and chat with the model
lemonade run user.nullai-phi-4-14b-v2-F16
List all available models
lemonade list
- Atomic Chat
Add Dockerfile for HuggingFace Spaces deployment
Browse files- Dockerfile +89 -0
Dockerfile
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Multi-stage build for NullAI Phi-4 Knowledge System
|
| 2 |
+
# Optimized for HuggingFace Spaces deployment
|
| 3 |
+
|
| 4 |
+
# Stage 1: Build frontend
|
| 5 |
+
FROM node:18-alpine AS frontend-builder
|
| 6 |
+
|
| 7 |
+
WORKDIR /app/frontend
|
| 8 |
+
|
| 9 |
+
# Copy package files
|
| 10 |
+
COPY frontend/package*.json ./
|
| 11 |
+
|
| 12 |
+
# Install dependencies
|
| 13 |
+
RUN npm ci --only=production
|
| 14 |
+
|
| 15 |
+
# Copy frontend source
|
| 16 |
+
COPY frontend/ ./
|
| 17 |
+
|
| 18 |
+
# Build frontend
|
| 19 |
+
RUN npm run build
|
| 20 |
+
|
| 21 |
+
# Stage 2: Python backend
|
| 22 |
+
FROM python:3.11-slim
|
| 23 |
+
|
| 24 |
+
LABEL maintainer="Kodai Motonishi <kodai820820@gmail.com>"
|
| 25 |
+
LABEL description="NullAI Phi-4 14B Knowledge Management System"
|
| 26 |
+
|
| 27 |
+
WORKDIR /app
|
| 28 |
+
|
| 29 |
+
# Install system dependencies
|
| 30 |
+
RUN apt-get update && apt-get install -y \
|
| 31 |
+
gcc \
|
| 32 |
+
g++ \
|
| 33 |
+
make \
|
| 34 |
+
curl \
|
| 35 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 36 |
+
|
| 37 |
+
# Copy backend requirements
|
| 38 |
+
COPY backend/requirements.txt ./backend/
|
| 39 |
+
|
| 40 |
+
# Install Python dependencies
|
| 41 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 42 |
+
pip install --no-cache-dir -r backend/requirements.txt
|
| 43 |
+
|
| 44 |
+
# Copy backend code
|
| 45 |
+
COPY backend/ ./backend/
|
| 46 |
+
|
| 47 |
+
# Copy frontend build from previous stage
|
| 48 |
+
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
|
| 49 |
+
|
| 50 |
+
# Copy configuration files
|
| 51 |
+
COPY models_config.json domains_config.json null_ai_config.json* ./
|
| 52 |
+
|
| 53 |
+
# Copy utility scripts (optional)
|
| 54 |
+
COPY db_manager.py* inference_engine_unified.py* runner_engine.py* ./ || true
|
| 55 |
+
|
| 56 |
+
# Copy import tools
|
| 57 |
+
COPY import_iath.py batch_import_iath.sh ./
|
| 58 |
+
|
| 59 |
+
# Create necessary directories
|
| 60 |
+
RUN mkdir -p /app/data /app/uploads
|
| 61 |
+
|
| 62 |
+
# Set environment variables for HuggingFace Spaces
|
| 63 |
+
ENV PYTHONPATH=/app
|
| 64 |
+
ENV PYTHONUNBUFFERED=1
|
| 65 |
+
ENV HOST=0.0.0.0
|
| 66 |
+
ENV PORT=7860
|
| 67 |
+
|
| 68 |
+
# Database configuration
|
| 69 |
+
ENV DATABASE_URL=sqlite:////app/data/nullai_knowledge.db
|
| 70 |
+
|
| 71 |
+
# Security settings
|
| 72 |
+
ENV SECRET_KEY=changeme-in-production
|
| 73 |
+
|
| 74 |
+
# CORS settings (will be updated in Spaces)
|
| 75 |
+
ENV CORS_ORIGINS='["https://kofdai-nullai-knowledge-system.hf.space"]'
|
| 76 |
+
|
| 77 |
+
# Expose port (HuggingFace Spaces standard)
|
| 78 |
+
EXPOSE 7860
|
| 79 |
+
|
| 80 |
+
# Health check
|
| 81 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
| 82 |
+
CMD curl -f http://localhost:7860/api/system/health || exit 1
|
| 83 |
+
|
| 84 |
+
# Initialize database and start application
|
| 85 |
+
CMD python backend/create_db.py && \
|
| 86 |
+
uvicorn backend.app.main:app \
|
| 87 |
+
--host 0.0.0.0 \
|
| 88 |
+
--port 7860 \
|
| 89 |
+
--log-level info
|