No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-26 18:37:45 +00:00
defaults update 2026-09-26 18:37:45 +00:00
files update 2026-09-26 18:37:45 +00:00
meta update 2026-09-26 18:37:45 +00:00
tasks update 2026-09-26 18:37:45 +00:00
templates update 2026-09-26 18:37:45 +00:00
.gitignore update 2026-09-26 18:37:45 +00:00
LICENSE update 2026-09-26 18:37:45 +00:00
README.md update 2026-09-26 18:37:45 +00:00

ansible-role-litellm

Deploys a rootless podman LiteLLM proxy with Postgres.

References:

Variables

Production secrets should be defined in inventory or Ansible Vault:

  • litellm_database_password
  • litellm_master_key
  • litellm_salt_key

Useful deployment variables:

litellm_listen: 127.0.0.1:4000
litellm_image_tag: main-stable
litellm_custom_env:
  OPENAI_API_KEY: "{{ litellm_openai_api_key }}"

Use an existing external database by disabling the bundled Postgres container and pointing LiteLLM at the external host:

litellm_database_disabled: true
litellm_database_host: postgres.internal.example
litellm_database_port: 5432
litellm_database_name: litellm
litellm_database_user: litellm
litellm_database_password: "{{ vault_litellm_database_password }}"

Add models through litellm_model_list:

litellm_model_list:
  - model_name: gpt-5
    litellm_params:
      model: openai/gpt-5
      api_key: os.environ/OPENAI_API_KEY

Additional LiteLLM config sections can be supplied with:

  • litellm_litellm_settings
  • litellm_general_settings
  • litellm_router_settings

The role writes config.yaml under the service user's config directory and mounts it at /app/config.yaml.

Deployment Example

- name: Setup LiteLLM
  hosts: litellm
  become: true
  roles:
    - role: litellm
      litellm_listen: 127.0.0.1:4000
      litellm_database_disabled: true
      litellm_database_host: postgres.internal.example
      litellm_database_name: litellm
      litellm_database_user: litellm
      litellm_database_password: "{{ vault_litellm_database_password }}"
      litellm_master_key: "{{ vault_litellm_master_key }}"
      litellm_salt_key: "{{ vault_litellm_salt_key }}"
      litellm_custom_env:
        OPENAI_API_KEY: "{{ vault_litellm_openai_api_key }}"
      litellm_model_list:
        - model_name: gpt-5
          litellm_params:
            model: openai/gpt-5
            api_key: os.environ/OPENAI_API_KEY