-
Notifications
You must be signed in to change notification settings - Fork 0
The Settings Screen
Settings › AI Fun Questions. You need the manage_options capability, so in practice an administrator.
The screen has two parts: a row of provider cards at the top, and a panel of fields below for whichever provider is selected. Only the selected provider is ever used — the other panels keep their saved values, but they do nothing.
| Card | Subtitle | What it means |
|---|---|---|
| Ollama | Local, self-hosted | Calls a model running on your own machine or network. No API key, no per-question cost. |
| Hugging Face | Inference Providers | Calls a hosted chat-completion model using a Hugging Face token. |
| OpenAI-compatible | Any OpenAI-shaped API | Calls any endpoint that speaks the OpenAI chat-completions API — OpenAI itself, or a compatible gateway. |
Selecting a card switches the panel below it. Your choice is not saved until you press Save Changes.
| Field | Default | Notes |
|---|---|---|
| Ollama URL | http://localhost:11434/api/chat |
Where your Ollama instance is listening. |
| Ollama Model | gemma3 |
Any chat model you have pulled in Ollama. |
Ollama is the one provider allowed to point at a local address. By default only localhost, 127.0.0.1 and ::1 are accepted — pointing it at a remote machine requires a filter, which the Ollama setup page will cover.
| Field | Default | Notes |
|---|---|---|
| Hugging Face Token | (empty) | Your access token. Stored encrypted-at-rest only to the extent your database is. |
| Hugging Face Model | google/gemma-2-2b-it |
Must be a chat-completion model available through Hugging Face Inference Providers. |
| Field | Default | Notes |
|---|---|---|
| OpenAI-compatible Endpoint | https://api.openai.com/v1/chat/completions |
Change this to use a compatible gateway instead of OpenAI. |
| OpenAI-compatible API Key | (empty) | Your API key. |
| OpenAI-compatible Model | gpt-4o-mini |
Any chat-completion model the endpoint offers. |
Unlike Ollama, this endpoint is validated as a public URL — it cannot point at localhost or a private address.
The two credential fields — the Hugging Face token and the OpenAI key — do not work like ordinary text fields, and the differences are deliberate.
They always render empty. A saved key is never printed back into the page, so you cannot read it out of the settings screen or the page source. An empty field does not mean "no key saved".
Leaving one blank keeps what is already saved. Saving the form with an empty key field changes nothing. This is why you can edit the model without re-pasting your key.
Removing a key needs the tick-box. Each credential field has a companion checkbox to clear it. Tick it and save, and the stored value is deleted. That is the only way to remove a key through the UI.
Three labels appear on the screen and each means something specific:
-
Defined via
AI_FQ_OPENAI_KEYin wp-config.php. The field below is ignored. — a PHP constant is set, and it wins over whatever is in the database. This is the recommended production setup; see the wp-config page when it is written. - Saved, not in use — a credential is stored for a provider you have not selected. Harmless, but worth clearing if you are done with that provider.
- Unsaved changes / All changes saved — a live indicator that tracks whether the form differs from what is stored. It is a convenience, not a validation.
Nothing on this screen contacts your provider. Saving valid-looking settings tells you nothing about whether the credentials work, whether the model name exists, or whether your server can reach the endpoint.
To check, place the shortcode on a page — see Adding the Widget to Your Site — and load it. A working setup shows a question within a second or two. A broken one shows an error message, and the troubleshooting pages map each message to its cause.
Put credentials in wp-config.php rather than the database:
define( 'AI_FQ_OPENAI_KEY', 'sk-…' );
// or
define( 'AI_FQ_HF_TOKEN', 'hf_…' );Keys then never sit in a database export, never appear in a migration, and cannot be read by anyone with database access but not server access. The settings screen detects the constant and tells you the field is being ignored.
Getting started
- Home
- What AI Fun Questions Does
- Installing the Plugin
- The Settings Screen
- Adding the Widget to Your Site
Provider setup
Running it
- Keeping API Keys Out of the Database
- Rate Limits Explained
- Running Behind Cloudflare or a CDN
- What It Costs to Run
Troubleshooting
- Error Messages Reference
- Please Wait Before Requesting Another Question
- Could Not Generate a Question
Privacy and security
Extending