AI-Ollama-Client

 view release on metacpan or  search on metacpan

ollama/ollama-curated.yaml  view on Meta::CPAN

openapi: 3.1.0
# https://github.com/davidmigloz/langchain_dart/blob/main/packages/ollama_dart/oas/ollama-curated.yaml

info:
  title: Ollama API
  description: API Spec for Ollama API. Please see https://github.com/jmorganca/ollama/blob/main/docs/api.md for more details.
  version: 0.1.9

#servers:
#  - url: http://localhost:11434/api
#    description: Ollama server URL

tags:
  - name: Completions
    description: Given a prompt, the model will generate a completion.
  - name: Chat
    description: Given a list of messages comprising a conversation, the model will return a response.
  - name: Embeddings
    description: Get a vector representation of a given input.
  - name: Models
    description: List and describe the various models available.

paths:
  /generate:
    post:
      operationId: generateCompletion
      tags:
        - Completions
      summary: Generate a response for a given prompt with a provided model.
      description: The final response object will include statistics and additional data from the request.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateCompletionRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/x-ndjson:
              schema:
                $ref: '#/components/schemas/GenerateCompletionResponse'
  /chat:
    post:
      operationId: generateChatCompletion
      tags:
        - Chat
      summary: Generate the next message in a chat with a provided model.
      description: This is a streaming endpoint, so there will be a series of responses. The final response object will include statistics and additional data from the request.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateChatCompletionRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/x-ndjson:
              schema:
                $ref: '#/components/schemas/GenerateChatCompletionResponse'
  /embeddings:
    post:
      operationId: generateEmbedding
      tags:
        - Embeddings
      summary: Generate embeddings from a model.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateEmbeddingRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateEmbeddingResponse'
  /create:
    post:
      operationId: createModel
      tags:
        - Models
      summary: Create a model from a Modelfile.
      description: It is recommended to set `modelfile` to the content of the Modelfile rather than just set `path`. This is a requirement for remote create. Remote model creation should also create any file blobs, fields such as `FROM` and `ADAPTER`...
      requestBody:
        description: Create a new model from a Modelfile.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateModelRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/x-ndjson:
              schema:
                $ref: '#/components/schemas/CreateModelResponse'
  /tags:
    get:
      operationId: listModels
      tags:
        - Models
      summary: List models that are available locally.
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsResponse'
  /show:
    post:
      operationId: showModelInfo
      tags:
        - Models
      summary: Show details about a model including modelfile, template, parameters, license, and system prompt.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelInfoRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelInfo'
  /copy:
    post:
      operationId: copyModel
      tags:
        - Models
      summary: Creates a model with another name from an existing model.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CopyModelRequest'
      responses:
        '200':
          description: Successful operation.
  /delete:
    delete:
      operationId: deleteModel
      tags:
        - Models
      summary: Delete a model and its data.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteModelRequest'
      responses:
        '200':
          description: Successful operation.
  /pull:
    post:
      operationId: pullModel
      tags:
        - Models
      summary: Download a model from the ollama library.
      description: Cancelled pulls are resumed from where they left off, and multiple calls will share the same download progress.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PullModelRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/x-ndjson:
              schema:
                $ref: '#/components/schemas/PullModelResponse'
  /push:
    post:
      operationId: pushModel
      tags:
        - Models
      summary: Upload a model to a model library.
      description: Requires registering for ollama.ai and adding a public key first.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PushModelRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PushModelResponse'
  "/blobs/{digest}":
    head:
      operationId: checkBlob
      tags:
        - Models
      summary: Check to see if a blob exists on the Ollama server which is useful when creating models.
      parameters:
        - in: path
          name: digest
          schema:
            type: string
          required: true
          description: the SHA256 digest of the blob
          example: sha256:c8edda1f17edd2f1b60253b773d837bda7b9d249a61245931a4d7c9a8d350250



( run in 3.180 seconds using v1.01-cache-2.11-cpan-5735350b133 )