Skip to content

Conversation

@LarsLarkin
Copy link

Hi @crybot,

Thank you for this great plugin. I've added a feature that allows users to specify a custom API Base URL in the settings.

This change makes the plugin compatible with third-party providers like OpenRouter, Groq, and local models via Ollama (which was my personal use case).

What I changed:

  • settings.ts / components.ts: Added a new text field for the baseURL and changed the "Model" dropdown to a text field to allow custom model names.
  • main.ts: Passed the new baseURL from settings to the generation function.
  • flashcards.ts:
    1. Passed the baseURL to the OpenAI constructor.
    2. Updated the model validation logic to allow custom models if a baseURL is present.

The plugin remains fully compatible with the original OpenAI API if the baseURL field is left empty.

I hope you find this contribution useful!

@crybot
Copy link
Owner

crybot commented Oct 28, 2025

@LarsLarkin Thank you for you contribution. This is something I was planning on doing sooner or later, so it's a very welcome change! I'll test it out today and merge it if everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants