Package ai.picovoice.picollm
Class PicoLLM.Builder
java.lang.Object
ai.picovoice.picollm.PicoLLM.Builder
- Enclosing class:
- PicoLLM
Builder class for creating a `PicoLLM` instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new PicoLLM instance using values defined by the builder.setAccessKey(String accessKey) Sets the AccessKey.Sets the device to use for inference.setModelPath(String modelPath) Sets the model path.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setAccessKey
Sets the AccessKey.- Parameters:
accessKey- AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)- Returns:
- Builder instance.
-
setModelPath
Sets the model path.- Parameters:
modelPath- Absolute path to the file containing LLM parameters (`.pllm`).- Returns:
- Builder instance.
-
setDevice
Sets the device to use for inference.- Parameters:
device- String representation of the device (e.g., CPU or GPU) to use for inference. If set to `best`, picoLLM picks the most suitable device. If set to `gpu`, the engine uses the first available GPU device. To select a specific GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.- Returns:
- Builder instance.
-
build
Builds a new PicoLLM instance using values defined by the builder.- Returns:
- Constructed PicoLLM instance.
- Throws:
PicoLLMException- if initialization fails.
-