mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-30 06:30:43 +00:00
squash on a reasonable progress checkpoint
This commit is contained in:
parent
b8f52d67e1
commit
4d48b362f6
10 changed files with 1067 additions and 252 deletions
10
openai-openapi/config.yaml
Normal file
10
openai-openapi/config.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
package: apiv2
|
||||
generate:
|
||||
models: true
|
||||
chi-server: true
|
||||
output: apiv2/localai.gen.go
|
||||
# output-options:
|
||||
# user-templates:
|
||||
# union.tmpl: "// SKIP"
|
||||
# union-and-additional-properties.tmpl: "// SKIP"
|
||||
# additional-properties.tmpl: "// SKIP"
|
64
openai-openapi/localai_model_patches.yaml
Normal file
64
openai-openapi/localai_model_patches.yaml
Normal file
|
@ -0,0 +1,64 @@
|
|||
#! LocalAI Model Patches
|
||||
#! These are fed to YTT, which patches the OpenAI OpenAPI spec to include the custom attributes used by LocalAI to pass parameters and information to local models.
|
||||
#! TODO: pretty this up. Fancy YAML features will reduce code duplication, but this is a POC.
|
||||
|
||||
#@ load("@ytt:overlay", "overlay")
|
||||
|
||||
#@overlay/match by=overlay.all
|
||||
---
|
||||
components:
|
||||
schemas:
|
||||
CreateChatCompletionRequest:
|
||||
properties:
|
||||
#@overlay/match missing_ok=True
|
||||
x-localai-extensions:
|
||||
type: object
|
||||
nullable: true
|
||||
properties:
|
||||
seed:
|
||||
type: integer
|
||||
nullable: true
|
||||
top_k:
|
||||
type: integer
|
||||
nullable: true
|
||||
batch:
|
||||
type: integer
|
||||
nullable: true
|
||||
f16:
|
||||
type: boolean
|
||||
nullable: true
|
||||
ignore_eos:
|
||||
type: boolean
|
||||
nullable: true
|
||||
#! skip RepeatPenalty, try using FrequencyPenalty in real model instead??
|
||||
n_keep:
|
||||
type: integer
|
||||
nullable: true
|
||||
x-go-name: Keep
|
||||
mirostat:
|
||||
type: integer
|
||||
nullable: true
|
||||
mirostat_eta:
|
||||
type: number
|
||||
nullable: true
|
||||
x-go-type: float64
|
||||
mirostat_tau:
|
||||
type: number
|
||||
nullable: true
|
||||
x-go-type: float64
|
||||
CreateImageRequest:
|
||||
properties:
|
||||
#@overlay/match missing_ok=True
|
||||
x-localai-extensions:
|
||||
type: object
|
||||
nullable: true
|
||||
properties:
|
||||
seed:
|
||||
type: integer
|
||||
nullable: true
|
||||
mode:
|
||||
type: integer
|
||||
nullable: true
|
||||
step:
|
||||
type: integer
|
||||
nullable: true
|
12
openai-openapi/remove_depreciated_openapi.yaml
Normal file
12
openai-openapi/remove_depreciated_openapi.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
#! This doesn't actually work or get used yet. It's a scratch space for an idea of mine - we might want to just strip out and ignore depreciated portions of the spec. Not reliable enough to use yet.
|
||||
|
||||
#@ load("@ytt:overlay", "overlay")
|
||||
|
||||
#@overlay/match by=overlay.all, expects="1+"
|
||||
---
|
||||
paths:
|
||||
#!overlay/match by=overlay.subset({"deprecated": True})
|
||||
#@overlay/remove
|
||||
*:
|
||||
*:
|
||||
depreciated: True
|
30
openai-openapi/test_segment.yml
Normal file
30
openai-openapi/test_segment.yml
Normal file
|
@ -0,0 +1,30 @@
|
|||
#! This file is just for my reference during development and will be removed.
|
||||
components:
|
||||
schemas:
|
||||
CreateChatCompletionRequest:
|
||||
type: object
|
||||
properties:
|
||||
model:
|
||||
description: ID of the model to use. Currently, only `gpt-3.5-turbo` and `gpt-3.5-turbo-0301` are supported.
|
||||
type: string
|
||||
messages:
|
||||
description: The messages to generate chat completions for, in the [chat format](/docs/guides/chat/introduction).
|
||||
type: array
|
||||
minItems: 1
|
||||
items:
|
||||
$ref: '#/components/schemas/ChatCompletionRequestMessage'
|
||||
temperature:
|
||||
type: number
|
||||
minimum: 0
|
||||
maximum: 2
|
||||
default: 1
|
||||
example: 1
|
||||
nullable: true
|
||||
description: *completions_temperature_description
|
||||
CreateImageRequest:
|
||||
type: object
|
||||
properties:
|
||||
prompt:
|
||||
description: A text description of the desired image(s). The maximum length is 1000 characters.
|
||||
type: string
|
||||
example: "A cute baby sea otter"
|
Loading…
Add table
Add a link
Reference in a new issue