diff --git a/README.md b/README.md index 11b1be6..723d760 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,9 @@ curl http://localhost:8080/v1/completions -H "Content-Type: application/json" -d ``` -Note: You can use a default template for every model in your model path, by creating a corresponding file with the `.tmpl` suffix next to your model. For instance, if the model is called `foo.bin`, you can create a sibiling file, `foo.bin.tmpl` which will be used as a default prompt, for instance this can be used with alpaca: +Note: The API doesn't inject a default prompt for talking to the model, while the CLI does. You have to use a prompt similar to what's described in the standford-alpaca docs: https://github.com/tatsu-lab/stanford_alpaca#data-release. + +You can use a default template for every model present in your model path, by creating a corresponding file with the `.tmpl` suffix next to your model. For instance, if the model is called `foo.bin`, you can create a sibiling file, `foo.bin.tmpl` which will be used as a default prompt, for instance this can be used with alpaca: ``` Below is an instruction that describes a task. Write a response that appropriately completes the request. @@ -187,22 +189,6 @@ You can list all the models available with: curl http://localhost:8080/v1/models ``` -## Web interface - -There is also available a simple web interface (for instance, http://localhost:8080/) which can be used as a playground. - -Note: The API doesn't inject a template for talking to the instance, while the CLI does. You have to use a prompt similar to what's described in the standford-alpaca docs: https://github.com/tatsu-lab/stanford_alpaca#data-release, for instance: - -``` -Below is an instruction that describes a task. Write a response that appropriately completes the request. - -### Instruction: -{instruction} - -### Response: -``` - - ## Using other models gpt4all (https://github.com/nomic-ai/gpt4all) works as well, however the original model needs to be converted (same applies for old alpaca models, too): diff --git a/api/api.go b/api/api.go index 3667d39..b4781cd 100644 --- a/api/api.go +++ b/api/api.go @@ -1,9 +1,7 @@ package api import ( - "embed" "fmt" - "net/http" "strings" "sync" @@ -12,7 +10,6 @@ import ( llama "github.com/go-skynet/go-llama.cpp" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/cors" - "github.com/gofiber/fiber/v2/middleware/filesystem" "github.com/gofiber/fiber/v2/middleware/recover" ) @@ -65,9 +62,6 @@ type OpenAIRequest struct { IgnoreEOS bool `json:"ignore_eos"` } -//go:embed index.html -var indexHTML embed.FS - // https://platform.openai.com/docs/api-reference/completions func openAIEndpoint(chat bool, loader *model.ModelLoader, threads int, defaultMutex *sync.Mutex, mutexMap *sync.Mutex, mutexes map[string]*sync.Mutex) func(c *fiber.Ctx) error { return func(c *fiber.Ctx) error { @@ -234,11 +228,6 @@ func Start(loader *model.ModelLoader, listenAddr string, threads int) error { }) }) - app.Use("/", filesystem.New(filesystem.Config{ - Root: http.FS(indexHTML), - NotFoundFile: "index.html", - })) - // Start the server app.Listen(listenAddr) return nil diff --git a/api/index.html b/api/index.html deleted file mode 100644 index 89b455f..0000000 --- a/api/index.html +++ /dev/null @@ -1,120 +0,0 @@ - - -
-