Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

zenlm
/
zen-guard-stream-4b

Text Generation
MLX
Safetensors
GGUF
English
qwen3
zen
zenlm
conversational
Model card Files Files and versions
xet
Community

Instructions to use zenlm/zen-guard-stream-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MLX

    How to use zenlm/zen-guard-stream-4b with MLX:

    # Make sure mlx-lm is installed
    # pip install --upgrade mlx-lm
    
    # Generate text with mlx-lm
    from mlx_lm import load, generate
    
    model, tokenizer = load("zenlm/zen-guard-stream-4b")
    
    prompt = "Write a story about Einstein"
    messages = [{"role": "user", "content": prompt}]
    prompt = tokenizer.apply_chat_template(
        messages, add_generation_prompt=True
    )
    
    text = generate(model, tokenizer, prompt=prompt, verbose=True)
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • LM Studio
  • Pi new

    How to use zenlm/zen-guard-stream-4b with Pi:

    Start the MLX server
    # Install MLX LM:
    uv tool install mlx-lm
    # Start a local OpenAI-compatible server:
    mlx_lm.server --model "zenlm/zen-guard-stream-4b"
    Configure the model in Pi
    # Install Pi:
    npm install -g @mariozechner/pi-coding-agent
    # Add to ~/.pi/agent/models.json:
    {
      "providers": {
        "mlx-lm": {
          "baseUrl": "http://localhost:8080/v1",
          "api": "openai-completions",
          "apiKey": "none",
          "models": [
            {
              "id": "zenlm/zen-guard-stream-4b"
            }
          ]
        }
      }
    }
    Run Pi
    # Start Pi in your project directory:
    pi
  • Hermes Agent new

    How to use zenlm/zen-guard-stream-4b with Hermes Agent:

    Start the MLX server
    # Install MLX LM:
    uv tool install mlx-lm
    # Start a local OpenAI-compatible server:
    mlx_lm.server --model "zenlm/zen-guard-stream-4b"
    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 zenlm/zen-guard-stream-4b
    Run Hermes
    hermes
  • MLX LM

    How to use zenlm/zen-guard-stream-4b with MLX LM:

    Generate or start a chat session
    # Install MLX LM
    uv tool install mlx-lm
    # Interactive chat REPL
    mlx_lm.chat --model "zenlm/zen-guard-stream-4b"
    Run an OpenAI-compatible server
    # Install MLX LM
    uv tool install mlx-lm
    # Start the server
    mlx_lm.server --model "zenlm/zen-guard-stream-4b"
    # Calling the OpenAI-compatible server with curl
    curl -X POST "http://localhost:8000/v1/chat/completions" \
       -H "Content-Type: application/json" \
       --data '{
         "model": "zenlm/zen-guard-stream-4b",
         "messages": [
           {"role": "user", "content": "Hello"}
         ]
       }'
zen-guard-stream-4b
6.18 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 8 commits
zeekay's picture
zeekay
Update model card: fix YAML tags, add zen/zenlm branding
30b5d10 verified 3 months ago
  • .gitattributes
    1.52 kB
    initial commit 8 months ago
  • LICENSE
    7.39 kB
    Upload zen-guard-stream with MLX formats 8 months ago
  • README.md
    1.81 kB
    Update model card: fix YAML tags, add zen/zenlm branding 3 months ago
  • config.json
    660 Bytes
    Fix config: Update to Qwen3-4B (remove Qwen2.5 refs) 6 months ago
  • generation_config.json
    242 Bytes
    Upload zen-guard-stream with MLX formats 8 months ago
  • merges.txt
    1.67 MB
    Upload zen-guard-stream with MLX formats 8 months ago
  • model-00001-of-00002.safetensors
    3.97 GB
    xet
    Upload zen-guard-stream with MLX formats 8 months ago
  • model-00002-of-00002.safetensors
    2.2 GB
    xet
    Upload zen-guard-stream with MLX formats 8 months ago
  • model.safetensors.index.json
    35.6 kB
    Upload zen-guard-stream with MLX formats 8 months ago
  • tokenizer.json
    7.03 MB
    Upload zen-guard-stream with MLX formats 8 months ago
  • tokenizer_config.json
    7.29 kB
    Fix model identity in chat template 3 months ago
  • vocab.json
    2.78 MB
    Upload zen-guard-stream with MLX formats 8 months ago