Skip to main content

Structured AI system with emebeddable chatbot

Project description

Darkglass

Lint Test Release PyPI

Darkglass is a lightweight, embeddable chatbot designed for small colleges, providing prospective students with automated responses while logging interactions for administrative review.

Demo

Demo Video

Design

The system is built on a minimalist architecture, utilizing FastAPI and SQLite to provide zero-configuration deployment on lightweight Linux VMs without the overhead of external databases.

Configuration

Add a [gemini] section with your API key and optional model (defaults to gemini-3.1-flash-lite-preview):

[gemini]
api_key = "mysecretkey"
model = "gemini-3.1-flash-lite-preview"

You can also include a [context] section to provide a default prompt for the agent:

[context]
prompt = "You are a helpful agent for Acme College."

To enable a secure administrative dashboard, add a [google] section with a client_id to use for authentication.

[google]
client_id = "your-google-client-id.apps.googleusercontent.com"

To restrict dashboard access to specific addresses, add a [roles] section with an admins list. When admins is non-empty, only addresses listed will be allowed access.

[roles]
admins = ["alice@example.com", "bob@example.com"]

Usage

  1. Set API keys, system prompt, and authorized users in darkglass.toml
  2. Run uvx darkglass or pipx darkglass to launch production server
  3. Use the demo page to test the config: http://localhost:8000/static/demo.html
  4. Update reverse proxy configs as required to route requests to darkglass.
  5. Add the following snippet to your site, replacing the URL based on your chosen production endpoint:
<script src="https://darkglass.example.com/static/webchat.js"></script>
Demo Snippet

For quick demo purposes, the following snippet can be pasted into browser dev tools on any page to add a chat interface against a server running on localhost:

let darkglass = document.createElement('script')
darkglass.src = 'http://localhost:8000/static/webchat.js'
darkglass.defer = true
document.body.appendChild(darkglass)

Mock Data

For demonstration purposes, the interface will correctly respond to the following queries even with no LLM API keys configured:

  • "What is 1+1?"
  • "What is the capital of France?"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darkglass-1.3.1.tar.gz (744.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

darkglass-1.3.1-py2.py3-none-any.whl (11.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file darkglass-1.3.1.tar.gz.

File metadata

  • Download URL: darkglass-1.3.1.tar.gz
  • Upload date:
  • Size: 744.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for darkglass-1.3.1.tar.gz
Algorithm Hash digest
SHA256 96497b8c8095c343ecd8f8ff8fe9472e53b1f94fccd0083a9ea85840b64a3945
MD5 7d0deb37c0386d167328164d13f75bb5
BLAKE2b-256 a84ecb2b1b721a59870bd84ab6cd612b99a68900c88aa26c23f96457a2113fd9

See more details on using hashes here.

File details

Details for the file darkglass-1.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: darkglass-1.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for darkglass-1.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d3dffdf7f013fe95cf5126bbcf0a36d8fc7721509444a37d4456d3949b29874f
MD5 3f2f071d88d2ab142ce65c0f6493b7e6
BLAKE2b-256 50f7cc1db952f31f8ad2e4b8ec892acb4b346b54c3110d994dcc9e6f5318c714

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page