Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PromtEngineer/localGPT
/ functions
Functions
452 in github.com/PromtEngineer/localGPT
⨍
Functions
452
◇
Types & classes
88
↓ 65 callers
Method
send_json_response
Send a JSON (UTF-8) response with CORS headers. Safe against client disconnects.
backend/server.py:1059
↓ 33 callers
Function
cn
(...inputs: ClassValue[])
src/lib/utils.ts:4
↓ 31 callers
Function
print_status
Print status with emoji
system_health_check.py:11
↓ 17 callers
Method
run
Synchronous helper. If *event_callback* is supplied, important milestones will be forwarded to that callable as event_callback(ph
rag_system/agent/loop.py:251
↓ 16 callers
Method
get_user_input
Get user input with optional default value.
create_index_script.py:70
↓ 15 callers
Method
send_json_response
Utility to send a JSON response with CORS headers.
rag_system/api_server.py:734
↓ 14 callers
Method
send_json_response
Utility to send a JSON response with CORS headers.
rag_system/api_server_with_progress.py:404
↓ 12 callers
Method
update
Update progress with number of items processed
rag_system/utils/batch_processor.py:33
↓ 11 callers
Function
displayName
(label: string)
src/components/ui/chat-settings-modal.tsx:131
↓ 10 callers
Method
add_message
Add a message to a session
backend/database.py:157
↓ 10 callers
Method
generate_completion
Generates a completion, now with optional support for images. Args: model: The name of the generation model (e.g., 'llav
rag_system/utils/ollama_client.py:36
↓ 10 callers
Function
timer
Context manager to time operations
rag_system/utils/batch_processor.py:12
↓ 8 callers
Method
encode
Return one vector *per* span. Args: text: Full document text. chunk_spans: List of (char_start, char_end) offsets for
rag_system/indexing/latechunk.py:43
↓ 8 callers
Method
get_index
(self, index_id: str)
backend/database.py:342
↓ 8 callers
Method
get_table
(self, table_name: str)
rag_system/indexing/embedders.py:14
↓ 7 callers
Method
get_indexes_for_session
(self, session_id: str)
backend/database.py:386
↓ 7 callers
Method
get_session
Get a specific session
backend/database.py:141
↓ 7 callers
Function
normalizeWhitespace
(text: string)
src/utils/textNormalization.ts:6
↓ 7 callers
Function
print_section
Print a formatted section header.
rag_system/utils/validate_model_config.py:33
↓ 7 callers
Method
update
Update progress and send notification
rag_system/api_server_with_progress.py:89
↓ 7 callers
Method
update_index_metadata
Merge new key/values into an index's metadata JSON column.
backend/database.py:428
↓ 6 callers
Method
is_ollama_running
Check if Ollama server is running
backend/ollama_client.py:13
↓ 5 callers
Method
_token_len
Get token count for text using the tokenizer.
rag_system/ingestion/chunking.py:29
↓ 5 callers
Method
createMessage
( content: string, sender: 'user' | 'assistant', isLoading = false )
src/lib/api.ts:407
↓ 5 callers
Method
create_embeddings
(self, texts: List[str])
rag_system/indexing/representations.py:45
↓ 5 callers
Method
index
(self, table_name: str, chunks: List[Dict[str, Any]], embeddings: np.ndarray)
rag_system/indexing/embedders.py:30
↓ 5 callers
Method
list_models
Get list of available models
backend/ollama_client.py:21
↓ 5 callers
Function
print_header
Print a formatted header.
rag_system/utils/validate_model_config.py:27
↓ 5 callers
Method
send_event
Send an SSE event to a specific session
rag_system/api_server_with_progress.py:48
↓ 4 callers
Function
_apply_index_embedding_model
Ensure retrieval pipeline uses the embedding model stored with the first index.
rag_system/api_server.py:42
↓ 4 callers
Method
_command_exists
Check if a command exists in PATH.
run_system.py:213
↓ 4 callers
Method
add_document_to_index
(self, index_id: str, filename: str, stored_path: str)
backend/database.py:374
↓ 4 callers
Method
chat
Send a chat message to Ollama
backend/ollama_client.py:57
↓ 4 callers
Method
createSession
(title: string = 'New Chat', model: string = 'llama3.2:latest')
src/lib/api.ts:148
↓ 4 callers
Method
create_index
(self, name: str, description: str|None = None, metadata: dict | None = None)
backend/database.py:328
↓ 4 callers
Method
format
(self, record)
run_system.py:71
↓ 4 callers
Method
generate
(self, query: str)
rag_system/retrieval/query_transformer.py:299
↓ 4 callers
Function
get_agent
Factory function to get an instance of the RAG agent based on the specified mode. Args: mode: Configuration mode ("default", "fa
rag_system/main.py:167
↓ 4 callers
Method
retrieve
(self, query: str, k: int = 5, score_cutoff: int = 80)
rag_system/retrieval/retrievers.py:31
↓ 4 callers
Method
update_session_title
Update session title
backend/database.py:219
↓ 3 callers
Method
_get_db_manager
(self)
rag_system/pipelines/retrieval_pipeline.py:66
↓ 3 callers
Function
_get_table_name_for_session
Get the correct vector table name for a session by looking up its linked indexes.
rag_system/api_server.py:71
↓ 3 callers
Method
_get_text_embedder
(self)
rag_system/pipelines/retrieval_pipeline.py:75
↓ 3 callers
Method
_image_to_base64
Converts a Pillow Image to a base64 string.
rag_system/utils/ollama_client.py:18
↓ 3 callers
Method
_send_progress_update
Send progress update via Server-Sent Events
rag_system/api_server_with_progress.py:132
↓ 3 callers
Method
chunk
(self, text: str, document_id: str, document_metadata: Dict[str, Any] | None = None)
rag_system/ingestion/docling_chunker.py:249
↓ 3 callers
Function
estimate_memory_usage
Estimate memory usage of chunks in MB
rag_system/utils/batch_processor.py:199
↓ 3 callers
Method
finish
Report final statistics
rag_system/utils/batch_processor.py:59
↓ 3 callers
Function
generateUUID
()
src/lib/api.ts:4
↓ 3 callers
Function
generate_session_title
Generate a session title from the first message
backend/database.py:639
↓ 3 callers
Method
getModels
()
src/lib/api.ts:422
↓ 3 callers
Method
getSession
(sessionId: string)
src/lib/api.ts:170
↓ 3 callers
Method
getSessionIndexes
(sessionId: string)
src/lib/api.ts:529
↓ 3 callers
Method
get_messages
Get all messages for a session
backend/database.py:184
↓ 3 callers
Method
is_port_in_use
Check if a port is already in use.
run_system.py:174
↓ 3 callers
Method
process_in_batches
Process items in batches with progress tracking Args: items: List of items to process process_func:
rag_system/utils/batch_processor.py:76
↓ 3 callers
Method
start_service
Start a single service.
run_system.py:248
↓ 3 callers
Method
stream_completion
Generator that yields partial *response* strings as they arrive. Example: for tok in client.stream_completion("qwen2", "Hello"):
rag_system/utils/ollama_client.py:121
↓ 3 callers
Function
validate_model_config
Validates the model configuration for consistency and availability. Raises: ValueError: If configuration conflicts are detected
rag_system/main.py:211
↓ 2 callers
Method
_format_query_with_history
Formats the user query with conversation history for context.
rag_system/agent/loop.py:152
↓ 2 callers
Method
_generate_summary
Generates a contextual summary using a structured, multi-part prompt.
rag_system/indexing/contextualizer.py:39
↓ 2 callers
Method
_get_dense_retriever
Ensure a dense MultiVectorRetriever is always available unless explicitly disabled.
rag_system/pipelines/retrieval_pipeline.py:84
↓ 2 callers
Method
_load_overviews
Helper to load overviews from a .jsonl file into self.doc_overviews.
rag_system/agent/loop.py:55
↓ 2 callers
Method
_perform_conversion
Perform the actual conversion using the specified converter.
rag_system/ingestion/document_converter.py:118
↓ 2 callers
Method
_print_status_summary
Print system status summary.
run_system.py:406
↓ 2 callers
Method
_simple_pattern_routing
📝 FALLBACK: Simple pattern-based routing (original logic).
backend/server.py:506
↓ 2 callers
Method
_synthesize_final_answer
Uses a text LLM to synthesize a final answer from extracted facts.
rag_system/pipelines/retrieval_pipeline.py:219
↓ 2 callers
Method
_token_len
(self, text: str)
rag_system/ingestion/docling_chunker.py:40
↓ 2 callers
Method
cleanup_empty_sessions
Remove sessions with no messages
backend/database.py:243
↓ 2 callers
Method
convertDbMessage
(dbMessage: Record<string, unknown>)
src/lib/api.ts:396
↓ 2 callers
Function
create_contextual_window
(all_chunks: List[Dict[str, Any]], chunk_index: int, window_size: int = 1)
rag_system/ingestion/chunking.py:128
↓ 2 callers
Method
create_session
Create a new chat session
backend/database.py:108
↓ 2 callers
Function
currentCleanup
(text)
test_markdown_streaming.js:45
↓ 2 callers
Method
ensure_models
Ensure required Ollama models are available.
run_system.py:222
↓ 2 callers
Method
get_documents_for_session
Retrieves all document file paths for a given session.
backend/database.py:315
↓ 2 callers
Method
get_sessions
Get all chat sessions, ordered by most recent
backend/database.py:124
↓ 2 callers
Method
get_stats
Get database statistics
backend/database.py:272
↓ 2 callers
Function
handleSessionSelect
(sessionId: string)
src/components/demo.tsx:43
↓ 2 callers
Function
improvedCleanup
(text)
test_markdown_streaming.js:49
↓ 2 callers
Method
linkIndexToSession
(sessionId: string, indexId: string)
src/lib/api.ts:512
↓ 2 callers
Method
load_overviews_for_indexes
Aggregate overviews for the given indexes or fall back to global file.
rag_system/agent/loop.py:74
↓ 2 callers
Method
monitor
Monitor running services and restart if needed.
run_system.py:469
↓ 2 callers
Function
normalizeStreamingToken
(currentText: string, newToken: string)
src/utils/textNormalization.ts:30
↓ 2 callers
Method
remove_connection
Remove an SSE connection
rag_system/api_server_with_progress.py:41
↓ 2 callers
Method
rerank
Reranks a list of documents based on their relevance to a query. If *early_exit* is True the cross-encoder scores documents in mini-
rag_system/rerankers/reranker.py:30
↓ 2 callers
Function
run_indexing
Runs the indexing pipeline for the specified documents.
rag_system/main.py:242
↓ 2 callers
Function
select_embedder
Return appropriate EmbeddingModel implementation for the given name.
rag_system/indexing/representations.py:145
↓ 2 callers
Method
shutdown
Gracefully shutdown all services.
run_system.py:428
↓ 2 callers
Method
split_markdown
Split one Markdown doc into chunks with max_tokens limit.
rag_system/ingestion/docling_chunker.py:47
↓ 2 callers
Function
start_server
Starts the API server.
rag_system/api_server.py:743
↓ 2 callers
Function
truncate
(str: string, n: number = 18)
src/components/ui/session-chat.tsx:32
↓ 1 callers
Method
_convert_general_to_markdown
Convert non-PDF formats using general converter.
rag_system/ingestion/document_converter.py:113
↓ 1 callers
Method
_convert_pdf_to_markdown
Convert PDF with OCR detection logic.
rag_system/ingestion/document_converter.py:77
↓ 1 callers
Method
_convert_txt_to_markdown
Convert plain text files to markdown by reading content directly.
rag_system/ingestion/document_converter.py:97
↓ 1 callers
Method
_cosine_similarity
Computes cosine similarity between two vectors.
rag_system/agent/loop.py:104
↓ 1 callers
Method
_embed_single
(self, text: str)
rag_system/indexing/representations.py:113
↓ 1 callers
Method
_embed_single
(q: str)
rag_system/retrieval/retrievers.py:67
↓ 1 callers
Method
_ensure_model
Lazily download and load the Provence model exactly once.
rag_system/rerankers/sentence_pruner.py:33
↓ 1 callers
Method
_find_in_semantic_cache
Finds a semantically similar query in the cache.
rag_system/agent/loop.py:125
↓ 1 callers
Method
_generate_translation_prompt
(self, query: str)
rag_system/retrieval/query_transformer.py:309
next →
1–100 of 452, ranked by callers