Skip to content
Snippets Groups Projects
Select Git revision
  • 5ff80cbf451f485a8145512666c6e2f5fd0d8cb4
  • main default protected
  • editUser
  • loadTests
  • fixTests
  • userhandling
  • updateEmbeddings
  • addRAGSources
  • testing
  • conversations
  • inputValidation
  • rag
  • chatting
  • userauth
14 results

ollama.rest

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ollama.rest 2.77 KiB
    ######################################################
    # This is a sample collection for the Ollama API
    # it is build to serve the VSCode rest client extension 
    # https://marketplace.visualstudio.com/items?itemName=humao.rest-client
    # 
    # The following links provide information about the ollama API
    # https://github.com/ollama/ollama/blob/main/docs/api.md
    # https://github.com/ollama/ollama-js
    ######################################################
    
    #################
    # SET VARS
    #################
    @host = https://localhost:8080
    # https://ollama.com/library
    @model = llama3
    @stream = false
    
    #user
    @email = embruch@zbh.uni-hamburg.de
    @password = 8z44tcZa!
    # admin
    @email_admin = ge@reigncode.de
    @password_admin = A9z44tcZa!
    # JWT
    @token = {{login.response.body.token}}
    # id for chat history
    @chatID = {{resumeChat.response.body.chat.id}}
    @chatID = {{startChat.response.body.chat.id}}
    
    
    #################
    # HANDLE LOGIN
    #################
    
    
    ### admin login
    # @name adminLogin
    POST {{host}}/users/adminlogin
    Accept: application/json
    Content-Type: application/json
    
    {
      "password": "{{password_admin}}",
      "email": "{{email_admin}}"
    }
    
    #################
    # HANDLE MODELS
    #################
    ### isRunning
    # @name is_running
    GET {{host}}/ai/status
    
    
    ### List available models
    # @name list_models
    POST {{host}}/ai/models
    Authorization: Bearer {{token}}
    Accept: application/json
    Content-Type: application/json
    
    {
      "filter": "llama"
    }
    
    ### show info of a specific model
    # @name show_model
    POST {{host}}/ai/model
    Authorization: Bearer {{token}}
    Accept: application/json
    Content-Type: application/json
    
    {
      "model": "{{model}}"
    }
    
    ### pull a specific model
    # @name pull_model
    POST {{host}}/ai/models/pull
    Authorization: Bearer {{token}}
    Accept: application/json
    Content-Type: application/json
    
    {
      "model": "{{model}}"
    }
    
    ### delete a specific model
    # @name delete_model
    DELETE {{host}}/ai/models
    Authorization: Bearer {{token}}
    Accept: application/json
    Content-Type: application/json
    
    {
      "model": "{{model}}"
    }
    
    #################
    # CHAT
    #################
    ### login
    # @name login
    POST {{host}}/users/login
    Accept: application/json
    Content-Type: application/json
    
    {
      "password": "{{password}}",
      "email": "{{email}}"
    }
    
    ### get chats
    # @name chats
    GET {{host}}/ai/chats
    Accept: application/json
    Content-Type: application/json
    
    ### start a chat
    # @name startChat
    POST {{host}}/ai/chat
    Authorization: Bearer {{token}}
    Accept: application/json
    Content-Type: application/json
    
    {
      "input": "Was muss getan werden um mit den Druckern aus der GUI zu drucken?",
      "model": "llama3"
    }
    
    ### generate a follow up question
    # @name resumeChat
    POST {{host}}/ai/chat
    Authorization: Bearer {{token}}
    Accept: application/json
    Content-Type: application/json
    
    {
      "chatId": "{{chatID}}",  
      "input": "What else can be found under that path?",
      "model": "llama3"
    }