Skip to content

feat: BYOK#161

Open
kah-seng wants to merge 83 commits intomainfrom
feat/byok
Open

feat: BYOK#161
kah-seng wants to merge 83 commits intomainfrom
feat/byok

Conversation

@kah-seng
Copy link
Copy Markdown
Member

Summary

Adds BYOK features (including base URL, API key and param configurations), also added changes as per suggestions from #157.

Tested Providers

Stable: GPT, Claude, Gemini, MiniMax, OpenRouter
Unstable: DeepSeek, GLM

Screenshots

image
image
image
Closes #118 Closes #149 Closes #157

Junyi-99 and others added 30 commits January 27, 2026 02:58
#33 

In short, it'll

1. [Frontend] Recognize that user is trying to add a citation (trigger
text is `\cite{`)
2. [Frontend] Temporarily suppress default Overleaf dropdown suggestions
3. [Frontend] Get the last sentence as context for LLM
4. [Backend] Fetch bibliography in `.bib` files as raw text, and remove
irrelevant fields to save tokens
5. [Backend] Call XtraMCP to get paper abstract, using paper title as
key
6. [Backend] Query a fast LLM (hardcoded to `gpt-5.2` for now) to get at
most 3 citation keys
7. [Frontend] Suppress default Overleaf tab-completion to allow users to
accept citation suggestions
@kah-seng kah-seng requested review from 4ndrelim and Junyi-99 April 21, 2026 03:44
@kah-seng kah-seng self-assigned this Apr 21, 2026
@kah-seng kah-seng added the enhancement New feature or request label Apr 21, 2026
@4ndrelim 4ndrelim requested a review from wjiayis April 22, 2026 19:40
@4ndrelim
Copy link
Copy Markdown
Member

@wjiayis Hi Jia Yi, I recall you had some great feedback to improve user experience / make it more intuitive for new users. Could you kindly help to check if your concerns have been addressed too? Thanks!

Copy link
Copy Markdown
Member

@4ndrelim 4ndrelim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarification required.

Also, do we know the issue with deepseek and GLM? If not, no worries, we can proceed but raise an issue for those 2 first.

if customModel != nil {
params := openaiv3.ChatCompletionNewParams{
Model: customModel.Slug,
Temperature: openaiv3.Float(float64(customModel.Temperature)),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested with varying temperatures for all the models? We might have to handle some corner case here. For example, i believe GPT-5.1 only allows temperature setting of 1.0. Any attempt to configure it otherwise will lead to an error. I am unsure if the other models have this peculiar behaviour too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't extensively tested yet, but I believe the range is generally up to 2.0? Some models (from what I know GPT like you mentioned) go up to 1.0. Perhaps I could add an extra cautionary message regarding this in the tooltip?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also still unsure of the issue with Deepseek and GLM

ModelName string
Endpoint string
APIKey string
ModelName string
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i recall our last discussion that this field is to be unique so users can differentiate different API keys of the same slugs. Is this still the case? If so, how do we ensure it is unique?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, as mentioned in our pm, it's currently being enforced on the frontend

@4ndrelim
Copy link
Copy Markdown
Member

@kah-seng
Screenshot 2026-04-23 at 3 57 21 AM

I noticed in the screenshot here there are 3 custom models. May i verify the expected behaviour:
If endpoints and APIs are provided for all 3, they will appear as in the above. If any one has missing either API or endpoints, it will be faded display?

Copy link
Copy Markdown
Member

@wjiayis wjiayis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Played around with it, LGTM! Thanks @kah-seng !

@kah-seng
Copy link
Copy Markdown
Member Author

@kah-seng Screenshot 2026-04-23 at 3 57 21 AM

I noticed in the screenshot here there are 3 custom models. May i verify the expected behaviour: If endpoints and APIs are provided for all 3, they will appear as in the above. If any one has missing either API or endpoints, it will be faded display?

@4ndrelim only the models that have been added successfully will show up in the selection menu (models that have missing API keys/endpoints are invalid and can't be added in the first place)

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Good-to-have BYOK frontend improvements [Feature Request] Add a custom base URL and API key. [Feature Request] BYOK

4 participants