Skip to content

Custom AI Provider

Definer comes with built-in support for many popular AI services. But the world of AI moves fast, and new, exciting models pop up all the time. If your preferred provider isn't on the list, or if you're running your own local AI server, the Custom provider option is for you.

This feature allows you to connect Definer to any AI service that offers an OpenAI-compatible API endpoint.

picker.avif

What You'll Need

To set up a custom AI provider, you'll need:

  • API Host: The domain name where your AI service accepts requests
  • API Key: Your authentication token for the service
  • Model Name: The specific model you want to use (e.g., "gpt-4", "claude-3-sonnet", "llama-2-7b")

Setting Up Your Custom Provider

  1. Open Definer Options: Right-click the extension icon and select "Definer Options"
  2. Navigate to AI source: Open the "Sources" page and find the "AI" source there, then click on "Settings"
  3. Select "Custom" provider: Locate the "Provider" select and choose "Custom" from the dropdown (it's at the very bottom)
  4. Enter your details:
    • Model: Specify the exact model name as required by your provider
    • API Key: Paste your authentication key
    • API Host: Enter your provider's API domain name (e.g., https://api.yourprovider.com)
  5. Test the setup: Try looking up a term with Definer to make sure everything works

Why not just switch the host on the OpenAI provider?

The OpenAI provider in Definer uses OpenAI's newer Responses API (/responses). Most other services that claim “OpenAI compatibility” mean the legacy Chat Completions API (/chat/completions). These two are not interchangeable, so

  • OpenAI provider → Use for OpenAI's /responses endpoint
  • Custom provider → Use for OpenAI-compatible /chat/completions services

Note that OpenAI's Chat Completions is now considered legacy by OpenAI.

Many AI providers offer OpenAI-compatible APIs, including:

  • Fireworks AI — High-performance hosting for open models with OpenAI-style APIs
  • Groq — Ultra-fast inference for quick responses
  • DeepInfra — Serverless inference for open-source models with OpenAI-compatible chat completions
  • Mistral AI — Official Mistral models with an OpenAI-compatible endpoint
  • Cerebras — Inference API for large open models with OpenAI compatibility
  • vLLM OpenAI Server (self-hosted) — Run your own OpenAI-compatible endpoint locally or in the cloud
  • llama.cpp server (self-hosted) — Lightweight local server exposing /v1/chat/completions
  • LiteLLM Gateway (self-hosted) — Router/proxy that presents an OpenAI-compatible interface to many backends

Always check each provider’s docs for the exact API Host and model IDs.

Troubleshooting Common Issues

Running into trouble? Here are some of the most common issues and how to solve them.

"Invalid API Key" Error

  • Double-check your API key is copied correctly (no extra spaces)
  • Verify the key is active and has sufficient credits/quota
  • Ensure you're using the correct authentication format

"Model Not Found" Error

  • Confirm the model name matches exactly what your provider expects
  • Check if the model requires a specific format (some use prefixes like "openai/" or "anthropic/")
  • Verify your API key has access to the specified model

Connection Timeouts

  • Test your internet connection
  • Try a different API Host if your provider offers multiple
  • Check if your provider has rate limiting that might be causing delays

Unexpected Responses

  • Some providers have different prompt formatting requirements
  • Adjust the model name if responses seem off-topic or poorly formatted
  • Consider switching to a different model variant if available

Have questions about using Custom AI provider with Definer?
Feel free to create a new post with the "Help" flair in the r/lumetrium_definer subreddit.