Package anlavn.ai
Class YourGPT
java.lang.Object
anlavn.ai.YourGPT
- All Implemented Interfaces:
AutoCloseable
The YourGPT class supports to LLM (Large Language Model) inference with LLaMA.
This class provides methods to load the YourGPT module, start the server, interact with the model...
This class provides methods to load the YourGPT module, start the server, interact with the model...
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
Configurable LLaMA parameters for the YourGPT server.
These parameters must be adjusted before starting the server.
Read more about available parameters at: https://github.com/ggerganov/llama.cpp/blob/master/examples/server/README.md -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Use this method to cleans up the YourGPT.LLaMA module if it exists.static void
Use this method to cleans up the YourGPT.Model module if it exists.void
close()
static void
destroy()
Use this method to forcibly destroy the YourGPT process.static String[]
getLLaMA()
Use this method to retrieves a list of the latest LLaMA names available.static void
Use this method to load YourGPT module using the default LLaMA "Win_CUDA12" and default LLM.
Equivalent to calling `loadModule("Win_CUDA12")`.static void
loadModule
(String llama) Use this method to load YourGPT module using the specified LLaMA and default LLM.static void
loadModule
(String llama, String model) Use this method to load YourGPT module using the specified LLaMA and the specified LLM.static void
start()
Use this method to starts the YourGPT server with the specified parameters.
If the module has not been loaded, it will attempt to load using the default settings.
-
Field Details
-
params
Configurable LLaMA parameters for the YourGPT server.
These parameters must be adjusted before starting the server.
Read more about available parameters at: https://github.com/ggerganov/llama.cpp/blob/master/examples/server/README.md -
API_KEY
-
-
Constructor Details
-
YourGPT
public YourGPT()
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
loadModule
public static void loadModule()Use this method to load YourGPT module using the default LLaMA "Win_CUDA12" and default LLM.
Equivalent to calling `loadModule("Win_CUDA12")`. -
loadModule
Use this method to load YourGPT module using the specified LLaMA and default LLM.- Parameters:
llama
- the name of the LLaMA file to load.
Example: "Win_CUDA12"
Explore more at https://anlavn-api.vercel.app/api/llama- See Also:
-
loadModule
Use this method to load YourGPT module using the specified LLaMA and the specified LLM.- Parameters:
llama
- the name of the LLaMA file to load.
Example: "Win_CUDA12"
Explore more at https://anlavn-api.vercel.app/api/llamamodel
- the location of the specified LLM, it can be local path or link address.
Example:
"C:/Users/AnLaVN/mistral-7b-openorca.Q4_K_M.gguf" for file location or,
"https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-GGUF/resolve/main/mistral-7b-openorca.Q4_K_M.gguf"
Explore more LLM at https://huggingface.co- See Also:
-
start
public static void start()Use this method to starts the YourGPT server with the specified parameters.
If the module has not been loaded, it will attempt to load using the default settings. -
getLLaMA
Use this method to retrieves a list of the latest LLaMA names available.- Returns:
- An array of the latest LLaMA names.
Explore more at https://anlavn-api.vercel.app/api/llama - Throws:
IOException
- if there is no internet connection or server down.
-
cleanLLaMA
public static void cleanLLaMA()Use this method to cleans up the YourGPT.LLaMA module if it exists. -
cleanModel
public static void cleanModel()Use this method to cleans up the YourGPT.Model module if it exists. -
destroy
public static void destroy()Use this method to forcibly destroy the YourGPT process.
-