DeepSeek LLM Integration - Error Encountered

Hi Bolt.DIY Community,

I’m experiencing an issue when trying to use the DeepSeek LLM in Bolt.DIY. Here are the details of the error:

There was an error processing your request: An error occurred.

Additional error logs:

  • Error: Chat Request failed

Troubleshooting steps I’ve already tried:

  • Verified my API key is configured
  • Checked browser console
  • Restarted the application

Could someone help me diagnose:

  1. Is this a known issue with DeepSeek integration?
  2. Are there any specific configuration steps I might have missed?
  3. Do I need to update any configuration files or environment settings?

Hi @felipeOliveira-1,

which provider do you use for DeepSeek? DeepSeek directly or over OpenRouter etc.?

Hi everyone,

I’m encountering the same error while trying to integrate DeepSeek LLM via the API directly from DeepSeek. I’ve tried both the coder and chat functionalities through Bolt.DIY, but I keep getting the following error:

Error: Chat Request failed

I’ve already:

  • Verified my API key is correct and configured properly.
  • Checked the browser console for additional details.
  • Restarted the application multiple times.

Could someone please help me with:

  1. Is this a known issue with DeepSeek integration?
  2. Are there any specific configuration steps I might have missed?
  3. Do I need to update any configuration files or environment settings?

Any guidance would be greatly appreciated!

ps: with anthropic api set through .env works perfectly

I see the issue!
the max context window from Deepseek it’s 65536, therefore too big for the LLM to process output. Maybe with another provider that has a bigger context for deepseek might work, like Openrouter through Fireworks.

if you have find out an agentic way to use smaller context windows within bolt.diy with Deepseek at 65k context window, please share it here, thanks in advance!

I don’t think the error has anything to do context size.

Likely the issue has to do with using DeepSeek directly. I personally use DeepSeek-V3 through Openrouter. I have heard of a lot of people having issues with Deepseek directly. Are you sure the API endpoint is working? I would check outside of Bolt.diy to confirm. Many providers require a payment method with available credits.

Openrouter provides free credits for new signups and has many models available.

Ehy mate, thanks for the reply. Yes it is working correctly on Cline, therefore it should work with bolt as well i suppose, but if you look the terminal after trying sending a request through bolt, it look like this:


Working with Anthropics, but not on Deepseek due to the maximum context lenght limitation

What are you sending it, your entire directory tree? That is a lot of tokens. Maybe consider enabling Context Optimizing and Optimized Prompts in your Bolt.diy settings?

And that’s not a Bolt.diy issue, that is the literal context limit of DeepSeek-v3. It’s also like 200 pages of content… omg.

1 Like

Are you on the stable branch? If yes, try to switch to main branch and make sure you got the latest changes (git pull). There was enhancement for logging yesterday, which maybe brings you the correct error / problem (terminal)

1 Like

this was litterally my prompt:


You straight away pointed me out to the right direction! i had prompt-optimizing, experimental features and autoselect template switched off! and now i toggled them on and it’s working :wink: thank you so much!

2 Likes

There is no way you should be hitting the 65K context window size. Maybe clear your history? I’m not honestly sure how the history works under the hood, but I know clearing has solved problems in the past. However, if that solves the problem… I’m concerned with what the History is actually doing… lol

@aliasfox I think its pretty clear, that the history needs some developer attention :smiley:

1 Like

thanks buddy for the advice, i git clone it fresh few hours ago but i’ll make sure to git pull upgrades from time to time :wink:

What would you advice me to do if i want to work on an already existing project with bolt.diy?
i honestly started developing the project on bolt.new , i’ve hit the limits and decided to try use the opensource version, so the project i have imported it from bolt.new that might be why i got so many tokens processed? am i doing it wrong? the deepseek doesn’t seem to code without hitting multiples errors, if i switch to anthropics, it complete the tasks…

I think the UI option to import a project massively bloats the history. I have a different method I used (created a “git” wrapper for isomorphic-git which I can use from the Bolt.diy terminal (aka. Web Container)). It works much better for me, but I haven’t implemented it directly into Bolt.diy and submitted a PR. I’ve been a bit busy with my own project and work, but I do plan on getting around to it. I could give you the code to use for the time being though and the process.

And it’s still a work in progress but works for me.

1 Like

Yeah provide it please :slight_smile:

Sure.

I choose a model and stupidly ask it to just "Open IDE.", lol.

I first create an empty file from the terminal to edit, called git.mjs and give it execute permissions. As a note, you can use the touch command but I’ve ran into issues with that in the “Web Container” (not sure why, just worked around it).

Commands/Commands:

  • echo > git.mjs
  • chmod +x git.mjs
  • npm install isomorphic-git fs-extra
  • Copy/paste code and save the git.mjs file.
  • ./git.mjs clone {REPOSITORY_URL}

Note: Now just use Git as “normal” from the command line. The idea would be to add the command to the Xterm/inal so that just using “git” does the same and just “works”. Still needs more features, like credential management, etc.

See:
image

Open the git.mjs file in the IDE and paste the following code:

#!/usr/bin/env node

