Home
Neurosurfer helps you build intelligent apps that blend LLM reasoning, tools, and retrieval with a ready-to-run FastAPI backend and a React dev UI. Start lean, add power as you go β CPU-only or GPU-accelerated.
π Whatβs in the box¶
- π€ Agents: Production-ready patterns for ReAct, SQL, RAG, Router etc. think β act β observe β answer
- π§ Models: Unified interface for OpenAI-style and local backends like Transformers/Unsloth, vLLM, Llama.cpp etc.
- π RAG: Simple, swappable retrieval core: embed β search β format β token-aware trimming
- βοΈ FastAPI Server: OpenAI-compatible endpoints for chat + tools β custom endpoints, chat handlers, RAG etc.
- π₯οΈ NeurowebUI: React chat UI (GPT-style) that communicates with the server out-of-the-box
- π§ͺ CLI:
neurosurfer serveto run server/UI β custom backend app and UI support
π Tutorials
| # | Tutorial | Link | Description |
|---|---|---|---|
| 1 | Neurosurfer Quickstart | | Learn how to load local and OpenAI models, stream responses, and build your first RAG and tool-based agents directly in Jupyter or Colab. |
More tutorials coming soon β covering RAG, Custom Tools, More on Agents, FastAPI integration and more.
ποΈ News¶
- Agents: ReAct & SQLAgent upgraded with bounded retries, spec-aware input validation, and better final-answer streaming; new ToolsRouterAgent for quick one-shot tool picks.
- Models: Cleaner OpenAI-style responses across backends; smarter token budgeting + fallbacks when tokenizer isnβt available.
- Server: Faster startup, better logging/health endpoints, and safer tool execution paths; OpenAI-compatible routes refined for streaming/tool-calling.
- CLI:
servenow runs backend-only or UI-only and auto-injectsVITE_BACKEND_URL; new subcommands for ingest/traces to standardize local workflows.
Looking for older updates? Check the repo Releases and Changelog.
β‘ Quick Start¶
A 60-second path from install β dev server β your first inference.
Install (minimal core):
Or full LLM stack (torch, transformers, bnb, unsloth):
Run the dev server (backend + UI):
- Auto-detects UI; pass--ui-root if needed. First run may npm install.- Backend binds to config defaults; override with flags or envs.
Dependencies
Before running the CLI, make sure you have environment ready with dependencies installed. For the default UI, cli requires npm, nodejs and serve to be installed on your system.
Hello LLM Example:
from neurosurfer.models.chat_models.transformers import TransformersModel
llm = TransformersModel(
model_name="unsloth/Llama-3.2-1B-Instruct-bnb-4bit",
load_in_4bit=True
)
res = llm.ask(user_prompt="Say hi!", system_prompt="Be concise.", stream=False)
print(res.choices[0].message.content)
ποΈ High-Level Architecture¶
Neurosurfer Architecture
β¨ Key Features¶
-
Production API
Deploy with FastAPI, authentication, chat APIs, and OpenAI-compatible endpoints.
-
Intelligent Agents
Build ReAct, SQL, and RAG agents with minimal code. Each agent type is optimized for specific tasks.
-
Rich Tool Ecosystem
Use built-in tools or create your own β calculators, web calls, files, custom actions.
-
RAG System
Ingest documents, chunk intelligently, and retrieve relevant context for your LLMs.
-
Vector Databases
Built-in ChromaDB, extensible interface for other stores.
-
Multi-LLM Support
Work with OpenAI, Transformers/Unsloth, vLLM, Llama.cpp, and OpenAI-compatible APIs.
π¦ Install Options¶
pip (recommended)
pip + full LLM stack
From source
CUDA notes (Linux x86_64):
# Wheels bundle CUDA; you just need a compatible NVIDIA driver.
pip install -U torch --index-url https://download.pytorch.org/whl/cu124
# or CPU-only:
pip install -U torch --index-url https://download.pytorch.org/whl/cpu
π License¶
Licensed under Apache-2.0. See LICENSE.
π Support¶
- β Star the project on GitHub.
- π¬ Ask & share in Discussions: Discussions.
- π§ Read the Docs.
- π File Issues.
- π Security: report privately to naumanhsa965@gmail.com.
π Citation¶
If you use Neurosurfer in your work, please cite:
@software{neurosurfer,
author = {Nouman Ahsan and Neurosurfer contributors},
title = {Neurosurfer: A Production-Ready AI Agent Framework},
year = {2025},
url = {https://github.com/NaumanHSA/neurosurfer},
version = {0.1.0},
license = {Apache-2.0}
}