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

# MiniCPM 

The `MiniCPM` class provides a wrapper for MiniCPM v2.6 that answers questions based on both images and videos.

<ResponseField name="class MiniCPM()">
  <ResponseField name="use_local" type="boolean" default="True">
    If True, inference call is run on the local VM, else offloaded onto GRID-Cortex. Defaults to True.
  </ResponseField>
</ResponseField>

<ResponseField name="def run()">
  <ResponseField name="use_cortex" type="boolean" default="false">
    If True, offloads inference to GRID-Cortex else runs locally on the session VM. Defaults to False.
  </ResponseField>

  <ResponseField name="fallback_to_local" type="boolean" default True>
    If True, falls back to local inference if cloud inference fails. Defaults to True.
  </ResponseField>
</ResponseField>

<ResponseField name="def run()">
  <ResponseField name="media" type="np.ndarray">
    The input RGB image of shape $(M,N,3)$.
  </ResponseField>

  <ResponseField name="prompt" type="str" required="True">
    The question to answer about the media.
  </ResponseField>

  <ResponseField name="Returns" type="str">
    The response to the prompt.
  </ResponseField>
</ResponseField>

<RequestExample>
  ```python Inference Call theme={null}
  from grid.model.perception.vlm.minicpm import MiniCPM
  car = AirGenCar()

  # We will be capturing an image from the AirGen simulator 
  # and run model inference on it.

  img =  car.getImage("front_center", "rgb").data

  model = MiniCPM(use_local = True)
  result = model.run(media=img, prompt=<prompt>)
  print(result)
  ```
</RequestExample>

<Tabs>
  <Tab title="License">
    This code is licensed under the Apache 2.0 License. We have obtained official license from the company to offer this model on GRID.
  </Tab>

  <Tab title="Source">
    [https://huggingface.co/openbmb/MiniCPM-V-2\_6](https://huggingface.co/openbmb/MiniCPM-V-2_6)
  </Tab>
</Tabs>
