Interface ChatModelConfig


public interface ChatModelConfig
  • Method Details

    • modelId

      @WithDefault("llama3") String modelId()
      Model to use. According to Ollama docs, the default value is llama3
    • temperature

      @WithDefault("0.8") Double temperature()
      The temperature of the model. Increasing the temperature will make the model answer with more variability. A lower temperature will make the model answer more conservatively.
    • numPredict

      @WithDefault("128") Integer numPredict()
      Maximum number of tokens to predict when generating text
    • stop

      Optional<List<String>> stop()
      Sets the stop sequences to use. When this pattern is encountered the LLM will stop generating text and return
    • topP

      @WithDefault("0.9") Double topP()
      Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text
    • topK

      @WithDefault("40") Integer topK()
      Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative
    • seed

      Optional<Integer> seed()
      With a static number the result is always the same. With a random number the result varies Example:
       
       Random random = new Random();
       int x = random.nextInt(Integer.MAX_VALUE);
       
       
    • format

      Optional<String> format()
      the format to return a response in. Currently, the only accepted value is json
    • logRequests

      @ConfigDocDefault("false") @WithDefault("${quarkus.langchain4j.ollama.log-requests}") Optional<Boolean> logRequests()
      Whether chat model requests should be logged
    • logResponses

      @ConfigDocDefault("false") @WithDefault("${quarkus.langchain4j.ollama.log-responses}") Optional<Boolean> logResponses()
      Whether chat model responses should be logged