Forum Moderators: coopster & phranque

Message Too Old, No Replies

Gala Perl Tinkerer

         

Brett_Tabke

10:06 pm on Mar 17, 2024 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Gala Perl Tinkerer (GPT_Tinkerer)

This is a OpenAI API script to be used with any LLM that supports OpenAI API (ChatGPT, Ollama). It also supports Dalle3:

It is a robust stand alone script that I wrote because I was frustrated last year by all the API module updates on Cpan. Hardly a week went by without having to fix something. So I sat down and wrote my own script. I wrote it as a script so that it was stand alone and worked cross platform.

It is fairly feature complete:
  • command line params for configuring the entire script
  • also an ini style config file with all set configurations is an option as well
  • input from a file and output to a file means your other scripts have running access to/from generated text and images
  • extensive logging and error checking
  • token usage tracking

Getting started with the script, you will need:

  • It can be used with a local LLM such as the easy-to-install Ollama [ollama.com], or a OpenAI API.
  • Or if you want to use ChatGPT, you need an OpenAI API key [help.openai.com]. That can be set from 3 places:

    1. an API key file,
    2. or an APIKey environment variable,
    3. or set the APIKey from the command line.

It currently works with OpenAI API. It supports Text and image generation.

I was working on adding Anthropic Claude support as well, but I am stuck: I consistently get a 403 Forbidden error on the request. I can get it to work from Curl on the command line, but not via the script.

Test it out if you feel like and let me know what you think. Not ready to put it public on github yet. Needs some eyes on it.

[webmasterworld.com...]

(edit: added Ollama mention)

tangor

6:11 pm on Mar 18, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ambitious project! May the bug zapping and feedback begin!

Brett_Tabke

12:25 pm on Mar 20, 2024 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



** Change Log: v1.074 build: 74 on 2024-03-21 23:59:19

v1.069 build: 69 on 2024-03-21 23:48:58
- misc fixes and updates.

# v1.067 build: 67 on 2024-03-21 19:03:52
- added support for LLaVa which requires the use MIME::Base64 dependency
- added support for Googles Gemma model as well
- added support for codellama model
- added support for dolphin-mixtral model
- added support for qwen
- removed support for "Grog".
- added CLI params -i="fullpath/filename" to specify an input file for (LLaVA) [llava-vl.github.io...]
- added CLI param -o=1tp specify =0=print decoded results to disk (default) =1=to screen =2=disk and screen


# v1.061 build: 61 on 2024-03-21 16:04:03
- updated Ollama api to use same system as OpenAI so it works with more models.
- added specific token tracker files for each service

# v1.058 build: 58 on 2024-03-20 07:24:40
- updated a couple filenames from .dat files to .txt files.
- added support for Ollama running on local host
- changed zip file name in directory to "current.zip". (but also left, "gpt-tinker-build-XXXX.zip" filename where XXXX is build number.

So [webmasterworld.com...] will always be current build.

[edited by: Brett_Tabke at 4:59 am (utc) on Mar 22, 2024]