Announcement

Collapse
No announcement yet.

GPT4All Web Server API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GPT4All Web Server API

    Has anyone tried using GPT4All's local api web server?
    The docs are here and the program is here.

    I'm sending an HTML request and I've tried every variation of the webserver address that I can think of. I either get error 2502 (Could not open request) or error 2515 (The requested URL was not found on the server).

    Here's my code:
    PHP Code:
    local url "localhost"
    local values = {
       
    model "gpt4all-j-v1.3-groovy",
       
    prompt "Who is Michael Jordan?",
       
    max_tokens 50,
       
    temperature 0.28,
       
    top_p 0.95,
       
    1,
       echo = 
    true,
       
    stream false,
       
    api_key "",
    }

    result HTTP.Submit(urlvaluesSUBMITWEB_POST204891nilnil);
    if 
    result == "" then    
        Paragraph
    .SetText("Paragraph1"tostring(Application.GetLastError()).."\r\n".._tblErrorMessages[Application.GetLastError()]);    
    else
        
    Paragraph.SetText("Paragraph1"type(result).."\r\n"..#result);
    end​ 

    Any ideas why this isn't working?
    https://github.com/CentauriSoldier

  • #2
    Sadly, I am getting the same, even using the local IP. I am unsure what is happening. I see with netstat that the chat.exe is listening on the port, but that is all.

    Ulrich

    Comment


    • #3
      Yeah, it's weird. It seems like it shold be working but it's not. I can't think of any other things to check. I've even asked GPTChat about it to no avail .
      https://github.com/CentauriSoldier

      Comment


      • #4
        Hi Centauri Soldier and Ulrich,

        After playing around, I found that i needed to set the request header to JSON and send the data as JSON too. with the use of LuaCom with WinHttp.WinHttpRequest.5.1, I was able to get it working correctly. If someone would like to make a HTTP plugin that allows to change the hearer type and allow JSON to be sent that would be nice

        anyway here is the program i make for GPTChat. its uses a JSON.lua script for the JSON stuff, Sorry i cant remember who made it or i would credit them here. Also it uses the LUACom plugin by reteset.

        quick note: you need to down load the correct model and match it with the client, also a extra note, it runs a little slow :(

        Updated to v1.1, i have added the Response Length setting, the big the number the big the response will be [ATTACH]n310370[/ATTACH]


        Click image for larger version  Name:	ChatGPT.png Views:	4 Size:	66.4 KB ID:	310366
        Last edited by SupperBin; 05-29-2023, 09:33 AM.

        Comment


        • #5
          That is very cool, thanks for sharing this info!

          Ulrich

          Comment


          • #6
            Wow, nice! Gonna check it out now, thanks.
            https://github.com/CentauriSoldier

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