Luna groq AI
Key RequiredUniversal

Luna groq AI

Universal Scriptlethanhthai1lethanhthai1 1K views 199 executesUpdated Apr 15, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•169 lines (4333 chars)
local Luna = loadstring(game:HttpGet("https://raw.githubusercontent.com/Nebula-Softworks/Luna-Interface-Suite/refs/heads/master/source.lua", true))()
local HttpService = game:GetService("HttpService")

-- Variables to store AI data
local GroqSettings = {
    APIKey = "",
    Model = "llama-3.3-70b-versatile",
    Temperature = 0.7
}

local Window = Luna:CreateWindow({
	Name = "Luna Groq AI",
	Subtitle = "Powered by Nebula Softworks",
	LogoID = nil,
	LoadingEnabled = true,
	LoadingTitle = "Initializing AI Interface",
	LoadingSubtitle = "Fetching Groq API Modules",
	ConfigSettings = {
		ConfigFolder = "GroqAIScript"
	},
	KeySystem = false -- Disabled for this example
})

Window:CreateHomeTab({
	SupportedExecutors = {"All"},
	DiscordInvite = "nebula",
	Icon = 1
})

-- AI CHAT TAB
local ChatTab = Window:CreateTab({
	Name = "AI Chat",
	Icon = "chat",
	ImageSource = "Material",
	ShowTitle = true
})

local OutputParagraph = ChatTab:CreateParagraph({
	Title = "AI Response",
	Text = "Ask something to get started..."
})

local UserInput = ""
ChatTab:CreateInput({
	Name = "Enter Prompt",
	PlaceholderText = "How do I make a raycast in Luau?",
	CurrentValue = "",
	Numeric = false,
	Callback = function(Text)
		UserInput = Text
	end
}, "PromptInput")

-- Function to handle Groq API Request
local function SendGroqRequest()
    if GroqSettings.APIKey == "" then
        Luna:Notification({
            Title = "Missing API Key",
            Content = "Please enter your Groq API key in the Settings tab!",
            Icon = "warning"
        })
        return
    end

    OutputParagraph:Set({Title = "AI Status", Text = "Thinking..."})

    -- Check for executor request function
    local httpRequest = (syn and syn.request) or (http and http.request) or http_request or request
    
    if not httpRequest then
        OutputParagraph:Set({Title = "Error", Text = "Executor does not support 'request' function."})
        return
    end

    local success, response = pcall(function()
        return httpRequest({
            Url = "https://api.groq.com/openai/v1/chat/completions",
            Method = "POST",
            Headers = {
                ["Content-Type"] = "application/json",
                ["Authorization"] = "Bearer " .. GroqSettings.APIKey
            },
            Body = HttpService:JSONEncode({
                model = GroqSettings.Model,
                messages = {
                    {role = "user", content = UserInput}
                },
                temperature = GroqSettings.Temperature
            })
        })
    end)

    if success then
        local data = HttpService:JSONDecode(response.Body)
        if data.choices and data.choices[1] then
            local aiText = data.choices[1].message.content
            OutputParagraph:Set({Title = "Groq AI", Text = aiText})
        else
            OutputParagraph:Set({Title = "API Error", Text = response.Body})
        end
    else
        OutputParagraph:Set({Title = "HTTP Error", Text = tostring(response)})
    end
end

ChatTab:CreateButton({
	Name = "Send Request",
	Callback = function()
		SendGroqRequest()
	end
})

-- SETTINGS TAB
local SettingsTab = Window:CreateTab({
	Name = "Settings",
	Icon = "settings",
	ImageSource = "Material",
	ShowTitle = true
})

SettingsTab:CreateInput({
	Name = "Groq API Key",
	PlaceholderText = "gsk_...",
	CurrentValue = "",
	Callback = function(Value)
		GroqSettings.APIKey = Value
	end
}, "APIKeyInput")

SettingsTab:CreateDropdown({
	Name = "Select Model",
	Options = {
        "llama-3.3-70b-versatile",
        "llama-3.1-8b-instant",
        "mixtral-8x7b-32768",
        "gemma2-9b-it"
    },
	CurrentOption = {"llama-3.3-70b-versatile"},
	MultipleOptions = false,
	Callback = function(Options)
		GroqSettings.Model = Options[1]
	end
})

SettingsTab:CreateSlider({
	Name = "Creativity (Temperature)",
	Range = {0, 100},
	Increment = 1,
	CurrentValue = 70,
	Callback = function(Value)
		GroqSettings.Temperature = Value / 100
	end
})

-- Add Luna's built-in theme and config management
local ConfigTab = Window:CreateTab({
	Name = "UI Configs",
	Icon = "save",
	ImageSource = "Material",
	ShowTitle = true
})
ConfigTab:BuildConfigSection()
ConfigTab:BuildThemeSection()

Luna:Notification({
	Title = "Welcome",
	Icon = "check_circle",
	Content = "Luna & Groq Integration Loaded."
})

Features & Information

This script integrates Luna Groq AI to provide fast and intelligent responses for various tasks. It includes a simple and user-friendly interface, allowing users to easily interact with the AI for generating text, answering questions, or automating actions. Key features include: ⚡ Fast AI-powered responses using Luna Groq 💬 Interactive chat system for smooth conversations 🛠️ Easy-to-use interface with minimal setup 🔄 Customizable prompts and behavior 🤖 Automation support for repetitive tasks 🔐 Secure usage with no unnecessary data storage Note: Please respect the community and do not report or target members publicly when using Luna Groq AI. Use this script responsibly and ethically.

Community Comments (2)

wohaawohaaApr 15, 2026

Test!

Yowyow259Yowyow259Apr 15, 2026

test1!

More Scripts for Universal Scripts