# Monitoração DeepSeek Ollama

Link: [https://blog.networkchuck.com/posts/is-deepseek-safe-to-run-locally/](https://blog.networkchuck.com/posts/is-deepseek-safe-to-run-locally/)

<header class="header" id="bkmrk-is-deepseek-safe-to-"><nav class="navigation-menu">[Is DeepSeek Safe To Run (locally)](https://blog.networkchuck.com/posts/is-deepseek-safe-to-run-locally/)

</nav></header><div class="content" id="bkmrk-2025-01-31-%23networkc"><article class="post"><div class="post-meta" style="text-align: justify;"><time class="post-date">2025-01-31</time></div><span class="post-tags">\#[NetworkChuck](https://blog.networkchuck.com/tags/networkchuck/) </span>#### Monitor Network Connections

##### Windows

```powershell
while($true) {
    Get-Process ollama | ForEach-Object { 
        $id = $_.Id
        Write-Host "`nConnections for Ollama process $id" -ForegroundColor Green
        Get-NetTCPConnection | Where-Object OwningProcess -eq $id | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State 
    }
    Start-Sleep -Seconds 2
    Clear-Host
}

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div>##### Mac

```bash
# One-time check
pid=$(pgrep ollama)
lsof -i -P -n | grep ollama

# For continuous monitoring
while true; do
    echo "$(date): Ollama Connections"
    lsof -i -P -n | grep ollama
    sleep 2
    clear
done

# Alternative using netstat
netstat -p tcp -v | grep ollama

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div>#### Linux

```bash
# One-time check
pid=$(pgrep ollama)
lsof -i -P -n | grep ollama

# Or for continuous monitoring
watch -n 2 "lsof -i -P -n | grep ollama"

# Alternative using netstat
netstat -np | grep ollama

# Or using ss (more modern)
ss -np | grep ollama

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div>#### Running Ollama Inside Docker

```bash
docker run -d \
--gpus all \
-v ollama:/root/.ollama \
-p 11434:11434 \
--security-opt=no-new-privileges \
--cap-drop=ALL \
--cap-add=SYS_NICE \
--memory=8g \
--memory-swap=8g \
--cpus=4 \
--read-only \
--name ollama \
ollama/ollama

```

<div class="post-content" style="text-align: justify;"><div><div class="highlight"><div class="code-toolbar"><div class="toolbar"><div class="toolbar-item"><button class="copy-to-clipboard-button" data-copy-state="copy" type="button">Copy</button></div></div></div></div></div></div><div class="pagination"><div class="pagination__title" style="text-align: justify;">  
</div></div></article></div>