Skip to main content

Overview

Pensar Apex supports local vLLM models for offline penetration testing without relying on cloud API providers. This enables:
  • Air-gapped testing - Run pentests in isolated networks without internet access
  • Cost savings - No per-token API charges
  • Data privacy - All inference happens locally
  • Custom models - Use fine-tuned models optimized for security testing
Anthropic models (Claude) provide the best performance for penetration testing. vLLM is recommended for specialized use cases where cloud APIs are not feasible.

What is vLLM?

vLLM is a high-throughput inference engine for large language models. It provides:
  • Fast inference with PagedAttention and continuous batching
  • OpenAI-compatible API - drop-in replacement for OpenAI endpoints
  • Quantization support - run large models on consumer GPUs
  • Multi-GPU support - scale inference across multiple GPUs

Quick Start

1

Install vLLM

Install vLLM with GPU support:
2

Start vLLM Server

Launch the vLLM server with your chosen model:
Or with Docker:
3

Configure Apex

Set the LOCAL_MODEL_URL environment variable:
Or add to .env:
4

Select Local Model in Apex

In the Apex TUI, navigate to the Models screen:
  1. Enter your model name in the “Custom local model (vLLM)” input
  2. Example: meta-llama/Llama-3.1-70B-Instruct
  3. The model will now appear in the model selection list
5

Run Pentest with Local Model

Configuration

Environment Variables

Apex detects local model configuration via LOCAL_MODEL_URL:
Options:

Provider Configuration

vLLM endpoints are OpenAI-compatible, so no API key is required.

Model Selection

Apex automatically adds your configured local model to the available models list:
The model name you provide in the TUI becomes the model ID used for API requests.

For Penetration Testing

These open-source models perform well for security testing:
Open-source models do not match Claude 4.5 Sonnet in security reasoning and vulnerability detection. Use Anthropic models when possible.

Quantization Options

For consumer GPUs, use quantized models: Example with quantization:

vLLM Server Setup

Standalone Server

Docker Deployment

Docker Compose for vLLM + Apex

Start both services:

Multi-Node Setup

For large models across multiple machines:

Verifying vLLM Setup

Test the Endpoint

Expected output:

Test Completion

Check Apex Detection

Expected output:

Performance Tuning

GPU Memory Optimization

Batch Processing

Quantization

Troubleshooting

”LOCAL_MODEL_URL not detected”

Cause: Environment variable not set. Solution:

“Connection refused” to vLLM

Cause: vLLM server not running or wrong port. Solution:
  1. Check vLLM is running: curl http://localhost:8000/v1/models
  2. Verify port: netstat -tuln | grep 8000
  3. Check Docker networking if using containers:

“Out of memory” on vLLM

Cause: Model too large for available VRAM. Solutions:
  1. Use a smaller model (8B instead of 70B)
  2. Enable quantization (INT8 or INT4)
  3. Reduce --gpu-memory-utilization to 0.8
  4. Reduce --max-model-len to limit context size
  5. Add more GPUs with --tensor-parallel-size

”Model not found” in Apex

Cause: Model name mismatch between vLLM and Apex. Solution:
  1. Check the exact model ID from vLLM:
  2. Use that exact ID in Apex:

Slow inference

Cause: Model too large, insufficient GPU compute. Solutions:
  1. Use a smaller/faster model (8B or 13B)
  2. Enable quantization
  3. Increase --tensor-parallel-size to use more GPUs
  4. Check GPU utilization: nvidia-smi

Comparing Cloud vs Local Models

Use Anthropic for production pentests. vLLM is best for:
  • Air-gapped environments
  • High-volume testing (cost savings)
  • Custom fine-tuned models
  • Data sovereignty requirements

Advanced: Fine-Tuning for Security

To create a custom security-focused model:
1

Prepare Training Data

Collect vulnerability reports, exploit descriptions, and security documentation:
2

Fine-Tune Base Model

Use frameworks like Axolotl or LLaMA Factory:
3

Serve Fine-Tuned Model

4

Use in Apex

Alternative Local Inference Engines

vLLM is recommended, but Apex also supports other OpenAI-compatible servers:

Ollama

LM Studio

  1. Download LM Studio
  2. Load a model
  3. Start the local server (port 1234 by default)
  4. Configure Apex:

Text Generation Inference (TGI)

Next Steps

Blackbox Testing

Run blackbox pentests with your local model

Whitebox Testing

Analyze source code using local inference

Docker Setup

Deploy vLLM + Apex in containers

Authentication

Test auth flows with local models