If prompt evaluation (prefill) is slow while generation (decoding) is normal, the bottleneck is likely in how the GPU is handling the initial batch of tokens.

### 1. GPU Offloading & Backend
*   **Verify Full Offload:** Ensure all layers are on the GPU. Check your `-ngl` (or `--n-gpu-layers`) value. If any layers remain on the CPU, prefill speed drops drastically.
*   **Confirm CUDA/Metal/Vulkan:** Check the startup logs. Ensure it says `BLAS = 1` or specifically mentions the GPU backend (e.g., `CUDA` or `Metal`). If it says `BLAS = 0`, you are running on CPU.

### 2. Batch Size Configuration
*   **Increase Batch Size (`-b` / `--batch-size`):** This controls how many tokens are processed simultaneously during prefill. If this is set too low (e.g., 512), large prompts are processed in too many small chunks. Try increasing it to `2048` or `4096` if VRAM allows.
*   **Physical Batch Size (`-ub` / `--ubatch-size`):** Ensure your physical batch size is optimized. Usually, keeping this equal to or smaller than `-b` is standard, but mismatched values can cause overhead.

### 3. Memory & Optimization
*   **Enable Flash Attention (`--flash-attn`):** This is the most significant optimization for prompt evaluation. It reduces memory bandwidth requirements and speeds up the prefill phase.
*   **Check VRAM Headroom:** Run `nvidia-smi` during the prompt eval phase. If VRAM is completely maxed out, the system may be swapping to system RAM (slow) or triggering aggressive memory management.
*   **KV Cache Quantization:** If you are hitting VRAM limits, use `-ctk` (cache type k) and `-ctv` (cache type v) to quantize the KV cache (e.g., `f16` $\rightarrow$ `q8_0` or `q4_0`).

### 4. Model & Hardware
*   **Quantization Level:** Ensure you are using a GGUF quantization (e.g., Q4_K_M) that fits comfortably in VRAM.
*   **PCIe Bandwidth:** If using an external GPU or a riser, ensure you are on PCIe Gen 3/4 x16. Slow bus speeds impact the initial transfer of the prompt to the GPU.

### Summary Checklist for Command Line:
```bash
# Example of an optimized command for a single GPU
./server -m model.gguf -ngl 99 -b 2048 --flash-attn
```
*   `-ngl 99`: Force all layers to GPU.
*   `-b 2048`: Increase prompt processing throughput.
*   `--flash-attn`: Accelerate prefill and reduce memory.