import path from 'path';
import fs from 'fs-extra';
import git from 'isomorphic-git';
import http from 'isomorphic-git/http/node/index.cjs';  // Corrected import
import minimist from 'minimist';
import { fileURLToPath } from 'url';

// Resolve __filename and __dirname for ES Modules
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const showHelp = () => {
  console.log(`
  Usage: git.js [command] <repository-url> [options]

  Commands:
    clone   Clone a repository
    pull    Pull changes from the remote repository
    push    Push changes to the remote repository
    status  Show the status of the working directory
    add     Add files to the staging area
    commit  Commit changes to the repository

  Options:
    --ref <branch>              Specify branch (default: main)
    -v, --version               Show version
    -h, --help                  Show help
  `);
};

const args = minimist(process.argv.slice(2), {
  string: ['ref'],
  boolean: ['version', 'v', 'help', 'h'],
  alias: { v: 'version', h: 'help' },
});

const command = args._[0] || '';
const repoUrl = args._[1];
const ref = args.ref || 'main';
const fileList = args._.slice(2); // For 'add' command, it will be file paths

const validateCommand = () => {
  if (!['clone', 'pull', 'push', 'status', 'add', 'commit', '-v', '--version', '-h', '--help'].includes(command)) {
    console.error(`Error: Unknown command "${command}".`);
    showHelp();
    process.exit(1);
  }
};

const validateRepoUrl = () => {
  if (!repoUrl && command !== 'status' && command !== 'add' && command !== 'commit') {
    console.error('Error: A repository URL must be provided for this command.');
    showHelp();
    process.exit(1);
  }
};

const runCommand = async () => {
  validateCommand();

  try {
    switch (command) {
      case 'clone': {
        validateRepoUrl();

        const repoName = path.basename(repoUrl, '.git') || 'repository';
        const dir = path.resolve(process.cwd(), repoName);

        console.log(`Cloning ${repoUrl} into ${dir}...`);
        await git.clone({ fs, http, dir, url: repoUrl });
        console.log('Clone completed successfully.');
        break;
      }

      case 'pull': {
        const dir = process.cwd();
        console.log(`Pulling changes into ${dir} on branch ${ref}...`);
        await git.pull({
          fs,
          http,
          dir,
          ref,
          singleBranch: true,
          fastForwardOnly: true,
        });
        console.log('Pull completed successfully.');
        break;
      }

      case 'push': {
        const dir = process.cwd();
        console.log(`Pushing changes from ${dir} on branch ${ref}...`);
        await git.push({ fs, http, dir, ref });
        console.log('Push completed successfully.');
        break;
      }

      case 'status': {
        const dir = process.cwd(); // Current working directory
        console.log(`Getting status for repository in ${dir}...`);
      
        // Check if the directory is a Git repository by looking for the .git folder
        const isGitRepo = fs.existsSync(path.join(dir, '.git'));
        
        if (!isGitRepo) {
          console.error('Error: This is not a git repository (no .git directory found).');
          process.exit(1);
        }
      
        try {
          // Check the status of the repository, assuming the current directory
          const status = await git.status({ fs, dir, filepath: '.' });
          console.log('Status:');
          console.log(status);
        } catch (err) {
          console.error(`Error: ${(err instanceof Error) ? err.message : 'Unknown error'}`);
          process.exit(1);
        }
        break;
      }
        
      case 'add': {
        const dir = process.cwd();
        if (fileList.length === 0) {
          console.error('Error: You must specify files to add.');
          showHelp();
          process.exit(1);
        }

        console.log(`Adding files: ${fileList.join(', ')}...`);
        await git.add({ fs, dir, filepath: fileList });
        console.log('Files added to staging area.');
        break;
      }

      case 'commit': {
        const dir = process.cwd();
        const message = args.message || args.m;
        if (!message) {
          console.error('Error: You must specify a commit message using --message or -m.');
          process.exit(1);
        }

        console.log(`Committing changes with message: "${message}"...`);
        await git.commit({ fs, dir, author: { name: 'User', email: 'user@example.com' }, message });
        console.log('Commit successful.');
        break;
      }

      case '-v':
      case '--version':
        console.log('git.js version 1.0.0');
        break;

      case '-h':
      case '--help':
      default:
        showHelp();
        break;
    }
  } catch (err) {
    console.error(`Error: ${err.message}`);
    process.exit(1);
  }
};

runCommand();

See entire process (API failed the first time because I forgot to add it):

Note: I thought isomorphic-git was already installed, is this only for Dev (because I was running in a “production” Cloudflare Pages instance)? And this wouldn’t be very hard to impliment in Xterm (the Bolt.diy terminal).

P.S. Also maybe helpful:

As another note on this topic, there are tools that can sync files to/from locally which I have yet to try myself. This would be nice as well, being that the Sync Files GUI option is only one way and feels a little sluggish.

thx, btw. did you see this auto sync implementation?

Not clear on reading the PR, but I’m guessing this is a one-way sync as a two-way sync would be much harder (would probably be easier as more of a pointer, and that might negate the nature of the Web Container)?