View Full Version : Local LLM hook
DevInstinct
March 9th, 2026, 04:46
Is there an already existing way, or upcoming API, which allows extension developers to call local LLM (ex: ollama http://localhost:11434) from their extension's lua scripts in order to integrate ai features into FG?
Trenloe
March 9th, 2026, 14:25
You could use the Interface.openURL API functions: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644632/Interface#openURL The LLM URL would need to generate an appropriate response which would then need to be parsed back into FG appropriately - there are Utility API functions to decode CSV, JSON and XML: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/1481998353/Utility
As an example, look at how the Syrinscape integration calls a URL to get a CSV response of the available Syrinscape sounds - look in scripts\manager_sound_syrinscape.lua in the CoreRPG ruleset, start looking at "Interface.openURL" in the onButtonImportWeb function.
DevInstinct
March 9th, 2026, 16:42
You could use the Interface.openURL API function
Looks like Interface.openURL is for http GET. Any other option allowing http POST ? This is what would be needed in this case.
Trenloe
March 9th, 2026, 18:08
If that method won't work, then you may need to look at generating a text, CSV, JSON or XML document outside of FG and then writing code that uses the File.openTextFile function: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/1482293249/File#openTextFile to load the data into FG and then use a Utility function to read the data and process appropriately. Note that File.openTextFile may only fully operate on files within the FG Data Directory structure.
DevInstinct
March 9th, 2026, 21:35
Thanks!
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.