Smarter Architecture at a glance
- Scalable serverless Kubernetes compute infrastructure that is largely self-maintaining.
- Countermeasures for common Internet and web intrusion strategies including SQL injection, cross-site request forgeries, brute force password attacks, distributed denial of service, cross-site scripting, clickjacking, host header corruptions. Additionally, Smarter goes to great pains to minimize its attack surface, primarily by only opening ports 80 and 443 to the public.
- Python-Django customer web dashboard application for developing plugin-based API’s deployed to custom domains.
- LangChain managed LLM API requests. This provides a layer of abstraction between Smarter and underlying LLM vendor providers, and it also provides a simple means of standardizing Smarter customers’ API format.
- React.js sandbox chat UI for prototyping pre-production APIs. Also works as a skinnable stand-in production UI if a customer want this.
- Customer API logging architecture implemented with Django models, signals and Celery tasks.
- Customer admin team management features.
- Configurable use-based billing features based on API calls as well as plugin usage.
Smarter.sh Hosted Service
Customers who use the Smarter.sh SaaS service access this cloud-hosted service architecture.
Python Django
Most of Smarter is developed using Python’s Django web framework with the following noteworthy additions:
- Django-rest-knox, used for creating secure, performant REST APIs.
- Django Celery, a robust asynchronous compute layer using Celery, Redis, and Kubernetes which can be leveraged for scheduled tasks like automated reports as well as real-time compute-intensive functions.
- Pydantic, for extending Django’s settings module to facilitate CI-CD friendly configuration data from multiple sources: environment variable, terraform, Kubernetes secrets, Github Actions secrets, etc.
- Open-source Python libraries, including Pandas, NumPy, SciPy, and Levenshtein.
- OpenAI as the default LLM integration. Other LLMs can also be used.
- LangChain to manage chatbot data flow.
ReactJS chat application
The chat app in the dashboard sandbox is written in ReactJS. The React app leverages Vite.js, @chatscope/chat-ui-kit-react, and react-pro-sidebar.
Webapp design features
- robust, highly customizable chat features
- A component model for implementing your own highly personalized OpenAI apps
- Skinnable UI for each app
- Includes default assets for each app
- Small compact code base
- Robust error handling for non-200 response codes from the custom REST API
- Handles direct text input as well as file attachments
- Info link to the OpenAI API official code sample
- Build-deploy managed with Vite
Smarter REST API
Not to be confused with Smarter’s flagship product, customer-implemented custom REST API’s, Smarter additionally has its own chatbot management REST API, which is a Python Django project implementing Querium’s proprietary Plugin model, along with additional models for commercializing the service.
Chatbot management API end points
- /v0/api-auth/
- /v0/api-auth/logout
- /v0/chat/
- /v0/chat/chatgpt/
- /v0/chat/langchain/
- /v0/accounts – PENDING
- /v0/accounts/str:account_id/payment-methods
- /v0/account
- /v0/accounts/users/
- /v0/accounts/users/str:username/add-example-plugins
- /v0/accounts/payment-methods/
- /v0/plugins/
- /v0/plugins/int:plugin_id
- /v0/plugins/int:plugin_id/clone/str:new_name