How could LLM handle fill-in-the-middle?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 10
Description
LLM is currently designed mainly around chat prompts. But there are other forms of LLM interaction, in particular "fill-in-the-middle" as seen in GitHub Copilot.
https://huggingface.co/smallcloudai/Refact-1_6B-fim is an example of a model that supports this:
prompt = '''<fim_prefix>def print_hello_world():
"""<fim_suffix>
print("Hello world!")<fim_middle>'''
Output from that:
<fim_prefix>def print_hello_world():
"""<fim_suffix>
print("Hello world!")<fim_middle>Prints 'Hello world!'"""<|endoftext|>
Which, if you figure out how to construct it again, ends up like this:
def print_hello_world():
"""Prints 'Hello world!'"""
print("Hello world!")
How could LLM support this? Would I need to design a new variant of the llm prompt command and model.prompt() method for this case?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing llm prompt command and model.prompt() method to understand how chat prompts are represented and sent. Compare that flow with the documented fill-in-the-middle prefix, suffix, and middle markers. Done means a defined interface and behavior for FIM interactions, including how the command and model API would expose them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100