Spaces:
Paused
Paused
A newer version of the Gradio SDK is available:
6.1.0
NexaSci Agent Kit - Project Summary
What This Project Does
A complete local-first scientific agent system that:
- Uses a 10B Falcon model (NexaSci Assistant) for reasoning and tool calling
- Executes Python code in a sandboxed environment
- Searches and retrieves scientific papers from arXiv
- Performs semantic search over a local corpus of embedded papers
- Orchestrates multi-turn agent loops with tool usage
Architecture
βββββββββββββββββββ
β Agent Window β β User interface (CLI or Web UI)
β (Controller) β
ββββββββββ¬βββββββββ
β
ββββ Model Server (port 8001) βββ GPU (10B Model)
β
ββββ Tool Server (port 8000)
βββ python.run (sandboxed execution)
βββ papers.search (arXiv API)
βββ papers.fetch (paper metadata)
βββ papers.search_corpus (local semantic search)
Key Components
Model Server (
agent/model_server.py)- HTTP API for model inference
- Loads model once, serves multiple requests
- GPU-accelerated
Tool Server (
tools/server.py)- FastAPI server exposing all tools
- Python sandbox with resource limits
- Paper search and retrieval
Agent Controller (
agent/controller.py)- Orchestrates LLM β tool loop
- Parses tool calls and final responses
- Manages conversation state
Model Client (
agent/client_llm.py,agent/client_llm_remote.py)- Local model loading
- Remote model server client
- Message formatting and generation
Files Structure
Agent_kit/
βββ agent/ # Core agent code
β βββ model_server.py # HTTP model server
β βββ controller.py # Agent orchestration
β βββ client_llm.py # Local model client
β βββ client_llm_remote.py # Remote model client
β βββ config.yaml # Configuration
βββ tools/ # Tool implementations
β βββ server.py # FastAPI tool server
β βββ python_sandbox.py # Sandboxed Python executor
β βββ paper_sources/ # Paper search clients
βββ examples/ # Example scripts and prompts
βββ scripts/ # Utility scripts
βββ pipeline/ # Corpus building pipeline
βββ Dockerfile # Docker image definition
βββ docker-compose.yml # Docker orchestration
βββ README.md # Main documentation
Setup Options
Docker (Recommended for reproducibility)
docker-compose upstarts everything- GPU support via NVIDIA Container Toolkit
Manual (For development)
- Three terminal setup
- Model server, tool server, agent window
Configuration
All settings in agent/config.yaml:
- Model paths and settings
- Generation parameters
- Tool server URLs
- Sandbox limits
Testing
examples/test_model_server.py- Test model server connectionexamples/simple_test.py- Basic generation testexamples/demo_agent.py- Full agent demo with tool usage
Deployment
See DEPLOYMENT.md for:
- Docker deployment
- Remote GPU box setup
- Health checks and monitoring
Next Steps
- Push to remote repository
- Set up CI/CD (optional)
- Add more tools (optional)
- Build corpus for local search (optional)