Using private GPT models and local LLMs with ClaimMaster

If you have your own account with OpenAI, Azure OpenAI or have installed a local LLM, ClaimMaster lets you pass your API account information for completing GPT/LLM prompts using your private GPT models (you’ll incur your own costs for the generated text). You may find this option beneficial as you’ll be able to use your custom end-points (Azure) or more advanced GPT models (ClaimMaster currently uses gpt-3.5-turbo by default), as well as set the max limit on the tokens to generate more text than allowed ClaimMaster’s default settings.

In addition, you can connect ClaimMaster to a local LLM, so that your data remains completely private and is not sent to the cloud for processing. Note that doing so requires you to install a program, such as Ollama, LM Studio or GPT4All, that can execute quantized/compressed LLMs on your computer. While running LLMs locally might be slower and generates less finessed text than OpenAI GPT, for many cases it can be “good enough,” especially when used for re-writing existing text. In addition, open source LLMs are improving quickly and newer LLM models, such as Meta’s LLama3 are said to rival GPT. So if you have data privacy concerns about cloud-based OpenAI/Azure GPT applications, using such a local LLM in combination with ClaimMaster is an excellent alternative to GPT that lets you have a completely private AI-enhanced patent drafting solution. It’s free, secure, and lets you access a number of powerful open-source LLMs to help with patent drafting. All you really need is a reasonably modern PC to run Ollama smoothly.

  1. Set up the desired GPT/LLM account

    a. OpenAI
    Create an OpenAI account or sign in. Then navigate to the API key page and “Create new secret key“, optionally naming the key. Make sure to save this somewhere safe and do not share it with anyone

    b. Azure
    Get an Azure subscription, if you don’t have it (it’s free. Create and deploy Azure GPT service.

    c. Local LLM
    Install a program allowing you to run local LLMs in server mode, such as Ollama or LM Studio. Also download and install one of the LLMs, such as Llama3 or Mistral, using that program. For more information installing and configuring ClaimMaster specifically with Ollama, please see this post. For the best results, it’s recommended to install these programs on a modern PC with Windows 10/11, a 4 or 8-core processor, an SSD with 12-50 GB of free space for models, and plenty of RAM (8GB is the bare minimum but 16+ GB is really recommended). 

  2. Configure ClaimMaster to connect to the selected GPT/LLM source

    Go to ClaimMaster->Preferences, Extra Tools, Help menu, then Preferences menu. Click on Patent Drafting->GPT/LLM Settings.

    gpt_settings_selection

    Alternatively, you can open GPT/LLM settings directly from the GPT tools window.
    llm_settings

    Then, depending on the source, configure ClaimMaster GPT settings as follows to use private GPT models.

    a. OpenAI
    Select OpenAI GPT as the source. Copy & paste your private API key into the API key section. You should also specify the Model to use and Maximum # of tokens limit for prompt and return responses. You can leave the Endpoint or local address field blank.

    openai gpt settings
    Then press Save to save the settings.

    b. Azure
    Select Microsoft Azure GPT as the source. Specify your azure endpoint in the Endpoint or local address field. The endpoint should specify the full address, such as https://{YOUR_RESOURCE_NAME}.openai.azure.com/openai/deployments/{YOUR_DEPLOYMENT_NAME}/chat/completions?api-version=2024-02-15-preview. In addition, copy & paste your private API key into the API key section. You should also specify the Model to use and Maximum # of tokens limit for prompt and return responses.

    Azure GPT settings
    Then press Save to save the settings.

    c. Local LLM
    To use ClaimMaster with a locally running LLM, make sure to start the local LLM via Ollama or LM Studio or a similar program in server mode. From the program, obtain the server port/address to use for the local LLM, as shown below.

    In the ClaimMaster’s LLM settings window, specify the following settings and then save them:
    * “Source” should be set to Local LLM.
    * “Endpoint” should be set to default server address for the LLM application, which would be “http://localhost:11434/api/generate” for Ollama or “http://localhost:1235/v1/chat/completion” for LM Studio. You can use the pre-defined drop-down option. Please consult your program’s documentation for specific address instructions if using another LLM application.
    * “Model” should be set to “llama3″, “mistral”, “llava” or any other model that you’ve downloaded and installed via Ollama and want to use for patent drafting.

    ollama claimmaster

    You can ignore other fields in the GPT/LLM settings window, since they are typically not used by the LLM program. Press Save to save the settings.

  3. Send your prompts to the configured GPT/LLM source

    Once your GPT/LLM settings are configured, you can start using ClaimMaster to send your prompts to the private GPT models or local LLM, as explained in other tutorials.

For more information about this feature, check out the Online Manual.