> ## Documentation Index
> Fetch the complete documentation index at: https://docs.freeplay.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Model Parameters

> Record additional model parameters beyond the defaults configured in the Freeplay UI.

The majority of critical model parameters like `temperature` and `max_tokens` can be configured in the Freeplay UI. However, if you are using additional parameters these can still be recorded during the Record call and will be displayed in the UI alongside the Completion.

<CodeGroup>
  ```python python theme={null}
  from freeplay import Freeplay, RecordPayload, CallInfo

  # create a session which will create a UID

  session = fpClient.sessions.create()

  # build call info from scratch to log additional params

  # get the base params

  start_params = formatted_prompt.prompt_info.model_parameters

  # set the additional parameters

  additional_params = {"presence_penalty": 0.8, "n": 5}

  # combine the two parameter sets

  all_params = {**start_params, **additional_params}
  call_info = CallInfo(
    provider=formatted_prompt.prompt_info.provider,
    model=formatted_prompt.prompt_info.model,
    start_time=s,
    end_time=e,
    model_parameters=all_params # pass the full parameter set
  )

  # record the results

  payload = RecordPayload(
    project_id=project_id,
    all_messages=all_messages,
    inputs=prompt_vars,
    session_info=session.session_info,
    prompt_version_info=prompt_info,
    call_info=call_info
  )
  completion_info = fpClient.recordings.create(payload)

  ```

  ```typescript typescript theme={null}
  import Freeplay, { getSessionInfo } from "freeplay";

  // create a session
  let session = fpClient.sessions.create({});

  // get the primary parameters
  const baseParams = formattedPrompt.promptInfo.modelParameters;
  // set the additional parameters
  const additionalParams = { presence_penalty: 0.8, n: 5 };
  // merge the parameters
  const allParams = { ...baseParams, ...additionalParams };
  console.log(allParams);

  // construct the callInfo
  const callInfoPayload = {
      provider: formattedPrompt.promptInfo.provider,
      model: formattedPrompt.promptInfo.model,
      startTime: start,
      endTime: end,
      modelParameters: allParams,
  };

  // record the interaction with Freeplay
  const completionInfo = await fpClient.recordings.create({
      projectId,
      allMessages: messages,
      inputs: promptVars,
      sessionInfo: getSessionInfo(session),
      promptVersionInfo: formattedPrompt.promptInfo,
      callInfo: callInfoPayload
  });
  ```

  ```java java theme={null}
  import ai.freeplay.client.thin.Freeplay;
  import ai.freeplay.client.thin.resources.prompts.FormattedPrompt;
  import ai.freeplay.client.thin.resources.recordings.*;
  import ai.freeplay.client.thin.resources.sessions.SessionInfo;
  import ai.freeplay.client.thin.resources.recordings.CallInfo;

  // construct the session info from the session object
  SessionInfo sessionInfo = fpClient.sessions().create().getSessionInfo();

  // get the existing parameters
  Map<String, Object> modelParams = formattedPrompt.getPromptInfo().getModelParameters();
  // add the additional parameters
  modelParams.put("presence_penalty", 0.8);
  modelParams.put("n", 5);

  // construct the call info
  CallInfo callInfo = new CallInfo(
    formattedPrompt.getPromptInfo().getProvider(),
    formattedPrompt.getPromptInfo().getModel(),
    startTime,
    System.currentTimeMillis(),
    modelParams
          );
  System.out.println("Completion: " + content);

  // make the record call to freeplay
  fpClient.recordings().create(
    new RecordInfo(
      projectId,
      allMessages
      ).inputs(variables)
    .sessionInfo(sessionInfo)
    .promptVersionInfo(formattedPrompt.getPromptInfo())
    .callInfo(callInfo));
  );
  ```

  ```kotlin kotlin theme={null}
  import ai.freeplay.client.thin.Freeplay
  import ai.freeplay.client.thin.resources.prompts.ChatMessage
  import ai.freeplay.client.thin.resources.recordings.CallInfo
  import ai.freeplay.client.thin.resources.recordings.RecordInfo

  /* RECORD */
  // get the existing parameters
  val modelParams = formattedPrompt.promptInfo.modelParameters;
  modelParams["presence_penalty"] = 0.8;
  modelParams["n"] = 5
  // construct the call info from the prompt object
  val callInfo = CallInfo(
    formattedPrompt.promptInfo.provider,
    formattedPrompt.promptInfo.model,
    startTime,
    endTime,
    modelParams
  )

  // create the session and get the session info
  val sessionInfo = fpClient.sessions().create().sessionInfo

  // build the final record payload
  val recordResponse = fpClient.recordings().create(
    RecordInfo(
        projectId,
        allMessages
      ).inputs(variables)
      .sessionInfo(session.sessionInfo)
      .promptVersionInfo(prompt.promptInfo)
      .callInfo(callInfo)
      .traceInfo(trace)
  ).await()
  ```
</CodeGroup>
