Instructions to use Zrald/zralddeepseekv4.1 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 Zrald/zralddeepseekv4.1 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 Zrald/zralddeepseekv4.1 # Run inference directly in the terminal: llama cli -hf Zrald/zralddeepseekv4.1
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Zrald/zralddeepseekv4.1 # Run inference directly in the terminal: llama cli -hf Zrald/zralddeepseekv4.1
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 Zrald/zralddeepseekv4.1 # Run inference directly in the terminal: ./llama-cli -hf Zrald/zralddeepseekv4.1
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 Zrald/zralddeepseekv4.1 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Zrald/zralddeepseekv4.1
Use Docker
docker model run hf.co/Zrald/zralddeepseekv4.1
- Llama new
- LM Studio
- Jan
- vLLM
How to use Zrald/zralddeepseekv4.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Zrald/zralddeepseekv4.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zrald/zralddeepseekv4.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Zrald/zralddeepseekv4.1
- Ollama
How to use Zrald/zralddeepseekv4.1 with Ollama:
ollama run hf.co/Zrald/zralddeepseekv4.1
- Unsloth Desktop
- Pi
How to use Zrald/zralddeepseekv4.1 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Zrald/zralddeepseekv4.1
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Zrald/zralddeepseekv4.1" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Zrald/zralddeepseekv4.1 with Docker Model Runner:
docker model run hf.co/Zrald/zralddeepseekv4.1
- Lemonade
How to use Zrald/zralddeepseekv4.1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Zrald/zralddeepseekv4.1
Run and chat with the model
lemonade run user.zralddeepseekv4.1-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use Zrald/zralddeepseekv4.1 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Zrald/zralddeepseekv4.1
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Zrald/zralddeepseekv4.1
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Zrald/zralddeepseekv4.1 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Zrald/zralddeepseekv4.1
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Zrald/zralddeepseekv4.1" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download artifacts/task_api.py from Zrald/zralddeepseekv4.1: direct link, hf CLI and curl.
- Browser
- Download file 11.5 kB
-
https://huggingface.co/Zrald/zralddeepseekv4.1/resolve/main/artifacts/task_api.py
- Command line
-
hf download hf://Zrald/zralddeepseekv4.1/artifacts/task_api.py
-
curl -L -o task_api.py https://huggingface.co/Zrald/zralddeepseekv4.1/resolve/main/artifacts/task_api.py
11.5 kB
| """ | |
| Production-style FastAPI Task Manager REST API | |
| Single-file implementation with JWT auth, SQLAlchemy, and SQLite. | |
| Run with: | |
| uvicorn main:app --reload | |
| Then visit http://localhost:8000/docs for interactive API docs. | |
| """ | |
| from datetime import datetime, timedelta | |
| from typing import Optional, List | |
| from fastapi import FastAPI, Depends, HTTPException, status | |
| from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm | |
| from jose import JWTError, jwt | |
| from passlib.context import CryptContext | |
| from pydantic import BaseModel, Field, ConfigDict | |
| from sqlalchemy import create_engine, String, Integer, DateTime, ForeignKey, Boolean | |
| from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, sessionmaker, Session | |
| from sqlalchemy.exc import IntegrityError | |
| # --------------------------------------------------------------------------- | |
| # Configuration | |
| # --------------------------------------------------------------------------- | |
| SECRET_KEY = "change-this-in-production-use-env-var" | |
| ALGORITHM = "HS256" | |
| ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24 # 1 day | |
| DATABASE_URL = "sqlite:///./tasks.db" | |
| # --------------------------------------------------------------------------- | |
| # Database setup | |
| # --------------------------------------------------------------------------- | |
| engine = create_engine( | |
| DATABASE_URL, | |
| connect_args={"check_same_thread": False}, | |
| ) | |
| SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) | |
| class Base(DeclarativeBase): | |
| pass | |
| # --------------------------------------------------------------------------- | |
| # SQLAlchemy Models | |
| # --------------------------------------------------------------------------- | |
| class User(Base): | |
| __tablename__ = "users" | |
| id: Mapped[int] = mapped_column(Integer, primary_key=True, index=True) | |
| username: Mapped[str] = mapped_column(String(50), unique=True, index=True, nullable=False) | |
| email: Mapped[str] = mapped_column(String(120), unique=True, index=True, nullable=False) | |
| hashed_password: Mapped[str] = mapped_column(String(255), nullable=False) | |
| created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow) | |
| class Task(Base): | |
| __tablename__ = "tasks" | |
| id: Mapped[int] = mapped_column(Integer, primary_key=True, index=True) | |
| title: Mapped[str] = mapped_column(String(200), nullable=False) | |
| description: Mapped[Optional[str]] = mapped_column(String(1000), nullable=True) | |
| completed: Mapped[bool] = mapped_column(Boolean, default=False) | |
| owner_id: Mapped[int] = mapped_column(Integer, ForeignKey("users.id"), nullable=False) | |
| created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow) | |
| # --------------------------------------------------------------------------- | |
| # Pydantic Schemas | |
| # --------------------------------------------------------------------------- | |
| class UserCreate(BaseModel): | |
| username: str = Field(..., min_length=3, max_length=50) | |
| email: str = Field(..., max_length=120) | |
| password: str = Field(..., min_length=6, max_length=100) | |
| class UserOut(BaseModel): | |
| model_config = ConfigDict(from_attributes=True) | |
| id: int | |
| username: str | |
| email: str | |
| created_at: datetime | |
| class TaskCreate(BaseModel): | |
| title: str = Field(..., min_length=1, max_length=200) | |
| description: Optional[str] = Field(None, max_length=1000) | |
| completed: bool = False | |
| class TaskUpdate(BaseModel): | |
| title: Optional[str] = Field(None, min_length=1, max_length=200) | |
| description: Optional[str] = Field(None, max_length=1000) | |
| completed: Optional[bool] = None | |
| class TaskOut(BaseModel): | |
| model_config = ConfigDict(from_attributes=True) | |
| id: int | |
| title: str | |
| description: Optional[str] | |
| completed: bool | |
| owner_id: int | |
| created_at: datetime | |
| class Token(BaseModel): | |
| access_token: str | |
| token_type: str | |
| class TokenData(BaseModel): | |
| username: Optional[str] = None | |
| # --------------------------------------------------------------------------- | |
| # Security / Auth helpers | |
| # --------------------------------------------------------------------------- | |
| pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") | |
| oauth2_scheme = OAuth2PasswordBearer(tokenUrl="auth/login") | |
| def verify_password(plain_password: str, hashed_password: str) -> bool: | |
| return pwd_context.verify(plain_password, hashed_password) | |
| def get_password_hash(password: str) -> str: | |
| return pwd_context.hash(password) | |
| def create_access_token(data: dict, expires_delta: Optional[timedelta] = None) -> str: | |
| to_encode = data.copy() | |
| expire = datetime.utcnow() + (expires_delta or timedelta(minutes=15)) | |
| to_encode.update({"exp": expire}) | |
| return jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM) | |
| # --------------------------------------------------------------------------- | |
| # FastAPI App | |
| # --------------------------------------------------------------------------- | |
| app = FastAPI( | |
| title="Task Manager API", | |
| description="A production-style FastAPI task manager with JWT auth.", | |
| version="1.0.0", | |
| ) | |
| # --------------------------------------------------------------------------- | |
| # Dependency: get DB session | |
| # --------------------------------------------------------------------------- | |
| def get_db(): | |
| db = SessionLocal() | |
| try: | |
| yield db | |
| finally: | |
| db.close() | |
| # --------------------------------------------------------------------------- | |
| # Dependency: get current user from JWT | |
| # --------------------------------------------------------------------------- | |
| def get_current_user( | |
| token: str = Depends(oauth2_scheme), | |
| db: Session = Depends(get_db), | |
| ) -> User: | |
| credentials_exception = HTTPException( | |
| status_code=status.HTTP_401_UNAUTHORIZED, | |
| detail="Could not validate credentials", | |
| headers={"WWW-Authenticate": "Bearer"}, | |
| ) | |
| try: | |
| payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM]) | |
| username: str = payload.get("sub") | |
| if username is None: | |
| raise credentials_exception | |
| token_data = TokenData(username=username) | |
| except JWTError: | |
| raise credentials_exception | |
| user = db.query(User).filter(User.username == token_data.username).first() | |
| if user is None: | |
| raise credentials_exception | |
| return user | |
| # --------------------------------------------------------------------------- | |
| # Routes: Authentication | |
| # --------------------------------------------------------------------------- | |
| def register_user(user: UserCreate, db: Session = Depends(get_db)): | |
| """Register a new user.""" | |
| existing = db.query(User).filter( | |
| (User.username == user.username) | (User.email == user.email) | |
| ).first() | |
| if existing: | |
| raise HTTPException( | |
| status_code=status.HTTP_400_BAD_REQUEST, | |
| detail="Username or email already registered", | |
| ) | |
| db_user = User( | |
| username=user.username, | |
| email=user.email, | |
| hashed_password=get_password_hash(user.password), | |
| ) | |
| db.add(db_user) | |
| db.commit() | |
| db.refresh(db_user) | |
| return db_user | |
| def login(form_data: OAuth2PasswordRequestForm = Depends(), db: Session = Depends(get_db)): | |
| """Login and receive a JWT access token.""" | |
| user = db.query(User).filter(User.username == form_data.username).first() | |
| if not user or not verify_password(form_data.password, user.hashed_password): | |
| raise HTTPException( | |
| status_code=status.HTTP_401_UNAUTHORIZED, | |
| detail="Incorrect username or password", | |
| headers={"WWW-Authenticate": "Bearer"}, | |
| ) | |
| access_token = create_access_token( | |
| data={"sub": user.username}, | |
| expires_delta=timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES), | |
| ) | |
| return {"access_token": access_token, "token_type": "bearer"} | |
| def read_current_user(current_user: User = Depends(get_current_user)): | |
| """Get current authenticated user's profile.""" | |
| return current_user | |
| # --------------------------------------------------------------------------- | |
| # Routes: Tasks CRUD (owner-only) | |
| # --------------------------------------------------------------------------- | |
| def create_task( | |
| task: TaskCreate, | |
| current_user: User = Depends(get_current_user), | |
| db: Session = Depends(get_db), | |
| ): | |
| """Create a new task owned by the current user.""" | |
| db_task = Task( | |
| title=task.title, | |
| description=task.description, | |
| completed=task.completed, | |
| owner_id=current_user.id, | |
| ) | |
| db.add(db_task) | |
| db.commit() | |
| db.refresh(db_task) | |
| return db_task | |
| def list_tasks( | |
| current_user: User = Depends(get_current_user), | |
| db: Session = Depends(get_db), | |
| ): | |
| """List all tasks owned by the current user.""" | |
| return db.query(Task).filter(Task.owner_id == current_user.id).all() | |
| def get_task( | |
| task_id: int, | |
| current_user: User = Depends(get_current_user), | |
| db: Session = Depends(get_db), | |
| ): | |
| """Get a single task by ID (owner-only).""" | |
| task = db.query(Task).filter(Task.id == task_id).first() | |
| if not task: | |
| raise HTTPException(status_code=404, detail="Task not found") | |
| if task.owner_id != current_user.id: | |
| raise HTTPException(status_code=403, detail="Not authorized to view this task") | |
| return task | |
| def update_task( | |
| task_id: int, | |
| task_update: TaskUpdate, | |
| current_user: User = Depends(get_current_user), | |
| db: Session = Depends(get_db), | |
| ): | |
| """Update an existing task (owner-only).""" | |
| task = db.query(Task).filter(Task.id == task_id).first() | |
| if not task: | |
| raise HTTPException(status_code=404, detail="Task not found") | |
| if task.owner_id != current_user.id: | |
| raise HTTPException(status_code=403, detail="Not authorized to edit this task") | |
| update_data = task_update.model_dump(exclude_unset=True) | |
| for field, value in update_data.items(): | |
| setattr(task, field, value) | |
| db.commit() | |
| db.refresh(task) | |
| return task | |
| def delete_task( | |
| task_id: int, | |
| current_user: User = Depends(get_current_user), | |
| db: Session = Depends(get_db), | |
| ): | |
| """Delete a task (owner-only).""" | |
| task = db.query(Task).filter(Task.id == task_id).first() | |
| if not task: | |
| raise HTTPException(status_code=404, detail="Task not found") | |
| if task.owner_id != current_user.id: | |
| raise HTTPException(status_code=403, detail="Not authorized to delete this task") | |
| db.delete(task) | |
| db.commit() | |
| return None | |
| # --------------------------------------------------------------------------- | |
| # Entrypoint | |
| # --------------------------------------------------------------------------- | |
| if __name__ == "__main__": | |
| import uvicorn | |
| uvicorn.run(app, host="0.0.0.0", port=8000) | |