[NodeJS] Completion with fine-tuned model

How to use fine-tuned models with NodeJS client library?

Tried:

  1. Omitting “engine” → error: “bad request”
  2. Using fine-tuned model name as engine → error: “You requested a model that is not compatible with this engine. Please contact support@openai.com if you need assistance.”
  3. Using completeFromModel from as described in gpt-x (which official client is based on) → invalid request
await openai.createCompletion(engine, {
    prompt,
    model,
    temperature: 0.8,
    max_tokens: 123,
    top_p: 1,
    frequency_penalty: 0,
    presence_penalty: 0,
    stop: [" END"],
    user
});

Ceifa’s original node client, gpt-x includes completeFromModel endpoint, which doesn’t seem to be available in OpenAi’s official node client.

await openai.completeFromModel('FINE_TUNED_MODEL', {
    prompt: 'Q: Hello\nA:'
});

Would appreciate any pointers or feedback.

Thanks!

2 Likes

Thanks for the heads up – you’re right that this engine/model distinction is something we’re actively working through. I’ll post an update in this thread soon.

3 Likes

We just publish version 2.0.2 of the package with a new method for fine-tuned model requests

const completion = await openai.createCompletionFromModel({
  prompt: "Hello world",
  model: "ada:ft-...",
});

You can upgrade using:

npm install openai@latest

Thanks again for reporting this, and let us know if you have any further issues!

4 Likes

Thanks @dschnurr for the quick action on this - much appreciated!