When I try to send a long prompt, I get the following error:
LeapGenerationPromptExceedContextLengthException
Prompt too long: The prompt exceeds the max context length of 4096 tokens.
Steps to Reproduce:
Load model using Leap SDK.
Pass a prompt longer than 4096 tokens.
Observe the error.
Expected Behavior:
The SDK should:
Either automatically truncate the prompt or provide a clear way to handle longer inputs.
Expose the max context length in the API so developers can validate before sending.
Actual Behavior:
Error is thrown directly without any way to manage/handle the prompt size.
Additional Context:
There’s also no option in SDK to clear prompt history or reset the conversation without unloading the model.
It would be helpful if there’s a method like resetHistory() or truncatePrompt().
Also, please confirm if token size limit is fixed per model or configurable.
Environment:
Leap SDK version: v0.5.0
Platform: Android (Kotlin)
Device: Pixel 9 pro
Model: LFM2-700M
When I try to send a long prompt, I get the following error:
LeapGenerationPromptExceedContextLengthException
Prompt too long: The prompt exceeds the max context length of 4096 tokens.
Steps to Reproduce:
Load model using Leap SDK.
Pass a prompt longer than 4096 tokens.
Observe the error.
Expected Behavior:
The SDK should:
Either automatically truncate the prompt or provide a clear way to handle longer inputs.
Expose the max context length in the API so developers can validate before sending.
Actual Behavior:
Error is thrown directly without any way to manage/handle the prompt size.
Additional Context:
There’s also no option in SDK to clear prompt history or reset the conversation without unloading the model.
It would be helpful if there’s a method like resetHistory() or truncatePrompt().
Also, please confirm if token size limit is fixed per model or configurable.
Environment:
Leap SDK version: v0.5.0
Platform: Android (Kotlin)
Device: Pixel 9 pro
Model: LFM2-700M