continue icon indicating copy to clipboard operation
continue copied to clipboard

Unable to upload files

Open whoami730 opened this issue 5 months ago • 2 comments

Before submitting your bug report

Relevant environment info

- OS: Windows
- Continue version: pre-release 1.1.53
- IDE version:VSCode 1.101.2
- Model: llama3.1:8b
- config:
  
name: Local Setup
version: 1.0.0
schema: v1
models:
  - name: Nomic Embed Text
    provider: ollama
    model: nomic-embed-text:v1.5
    roles:
      - embed
  - name: Qwen2.5-Coder 3B
    provider: ollama
    model: qwen2.5-coder:3b
    roles:
      - autocomplete
  - name: Autodetect
    provider: ollama
    model: AUTODETECT
  - name: My Voyage Reranker
    provider: voyage
    model: rerank-2
    roles:
      - rerank
rules:
  - Give concise responses
context:
  - provider: code
  - provider: docs
  - provider: diff
  - provider: terminal
  - provider: problems
  - provider: folder
  - provider: codebase
  - provider: web
    params:
      n: 2
  - provider: url
  - provider: search
  
I have set OLLAMA CONTEXT LENGTH to be 16384.

Description

Unable to upload files using context provider, always errors out with "File exceeds context length" - File is 140.7 KB which exceeds the allowed context length and cannot be processed by the model. This is not even a large file, 140 KB is quite small. It can be easily processed by locally deployed open web ui with the same model, seems like an issue with continue itself.

whoami730 avatar Jul 01 '25 13:07 whoami730

Is it a text file? How many characters does the file have? Does the same issue happen when using other models (e.g. any of OpenAI, Anthropic, Gemini etc)?

tomasz-stefaniak avatar Jul 24 '25 15:07 tomasz-stefaniak

I am seeing the same issue, trying to find the correct configuration to set the context length for file context.

afshimono avatar Nov 14 '25 21:11 afshimono

Maybe this workaround works for me (parameter: contextLength ), check the comment in this issue : https://github.com/continuedev/continue/issues/5291#issuecomment-2823869610

models:
  - name: Gemma 3 27B
    provider: ollama
    model: gemma3:27b
    defaultCompletionOptions:
     contextLength: 131072
    roles:
      - chat
      - edit
      - apply

c0b611e7de75:/# ollama show gemma3:27b
  Model
    architecture        gemma3
    parameters          27.4B
    context length      131072
    embedding length    5376
    quantization        Q4_K_M

isatis07 avatar Nov 24 '25 13:11 isatis07