OCHABOT GPT OR RAG (RTFM)
Description
this project used on my profile page: iank.me. Based on mistral AI, OpenAI, Groq, langchain and chroma vector database, I'm still learning, and this is my first project in AI
Platform Support
AI Platform
- OpenAI
- MistralAI
- Groq
- Deepseek
- Ollama
Embedding
- Huggingface
- Mistral
- Nvidia
Requirements
Databse
- Redis (LLM Cache and setup)
- Postgree (History)
- ChromaDB (Vector Database)
Storage
- Minio
How To Run
Running via poetry and activate virtualenvironment
poetry env activate
Run the serve
poetry run http serve
Install Requirement
poetry install
Environment Setup
cp env.example .env
please setup APP_ENVIRONTMENT to local if you setup on development mode
Running
python main.py serve
with docker
docker compose up --build
Migration
Using Alembic
alembic revision -m "Your Table"
run migration
alembic upgrade head
Swagger
http://localhost:8081/docs
Default User
username: admin
password: admin
Socket
url:
localhost:8081/ex/v1/chat/ws/{client_id}
payload:
{
"chat": "hello",
"collection": "ocha_v2",
"llm": "openai", // optional
"model": "gpt-4o-mini" // optional
}
Structured Diagram
graph TB
User((External User))
subgraph "Ochabot System"
subgraph "API Layer"
FastAPI["API Server<br>(FastAPI)"]
Router["Router<br>(FastAPI Router)"]
WebSocket["WebSocket Handler<br>(FastAPI WebSocket)"]
subgraph "API Components"
ChatHandler["Chat Handler<br>(Python)"]
UserHandler["User Handler<br>(Python)"]
IngestHandler["Ingest Handler<br>(Python)"]
PromptHandler["Prompt Handler<br>(Python)"]
SetupHandler["Setup Handler<br>(Python)"]
ClientHandler["Client Handler<br>(Python)"]
LoginHandler["Login Handler<br>(Python)"]
end
end
subgraph "LLM Services"
LLMWrapper["LLM Wrapper<br>(Python)"]
subgraph "LLM Providers"
OpenAI["OpenAI Service<br>(OpenAI API)"]
Mistral["Mistral Service<br>(Mistral API)"]
Groq["Groq Service<br>(Groq API)"]
DeepSeek["DeepSeek Service<br>(DeepSeek API)"]
Ollama["Ollama Service<br>(Ollama API)"]
end
end
subgraph "Data Storage"
PostgreSQL[("PostgreSQL<br>(Primary Database)")]
Redis[("Redis<br>(Cache)")]
MinIO[("MinIO<br>(Object Storage)")]
ChromaDB[("ChromaDB<br>(Vector Store)")]
end
subgraph "Core Services"
DatabaseService["Database Service<br>(SQLAlchemy)"]
VectorService["Vector Store Service<br>(LangChain)"]
CacheService["Cache Service<br>(Redis Stack)"]
StorageService["Storage Service<br>(MinIO)"]
end
end
%% Connections
User -->|"HTTP/WebSocket"| FastAPI
FastAPI -->|"Routes"| Router
Router -->|"Handles WebSocket"| WebSocket
%% API Components connections
Router --> ChatHandler
Router --> UserHandler
Router --> IngestHandler
Router --> PromptHandler
Router --> SetupHandler
Router --> ClientHandler
Router --> LoginHandler
%% LLM Service connections
ChatHandler --> LLMWrapper
LLMWrapper --> OpenAI
LLMWrapper --> Mistral
LLMWrapper --> Groq
LLMWrapper --> DeepSeek
LLMWrapper --> Ollama
%% Data Storage connections
DatabaseService --> PostgreSQL
CacheService --> Redis
StorageService --> MinIO
VectorService --> ChromaDB
%% Service Usage connections
ChatHandler --> DatabaseService
UserHandler --> DatabaseService
IngestHandler --> DatabaseService
PromptHandler --> DatabaseService
SetupHandler --> DatabaseService
ClientHandler --> DatabaseService
LoginHandler --> DatabaseService
ChatHandler --> VectorService
IngestHandler --> VectorService
ChatHandler --> CacheService
UserHandler --> CacheService
IngestHandler --> StorageService
Metadata
Release files for ochabot 0.8.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ochabot-0.8.4.tar.gz | 19.4 kB | Without provenance | Details for ochabot-0.8.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ochabot-0.8.4-py3-none-any.whl | Python 3 | none | any | Details for ochabot-0.8.4-py3-none-any.whl |
Total release size: 67.4 kB
Release files / ochabot-0.8.4.tar.gz
| Download URL | ochabot-0.8.4.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3db1ad529431f7fd08d41f2a356b62a9639418c3044006d39f40f4ad083bd202
|
|
BLAKE2b-256 checksum How to use checksums |
db7e38a7eb76c1547c3ccd5a696e7a184fb3771879bc2197ce5a516355c394c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.1 Darwin/23.6.0
|
Release files / ochabot-0.8.4-py3-none-any.whl
| Download URL | ochabot-0.8.4-py3-none-any.whl |
|---|---|
| Size | 48.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e72080e97af05f4c552aca95c0af0ee5333eebb3d44190e76df984ba12a27436
|
|
BLAKE2b-256 checksum How to use checksums |
5ebc8d0c6ad94ee1ae146f75ad09806dc8e764ea439b5dbfbd67b36a35170c3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.1 CPython/3.13.1 Darwin/23.6.0
|
Security for ochabot 0.8.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.