epistemology 0.4.4

A simple and clear way of hosting llama.cpp as a private HTTP API
<html>
  <head>
    <title>Epistemology</title>
    <meta property="og:title" content="Epistemology - A private open source platform for your local text AI"/>
    <meta property="og:type" content="ai"/>
    <meta property="og:url" content="https://epistemology.dev/"/>
    <meta property="og:image" content="https://epistemology.dev/preview.png"/>
    <meta property="og:site_name" content="Epistemology"/>
    <meta property="og:description"
          content="A simple and clear way of hosting llama.cpp as a private HTTP API using Rust."/>
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100;0,9..40,200;0,9..40,700;1,9..40,100;1,9..40,200;1,9..40,700&display=swap"
      rel="stylesheet"
    />
    <style>
      body {  
        font-family: "DM Sans", sans-serif;
        font-weight: 200;
        padding: auto;
        margin: auto;
        max-width: 800px;
      }

      h1,
      h2,
      h3 {
        font-weight: 200;
      }

      h1 {
        font-size: 4rem;
        line-height: 4rem;
        margin: 0;
      }

      h2 {
        font-size: 2rem;
        line-height: 2rem;
        margin: 0;
      }

      h3 {
        font-size: 1.2rem;
        margin: 0;
      }

      p {
        font-size: 1rem;
      }

      b {
        font-weight: 700;
      }

      .center {
        text-align: center;
      }

      .horizontal-card-holder {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
      }

      .card {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border: 1px solid black;
        border-radius: 10px;
        padding: 10px;
        margin: 10px;
      }

      .splash {
        background: black;
        color: white;
        margin: 0;
      }
      .splash .title {
        padding: 2rem;
      }
      .splash img {
        width: 100%;
        max-width: 800px;
      }
    </style>
  </head>
  <body>
    <div class="splash">
        <div class="title">
            <h1>Epistemology</h1>
            <h2>
                A private open source platform for your local text AI
            </h2>
        </div>
        <img src="./epistemology.png"/>
    </div>
    <p>
      Language learning models are powerful tools you should feel in control of.
      This project was created to be a middle ground between bare bones CLI
      usage of llama.cpp and AI interfaces that are so complex or black boxes
      they feel untrustworthy. It offers a number of ways it aims to be private that may appeal to you:

      <ul>
        <li>
            Never writes your prompts out anywhere in logs or consoles
        </li>
        <li>
            Runs by default on https://localhost:8080 to never have network access outside your machine
        </li>
        <li>
            Has extremely simple code so that you can understand and analyze every aspect
        </li>
        <li>
            Has no stateful configuration or data other than what you initalize it with
        </li>
        <li>
            It wraps `llama.cpp` and executes it with the most minimal exposing settings possible
        </li>
        <li>
            Constrain output to only what to you want it to output with AI grammers
        </li>
        <li>
            Zero intentions of ever commercializing or collecting data or directing downloads to third party services
        </li>
        <li>
            Open source so you can modify to your values and needs
        </li>
      </ul>
    </p>
    <div class="horizontal-card-holder">
      <div class="card">
        <h3>Local HTTP GET/POST API</h3>
        <p>
          Unlock seamless integration with a local HTTP API for AI <b>completion</b> and <b>embedding</b>. Build frontends with whatever tech you like backed by a simple and understandable backend. The API's clarity and simplicity ensure complete visibility into every aspect of its operation.
        </p>
      </div>
      <div class="card">
        <h3>Bring your own static UI</h3>
        <p>
          Epistemology comes with a default UI for text completion, but makes it
          easy to replace with your own personal web frontend.
        </p>
      </div>
      <div class="card">
        <h3>JSON schema support</h3>
        <p>
          Constraining AI outputs using grammars is very powerful, Epistemology
          natively supports using JSON schema files as grammars so you can get
          useful structured output for programmatic interfaces.
        </p>
      </div>
    </div>

    <h3>Getting Started</h3>

    <p>
        Install <a href="https://github.com/ggerganov/llama.cpp">llama.cpp</a>. If you are using Windows, choose the appropriate zip depending on if using Nvidia Cuda or AMD OpenCL CUBlas. If you are using mac, check out how to build <a href="https://agi-sphere.com/install-llama-mac/">here</a>. If you are using other unix systems, you can build from source according to Llama.cpp's <a href="https://github.com/ggerganov/llama.cpp">website</a>.
    </p>
    <p>
        Download a GGUF model such as <a href="https://huggingface.co/TheBloke/phi-2-GGUF">
            TheBloke/phi-2-GGUF</a>. Any llama.cpp compatible GGUF you know can run on your machine will do.
    </p>

    <p>
        Download epistemology server <a href="https://github.com/richardanaya/epistemology/releases/latest/">binaries</a> (macOS, Linux, Windows)
        </p>
        <p>
        or
        </p>
<p>
        Build from <source>

    <pre>
        cargo install epistemology
    </pre>
    </p>

    <p>Run the server

      <pre>
        epistemology -m ../llama.cpp/phi-2.Q2_K.gguf -e ../llama.cpp/main -d ../llama.cpp/embedding

        Serving UI on https://localhost:8080/ from built-in UI
        Listening with GET and POST on https://localhost:8080/api/completion
        Examples:
            * https://localhost:8080/api/completion?prompt=famous%20qoute:
            * curl -X POST -d "famous quote:" https://localhost:8080/api/completion
            * curl -X POST -d "robots are good" https://localhost:8080/api/embedding
    </pre>
    </p>

    <div class="splash">
      <img src="./screenshot.png"/>
      <img src="https://github.com/richardanaya/epistemology/assets/294042/069515da-9a9b-4252-b40a-52ed459850f2"/>
  </div>
<p>
  Find more details by running
  <pre>
    epistemology --help
  </pre>
  or visiting the project page at <a href="https://github.com/richardanaya/epistemology/"">https://github.com/richardanaya/epistemology/</a>.
</p>
    <p>
      Be in control of your AI.<br/>
      Powered by Rust.<br />
      <b>MIT</b> licensed.<br />
      <a href="https://github.com/richardanaya/epistemology/">Github</a>.<br />
    </p>
  </body>
</html>