Home/Inference & Serving/deploy-llms-with-ansible
deploy-llms-with-ansible logo

deploy-llms-with-ansible

xamey/deploy-llms-with-ansible

Easily deploy LLMs using Ansible

GraphCanon updated today · GitHub synced today

3
Stars
0
Forks
0
Open issues
1
Watchers
1y
Last push
Created May 1, 2025

Trust & integrity

Full report
Maintenance
Dormant (435d since push)
As of today · Source: github_public_v1
Provenance
Not a fork · Personal account
As of today · Source: github_public_v1
Security (OSV)
No lockfile
As of today · Source: none

Public GitHub metadata and optional OSV dependency scans. Signals, not a guarantee. Trust methodology.

Overview

This repository facilitates the deployment of Large Language Models (LLMs) using Ansible scripts that can deploy either Ollama or llama.cpp on a Debian-based VM with Docker. It ensures security by allowing access only from whitelisted IPs.

Capability facts

No sourced capability facts yet. Facts appear after ingest scans repo manifests (Dockerfile, package.json, MCP configs).

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

OpenAI APIOpenAI API

Source: README excerpt (regex_v1, Jul 11, 2026)

The server will be available on port 8080. You can make requests using the OpenAI API specification.
Source link

Tags

README

Deploy LLMs with Ansible

Deploy and serve LLMs using either Ollama or llama.cpp on a Debian-based VM. Only whitelisted IPs will be able to request it.

Prerequisites

  • Ansible installed on your local machine
  • Debian-based VM with Docker installed
  • SSH access to the VM

Configuration

Modify the inventory files under ollama or llamacpp folders, depending on which technology you want to use.

Each folder contains an inventory.example.yml file that you can use as a template. Copy the example file to create your own inventory.yml:

# For Ollama
cp ollama/inventory.example.yml ollama/inventory.yml

# For llama.cpp
cp llamacpp/inventory.example.yml llamacpp/inventory.yml

Then modify the inventory.yml file with your specific configuration.

llama.cpp Configuration

Configure the following variables in your inventory file:

  • ansible_host: The IP address of your VM
  • ansible_user: The SSH username for connection
  • ansible_ssh_private_key_file: Path to your SSH private key file
  • model_url: URL to the GGUF model file
  • allowed_ip_for_8080: IP addresses allowed to access the server (port 8080)

Ollama Configuration

Configure the following variables in your inventory file:

  • ansible_host: The IP address of your VM
  • ansible_user: The SSH username for connection
  • ansible_ssh_private_key_file: Path to your SSH private key file
  • model_name: The model name as defined in Ollama library (e.g., for Qwen3-0.6B, use qwen3:0.6b)
  • allowed_ip_for_8080: IP addresses allowed to access the server (port 8080)

Deployment

Deploy with Ollama

ansible-playbook -i ollama/inventory.yml ollama/playbook.yml

Deploy with llama.cpp

ansible-playbook -i llamacpp/inventory.yml llamacpp/playbook.yml

API Usage

The server will be available on port 8080. You can make requests using the OpenAI API specification.

Example request:

curl --location 'http://YOUR_VM_IP:8080/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer no-key' \
--data '{
    "model": "your-model-name",
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant"
        },
        {
            "role": "user",
            "content": "Hello, how are you?"
        }
    ]
}'

Model Name Specification

The model field in your request must match exactly with the model you deployed:

  • for Ollama: use the same value as the model_name specified in your inventory.yml file
  • for llama.cpp: value isn't important