Skip to content

Help page: Using Custom APIs

Muzhen Gaming edited this page Dec 31, 2024 · 4 revisions

Raycast-g4f supports integration with any custom OpenAI-compatible API. This includes any third-party provider, or local models such as Ollama.

Getting started: Custom OpenAI-compatible API

Setup

  1. Launch "Preferences".
  2. Select "Custom OpenAI-compatible APIs".
  3. Choose "Add API".
  4. Enter the API information, such as Base URL, name, API Key and any JSON config.
  5. If it's your first time adding this API, or if you select "Refresh Models List" when editing an existing API, the extension will fetch the list of available models from the API.
  6. The next time you use any command, all the models from this custom API will appear in the models list, and you can select it as usual.

Note

You can add as many custom APIs as you want.

Tip

You can also set a custom model as the default in the "Default Model" preference.

Getting started: Ollama

Connecting Ollama is basically the same as adding a custom API!

  • Set the API URL to your Ollama server URL (e.g. the default is http://localhost:11434/v1). Make sure to use the OpenAI-compatible endpoint.
  • Optionally, set a JSON config, such as:
{
    "ctx_size": 4096,
    "num_predict": 512
}
  • You're all good to go! Just make sure your Ollama server is running when you use the extension.