Update the /api/create endpoint to use JSON (#7935)

Replaces `POST /api/create` to use JSON instead of a Modelfile.

This is a breaking change.
This commit is contained in:
Patrick Devine 2024-12-31 18:02:30 -08:00 committed by GitHub
parent 459d822b51
commit 86a622cbdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1523 additions and 1094 deletions

View file

@ -2,7 +2,6 @@ package server
import (
"encoding/json"
"fmt"
"net/http"
"slices"
"testing"
@ -31,9 +30,11 @@ func TestList(t *testing.T) {
var s Server
for _, n := range expectNames {
_, digest := createBinFile(t, nil, nil)
createRequest(t, s.CreateHandler, api.CreateRequest{
Name: n,
Modelfile: fmt.Sprintf("FROM %s", createBinFile(t, nil, nil)),
Name: n,
Files: map[string]string{"test.gguf": digest},
})
}