ModelFarm keeps sending "Internal Server Error"

Description of the problem (please keep it simple and short): ModelFarm keeps returning a 500 Internal Server Error for me whenever I use it.

Explain what you were trying to do: Implement it in my Repl.

What areas or features are involved? ModelFarm

Repl Cover Page Link/Screenshots/Etc: Would rather not publicly. If a staff member would like to investigate further please say so and I can send a PM with more information.

3 Likes

Another person experiencing this:

Also, Repl link here:

3 Likes

This seems to be a “hit or miss” thing, some of my Repls seem to have ModelFarm working while others don’t.

3 Likes

Hey @haroon!

Thanks for reporting. Can you PM me the link to your Repl so I can share this with the team? I’ve let them know of the issue in general, though.

2 Likes

Hey Shane,

Is there any ETA on this? I wanna try get this in for the ModelFarm Hackathon and won’t be able to really work on it in a few days.

2 Likes

Hey! I am so sorry for the delay on this. I received your PM and will look into this today!

3 Likes

Are you able to produce a minimum viable repro for this? It looks like your Repl is a large codebase, which makes it difficult for us to pinpoint the exact issue. If you could try to use modelfarm in a new Repl to reproduce the issue, that would help us immensely!

1 Like

The funny thing is that it only doesn’t work in that one Repl (and its forks).

A basic Svelte implementation of the same thing also works, and using ModelFarm with a wrapper module also works (in a different Repl, haven’t tried on that Repl iirc)

2 Likes

@ShaneAtReplit @haroon I am now experienced this too. I’d like to complete in the ModelFarm Hackathon, but I can’t because of this error! I have copied and pasted the code into 4 different repls and it is still not working.

Could you provide a link to or snippet of the code or a minimum viable product where you are able to reproduce this issue. This will help the team investigate the issue further. :smile:

3 Likes

As for the actual content that actually interacts with ModelFarm, check out pages/index.tsx; lines 29-173.

1 Like

I haven’t been able to figure out why this isn’t working just for that Repl. If your Repl is a GitHub repository, would you mind cloning it into a new Repl and see if that works?

It gives me the error too in some repls

Hey @RedCoder!

Can you send me a link to a Repl where the issue does happen and a link to a Repl that the issue doesn’t happen on?

I’ll try. However it doesn’t like to work with the forks either (the Repl I invited you to was indeed a fork) so I’m not sure.

Edit: Turns out it was a clone. I’m still cloning it anyways to see if it could fix it.

That unfortunately does not work. The only other reason I could think of it not working is due to the size of the codebase (which I can attempt simplify down).

I’ll try that and get back to you.

1 Like

I can reproduce this in code where I give multiple prompts in the same chat session, as in replit.ai.modelfarm.exceptions.InvalidResponseException: Internal server error · Issue #29 · replit/replit-ai-python · GitHub and:

import { chat } from "@replit/ai-modelfarm";

console.assert(
  !(
    await chat({
      model: "chat-bison",
      messages: Array(2).fill({ content: "_" }),
    })
  ).ok,
);
1 Like

It looks like the messages should include an author as well. If the request is formatted improperly, I think our server returning an error is warranted.

If you instead add two messages manually and add an author to each, does that work?

3 Likes

oops. But still, this assertion succeeds (it shouldn’t):

import { chat } from "@replit/ai-modelfarm";

console.assert(
  !(
    await chat({
      model: "chat-bison",
      messages: Array(2).fill({ author: "_", content: "_" }),
    })
  ).ok,
);

the code in this issue does that and I can reproduce their error

2 Likes

This unfortunately has not worked. I can invite you to my new Repl if you want.

1 Like