Text Generation
Transformers
Safetensors
GGUF
swarm_moe
causal-lm
mixture-of-experts
swarm
agentic-runtime
smolagents
trust-remote-code
bf16
qwen-tokenizer
ollama-compatible-bridge
gguf-preview
full-runtime
conversational
custom_code
Instructions to use ayjays132/PhillSwarm-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayjays132/PhillSwarm-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ayjays132/PhillSwarm-4b", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ayjays132/PhillSwarm-4b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ayjays132/PhillSwarm-4b 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 ayjays132/PhillSwarm-4b:F16 # Run inference directly in the terminal: llama cli -hf ayjays132/PhillSwarm-4b:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ayjays132/PhillSwarm-4b:F16 # Run inference directly in the terminal: llama cli -hf ayjays132/PhillSwarm-4b:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ayjays132/PhillSwarm-4b:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf ayjays132/PhillSwarm-4b:F16
Use Docker
docker model run hf.co/ayjays132/PhillSwarm-4b:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use ayjays132/PhillSwarm-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayjays132/PhillSwarm-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayjays132/PhillSwarm-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ayjays132/PhillSwarm-4b:F16
- SGLang
How to use ayjays132/PhillSwarm-4b 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 "ayjays132/PhillSwarm-4b" \ --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": "ayjays132/PhillSwarm-4b", "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 "ayjays132/PhillSwarm-4b" \ --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": "ayjays132/PhillSwarm-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ayjays132/PhillSwarm-4b with Ollama:
ollama run hf.co/ayjays132/PhillSwarm-4b:F16
- Unsloth Desktop
- Pi
How to use ayjays132/PhillSwarm-4b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ayjays132/PhillSwarm-4b:F16
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": "ayjays132/PhillSwarm-4b:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ayjays132/PhillSwarm-4b with Docker Model Runner:
docker model run hf.co/ayjays132/PhillSwarm-4b:F16
- Lemonade
How to use ayjays132/PhillSwarm-4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ayjays132/PhillSwarm-4b:F16
Run and chat with the model
lemonade run user.PhillSwarm-4b-F16
List all available models
lemonade list
- Hermes Agent
How to use ayjays132/PhillSwarm-4b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ayjays132/PhillSwarm-4b:F16
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 ayjays132/PhillSwarm-4b:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ayjays132/PhillSwarm-4b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ayjays132/PhillSwarm-4b:F16
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 "ayjays132/PhillSwarm-4b:F16" \ --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 launch_swarm_app.py from ayjays132/PhillSwarm-4b: direct link, hf CLI and curl.
- Browser
- Download file 5.63 kB
-
https://huggingface.co/ayjays132/PhillSwarm-4b/resolve/main/launch_swarm_app.py
- Command line
-
hf download hf://ayjays132/PhillSwarm-4b/launch_swarm_app.py
-
curl -L -o launch_swarm_app.py https://huggingface.co/ayjays132/PhillSwarm-4b/resolve/main/launch_swarm_app.py
5.63 kB
| """Launch the local Phill Swarm App. | |
| Portable launcher: | |
| py launch_swarm_app.py --install | |
| python scripts/launch_swarm_app.py --install --config configs/phill_swarm_app.json | |
| The same file works from a source checkout or from a packaged HF snapshot. | |
| """ | |
| import argparse | |
| import importlib.util | |
| import os | |
| from pathlib import Path | |
| import shutil | |
| import subprocess | |
| import sys | |
| def _detect_root() -> Path: | |
| here = Path(__file__).resolve() | |
| candidates = [here.parent, Path.cwd()] | |
| if len(here.parents) > 1: | |
| candidates.append(here.parents[1]) | |
| for root in candidates: | |
| if (root / "swarm_app_config.example.json").exists() or (root / "config.json").exists(): | |
| return root.resolve() | |
| if (root / "configs" / "phill_swarm_app.json").exists(): | |
| return root.resolve() | |
| if (root / "src" / "swarm_moe_model").exists(): | |
| return root.resolve() | |
| return here.parent.resolve() | |
| PROJECT_ROOT = _detect_root() | |
| SRC_ROOT = PROJECT_ROOT / "src" | |
| if SRC_ROOT.exists(): | |
| sys.path.insert(0, str(SRC_ROOT)) | |
| from swarm_moe_model.swarm_app import SwarmAppConfig, run_app # noqa: E402 | |
| def _run(cmd, cwd=None, timeout=600): | |
| print(f"[swarm-app] run: {' '.join(str(x) for x in cmd)}") | |
| return subprocess.run(cmd, cwd=str(cwd) if cwd else None, check=True, timeout=timeout) | |
| def _default_config() -> Path: | |
| candidates = [ | |
| PROJECT_ROOT / "swarm_app_config.example.json", | |
| Path.cwd() / "swarm_app_config.example.json", | |
| PROJECT_ROOT / "configs" / "phill_swarm_app.json", | |
| ] | |
| for path in candidates: | |
| if path.exists(): | |
| return path.resolve() | |
| return candidates[0] | |
| def _tools_dir(explicit: str | None = None) -> Path: | |
| if explicit: | |
| return Path(os.path.expandvars(explicit)).expanduser().resolve() | |
| candidates = [ | |
| PROJECT_ROOT / "src" / "swarm_moe_model" / "Tools", | |
| PROJECT_ROOT / "swarm_moe_model" / "Tools", | |
| ] | |
| spec = importlib.util.find_spec("swarm_moe_model") | |
| if spec and spec.submodule_search_locations: | |
| candidates.append(Path(list(spec.submodule_search_locations)[0]) / "Tools") | |
| for path in candidates: | |
| if path.exists(): | |
| return path.resolve() | |
| return candidates[0].resolve() | |
| def ensure_python_extras(include_browser: bool = True): | |
| packages = [] | |
| if importlib.util.find_spec("ddgs") is None and importlib.util.find_spec("duckduckgo_search") is None: | |
| packages.append("ddgs") | |
| if include_browser and importlib.util.find_spec("playwright") is None: | |
| packages.append("playwright") | |
| if importlib.util.find_spec("yaml") is None: | |
| packages.append("pyyaml") | |
| if packages: | |
| _run([sys.executable, "-m", "pip", "install", *packages], cwd=PROJECT_ROOT) | |
| if include_browser: | |
| try: | |
| import playwright # noqa: F401 | |
| _run([sys.executable, "-m", "playwright", "install", "chromium"], cwd=PROJECT_ROOT, timeout=1200) | |
| except Exception as exc: | |
| print(f"[swarm-app] WARN playwright browser install skipped/failed: {exc}") | |
| def ensure_npm_tools(tools_dir: Path): | |
| npm = shutil.which("npm.cmd" if os.name == "nt" else "npm") or shutil.which("npm") | |
| if npm is None: | |
| print("[swarm-app] WARN npm not found; Python tools still work, Wrench TypeScript tools remain catalogued.") | |
| return | |
| if not (tools_dir / "package.json").exists(): | |
| print("[swarm-app] WARN Tools/package.json not found; skipping npm install.") | |
| return | |
| command = "ci" if (tools_dir / "package-lock.json").exists() else "install" | |
| _run([npm, command], cwd=tools_dir, timeout=1200) | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--config", default=str(_default_config())) | |
| ap.add_argument("--host", default=None) | |
| ap.add_argument("--port", type=int, default=None) | |
| ap.add_argument("--model", default=None) | |
| ap.add_argument("--permission-mode", choices=["default", "yolo"], default=None) | |
| ap.add_argument("--install", action="store_true", help="install optional DDGS/Playwright/npm tool dependencies before launch") | |
| ap.add_argument("--no-browser-install", action="store_true") | |
| ap.add_argument("--no-npm-install", action="store_true") | |
| ap.add_argument("--tools-dir", default=None, help="optional Tools directory for npm install") | |
| ap.add_argument("--headless", action="store_true", help="run Playwright browser tools headless to save memory") | |
| ap.add_argument("--visible-browser", action="store_true", help="force visible Playwright browser windows for browser tools") | |
| ap.add_argument("--capture-dir", default=None, help="browser snapshot directory; defaults to state/browser_captures") | |
| ap.add_argument("--no-open", action="store_true") | |
| args = ap.parse_args() | |
| if args.install: | |
| ensure_python_extras(include_browser=not args.no_browser_install) | |
| if not args.no_npm_install: | |
| ensure_npm_tools(_tools_dir(args.tools_dir)) | |
| cfg = SwarmAppConfig.from_json(args.config) | |
| if args.host: | |
| cfg.host = args.host | |
| if args.port: | |
| cfg.port = args.port | |
| if args.model: | |
| cfg.model_path = args.model | |
| cfg.swarm_config = None | |
| if args.permission_mode: | |
| cfg.permission_mode = args.permission_mode | |
| if args.headless: | |
| cfg.browser_headless = True | |
| if args.visible_browser: | |
| cfg.browser_headless = False | |
| if args.capture_dir: | |
| cfg.browser_capture_dir = args.capture_dir | |
| if args.no_open: | |
| cfg.auto_open = False | |
| run_app(cfg, project_root=PROJECT_ROOT) | |
| if __name__ == "__main__": | |
| main() | |