Skip to content

Conversation

@skcussm
Copy link

@skcussm skcussm commented Nov 7, 2025

-Added Pseudo FIM feature which provides in line completion for use with models not specifically designed for FIM. This allows for in line completions with models such as gpt-oss-20b/120b.
-Added Pseudo FIM system prompt preference which is used when Pseudo FIM is enabled in the models preferences.
-This feature works well in LM Studio/OpenAI and Ollama. Implemented, but untested for Mistral.
-When Pseudo FIM is not enabled, the behavior should be identical to the original FIM implementation (requiring a FIM enabled model).

Notes: Interestingly, Pseudo FIM mode still works well with the qwen2.5-coder models. It works reasonably well with meta-llama-3.1-8b-instruct, gemma-3-12b. It works very well with gpt-oss-20b.

Future possibilities: This new feature uses a system prompt to instruct the model to behave like a FIM model. Future work should be done to appropriately automatically supply more context with this system prompt (or the user prompt) so the Pseudo FIM model may consider fuller context in its completions.

Please test with Mistral as I am not set up to do that.

I tried to follow the existing codes style and approach. Please, feel free to improve this contribution.

-Added Pseudo FIM feature which provides in line completion for use with
models not specifically designed for FIM.  This allows for in line
completions with models such as gpt-oss-20b/120b.
-Added Pseudo FIM system prompt preference which is used when Pseudo FIM
is enabled in the models preferences.
-This feature works well in LM Studio/OpenAI and Ollama.  Implemented,
but untested for Mistral.
-When Pseudo FIM is not enabled, the behavior should be identical to the
original FIM implementation (requiring a FIM enabled model).

Notes: Interestingly, Pseudo FIM mode still works well with the
qwen2.5-coder models.  It works reasonably well with
meta-llama-3.1-8b-instruct, gemma-3-12b. It works very well with
gpt-oss-20b.

Future possibilities: This new feature uses a system prompt to instruct
the model to behave like a FIM model.  Future work should be done to
appropriately automatically supply more context with this system prompt
(or the user prompt) so the Pseudo FIM model may consider fuller context
in its completions.
@hetzge
Copy link
Owner

hetzge commented Nov 8, 2025

Wow, thank you very much for the contribution.

I'm currently traveling, but I'll take a deeper look at it as soon as possible.

```.println(title);```
## Additional information ##
- Use Java 21 syntax
Copy link
Owner

Choose a reason for hiding this comment

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

Prompt should not contain any hardcoded information about the used technology.

## Additional information ##
- Use Java 21 syntax
- Use the correct variables based on the context
- If a comment precedes the line to you be completed, implement it
Copy link
Owner

Choose a reason for hiding this comment

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

I understand the intention, but I'm not sure it makes sense. My observation is that "fill in the middle" tends to look for structural completion and shouldn't generally follow instructions.

Here is an example:

// TODO implement a
|

Then the result could be:

// TODO implement a
doA();

or:

// TODO implement a
// TODO implement b

In the first case, it follows the instruction, and in the second, it completes the code.

For cases where I want to implement a comment, I use what I call "TODO-driven development" with inline edit (which works by instructions). Example prompt: "Implement the TODOs/comments and remove them afterward."

}
}));
// Pseudo FIM
addField(new BooleanFieldEditor(
Copy link
Owner

Choose a reason for hiding this comment

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

I see this currently more on the "general" settings page instead of the llm page

}

private static String getPseduoFIMSystemPrompt(String fimSystemPrompt, boolean multilineEnabled) {
return fimSystemPrompt + (multilineEnabled?"":"\\nOnly generate a single line of code.");
Copy link
Owner

Choose a reason for hiding this comment

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

"\n"

}

private static String getPseduoFIMSystemPrompt(String fimSystemPrompt, boolean multilineEnabled) {
return fimSystemPrompt + (multilineEnabled?"":"\\nOnly generate a single line of code.");
Copy link
Owner

Choose a reason for hiding this comment

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

It could be nicer to do this in the prompts jinja template (more flexibility, better integration in the prompt)

@hetzge
Copy link
Owner

hetzge commented Nov 14, 2025

I added a few comments. You can improve the points if you want (and have time). Otherwise i would merge the pull request and improve on my side.

I tested with mistral and it works fine.

I had already such feature in a very early version of this plugin. But i was unhappy with the completions (many formatting and duplication of existing code in the results). I think now it is a little bit better and as optional alternative way it is a good option.

Thank you again for the contribution.

@hetzge
Copy link
Owner

hetzge commented Nov 14, 2025

I also added my formatter configuration here: https://github.com/hetzge/eclipse-ai-coder/blob/master/formatter.xml

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