Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
.vault-password.*

# installed roles
roles
roles/*

# this is ours
!roles/usegalaxy_cz.llm_hub
7 changes: 7 additions & 0 deletions files/galaxy/config/llm_hub_data_table_conf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Paths are relative to the value of `tool_data_path` in galaxy.ini -->
<tables>
<table name="llm_models" comment_char="#" allow_duplicate_entries="False">
<columns>value, name, domain, provider, free_tag</columns>
<file path="llm_models.loc" />
</table>
</tables>
1 change: 1 addition & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
- galaxyproject.tusd
- usegalaxy_eu.apptainer
- galaxyproject.galaxy
- usegalaxy_cz.llm_hub
- usegalaxy_eu.tpv_auto_lint
- geerlingguy.redis
- role: usegalaxy_eu.flower
Expand Down
11 changes: 11 additions & 0 deletions group_vars/galaxyservers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ enable_flower: false
enable_tiaas: true
shed_tools_shadowing: false

# LLM Hub placeholders; provide real values in secrets.yml
llm_hub:
token: TOKEN
endpoint: SOMEWHERE


# Galaxy
galaxy_manage_systemd: no
galaxy_create_user: true # False by default, as e.g. you might have a 'galaxy' user provided by LDAP or AD.
Expand Down Expand Up @@ -184,6 +190,7 @@ galaxy_config:
tool_data_table_config_path:
- /cvmfs/data.galaxyproject.org/byhand/location/tool_data_table_conf.xml
- /cvmfs/data.galaxyproject.org/managed/location/tool_data_table_conf.xml
- "{{ galaxy_config_dir }}/llm_hub_data_table_conf.xml"
# Tool Dependencies
dependency_resolvers: {}
container_resolvers:
Expand Down Expand Up @@ -261,6 +268,8 @@ galaxy_config_files_public:
dest: "{{ galaxy_server_dir }}/static/eu_msmt_eosc.svg"
- src: files/galaxy/static/e-infra_logo.svg
dest: "{{ galaxy_server_dir }}/static/e-infra_logo.svg"
- src: files/galaxy/config/llm_hub_data_table_conf.xml
dest: "{{ galaxy_config_dir }}/llm_hub_data_table_conf.xml"

galaxy_config_templates:
- src: templates/galaxy/config/reports.yml.j2
Expand All @@ -279,6 +288,8 @@ galaxy_config_templates:
dest: "{{ galaxy_config_dir }}/file_source_templates.yml"
- src: "{{ lookup('first_found', ['templates/'+inventory_hostname+'/config/auth_conf.xml.j2', 'templates/galaxy/config/auth_conf.xml.j2']) }}"
dest: "{{ galaxy_config.galaxy.auth_config_file }}"
- src: templates/galaxy/config/llm_hub_config.yaml
dest: "{{ galaxy_config_dir }}/llm_hub_config.yaml"

galaxy_local_tools:
- testing.xml
Expand Down
373 changes: 189 additions & 184 deletions host_vars/galaxy-qa1.galaxy.cloud.e-infra.cz/secret.yml

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions roles/usegalaxy_cz.llm_hub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Role Name
=========

Configure support for LLM Hub tool

Requirements
------------

Role Variables
--------------

Dependencies
------------

Example Playbook
----------------


License
-------

MIT

Author Information
------------------

3 changes: 3 additions & 0 deletions roles/usegalaxy_cz.llm_hub/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for usegalaxy_cz.llm_hub
3 changes: 3 additions & 0 deletions roles/usegalaxy_cz.llm_hub/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for usegalaxy_cz.llm_hub
34 changes: 34 additions & 0 deletions roles/usegalaxy_cz.llm_hub/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#SPDX-License-Identifier: MIT-0
galaxy_info:
author: Ales Krenek
description: configure support for llm hub tool
company: CESNET

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: MIT
min_ansible_version: 2.1

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
22 changes: 22 additions & 0 deletions roles/usegalaxy_cz.llm_hub/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---

- name: Retrieve current list of LLMs
delegate_to: localhost
shell: |
echo '#<model_id> <display_name> <domain> <provider> <free_tag>' > "files/{{ inventory_hostname }}/llm_models.loc" && \
curl -H "Authorization: Bearer {{ llm_hub.token }}" "{{ llm_hub.endpoint }}/models" | \
jq -r --arg re "^({{ multimodals | join('|') }})" \
'.data[].id | if test($re) then [.,.,"multimodal","CERIT-SC","tag"] else [.,.,"text","CERIT-SC","tag"] end | @tsv' \
>> files/{{ inventory_hostname }}/llm_models.loc
become: false

- name: Install the list of LLMs
copy:
src: "files/{{ inventory_hostname }}/llm_models.loc"
dest: "{{ galaxy_tool_data_path }}/llm_models.loc"

- name: Install specific local dependencies
pip:
name: openai
virtualenv: "{{ galaxy_venv_dir }}"

3 changes: 3 additions & 0 deletions roles/usegalaxy_cz.llm_hub/tests/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
localhost

6 changes: 6 additions & 0 deletions roles/usegalaxy_cz.llm_hub/tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- usegalaxy_cz.llm_hub
12 changes: 12 additions & 0 deletions roles/usegalaxy_cz.llm_hub/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for usegalaxy_cz.llm_hub

multimodals:
- llama
- qwen
- nomic
- kimi
- mistral
- deepseek
- glm
2 changes: 2 additions & 0 deletions templates/galaxy/config/llm_hub_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LITELLM_API_KEY: "{{ llm_hub.token }}"
LITELLM_BASE_URL: "{{ llm_hub.endpoint }}"
5 changes: 5 additions & 0 deletions templates/galaxy/config/tpv_rules_meta.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ tools:
scheduling:
require:
- alphafold
toolshed.g2.bx.psu.edu/repos/bgruening/llm_hub/llm_hub/.*:
inherits: local_running_tools
env:
LITELLM_CONFIG_FILE: "{{ galaxy_config_dir }}/llm_hub_config.yaml"


roles:
training.*:
Expand Down