ScottzillaSystems commited on
Commit
1fb5c33
Β·
verified Β·
1 Parent(s): f846157

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +163 -6
README.md CHANGED
@@ -1,10 +1,167 @@
1
  ---
2
- title: Ml Intern Custom
3
- emoji: πŸ“š
4
- colorFrom: green
5
- colorTo: red
6
  sdk: docker
7
- pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: AI Agent Workspace
3
+ colorFrom: purple
4
+ colorTo: blue
 
5
  sdk: docker
6
+ app_port: 7860
7
  ---
8
 
9
+ <p align="center">
10
+ <h1>πŸ€– AI Agent Workspace</h1>
11
+ <p><i>A customizable autonomous AI agent for research, coding, and ML workflows</i></p>
12
+ </p>
13
+
14
+ ---
15
+
16
+ ## What This Is
17
+
18
+ A fork of the [ML Intern](https://hf.co/spaces/smolagents/ml-intern) architecture β€” an autonomous AI agent that researches, writes code, and ships projects using the Hugging Face ecosystem.
19
+
20
+ **Key capabilities:**
21
+ - πŸ”¬ **Research** β€” Search papers, datasets, models, and documentation
22
+ - πŸ’» **Code** β€” Write, test, and execute Python scripts in sandboxes
23
+ - πŸš€ **Deploy** β€” Launch training jobs, manage repos, push to Hub
24
+ - πŸ“š **Learn** β€” Read documentation and GitHub repos to understand APIs
25
+
26
+ ## Architecture
27
+
28
+ ```
29
+ User (Web UI / CLI)
30
+ ↕
31
+ FastAPI Backend (SSE events)
32
+ ↕
33
+ Agent Loop (LiteLLM + tool router)
34
+ ↕
35
+ Tools: HF docs | Papers | Datasets | GitHub | Jobs | Sandbox | MCP
36
+ ```
37
+
38
+ **Stack:**
39
+ - **Frontend:** React + Vite + TypeScript
40
+ - **Backend:** FastAPI + SSE streaming
41
+ - **Agent:** LiteLLM (multi-provider) + custom tool system
42
+ - **Tools:** Hugging Face APIs, GitHub, sandbox execution, MCP servers
43
+
44
+ ## Quick Start
45
+
46
+ ### Local CLI
47
+
48
+ ```bash
49
+ git clone https://huggingface.co/spaces/ScottzillaSystems/ml-intern-custom
50
+ cd ml-intern-custom
51
+
52
+ # Install dependencies (requires Python 3.11+, uv)
53
+ uv sync
54
+
55
+ # Run interactive mode
56
+ python -m agent.main
57
+
58
+ # Or headless
59
+ python -m agent.main "your task here"
60
+ ```
61
+
62
+ ### Environment Variables
63
+
64
+ Create `.env`:
65
+ ```bash
66
+ # Required
67
+ HF_TOKEN=hf_... # Hugging Face token
68
+
69
+ # Optional - for non-HF-router models
70
+ ANTHROPIC_API_KEY=sk-ant-... # Claude models
71
+ OPENAI_API_KEY=sk-... # OpenAI models
72
+ GITHUB_TOKEN=ghp_... # GitHub code search
73
+ ```
74
+
75
+ ### Web UI
76
+
77
+ The Space runs the web UI automatically. For local dev:
78
+ ```bash
79
+ cd frontend && npm install && npm run dev # Vite dev server
80
+ cd backend && python main.py # FastAPI backend
81
+ ```
82
+
83
+ ## Customization Guide
84
+
85
+ ### 1. Change the Model
86
+
87
+ Edit `configs/frontend_agent_config.json` or `configs/cli_agent_config.json`:
88
+
89
+ ```json
90
+ {
91
+ "model_name": "moonshotai/Kimi-K2.6",
92
+ "mcpServers": { ... }
93
+ }
94
+ ```
95
+
96
+ **Available models via HF Router (free tier):**
97
+ - `moonshotai/Kimi-K2.6`
98
+ - `MiniMaxAI/MiniMax-M2.7`
99
+ - `zai-org/GLM-5.1`
100
+
101
+ **Or any LiteLLM-compatible model:**
102
+ - `anthropic/claude-sonnet-4-5-20250929`
103
+ - `openai/gpt-4o`
104
+ - `google/gemini-2.5-pro`
105
+
106
+ ### 2. Add/Remove Tools
107
+
108
+ Edit `agent/core/tools.py`:
109
+
110
+ ```python
111
+ def create_builtin_tools(local_mode=False):
112
+ tools = [
113
+ # Your custom tools here
114
+ ToolSpec(name="my_tool", ...),
115
+ # ... existing tools
116
+ ]
117
+ return tools
118
+ ```
119
+
120
+ ### 3. Add MCP Servers
121
+
122
+ Edit `configs/frontend_agent_config.json`:
123
+
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "my-server": {
128
+ "transport": "http",
129
+ "url": "https://my-mcp-server.com/mcp",
130
+ "headers": { "Authorization": "Bearer ${MY_TOKEN}" }
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ ### 4. Customize System Prompt
137
+
138
+ Edit `agent/prompts/system_prompt.yaml` to change the agent's personality and instructions.
139
+
140
+ ### 5. Change Branding
141
+
142
+ - Frontend: Edit `frontend/src/theme.ts` for colors
143
+ - Frontend: Edit `frontend/src/components/WelcomeScreen/WelcomeScreen.tsx` for welcome text
144
+ - Backend: Edit `backend/main.py` for API metadata
145
+
146
+ ## Project Structure
147
+
148
+ ```
149
+ agent/
150
+ core/ # Agent loop, session, context manager
151
+ tools/ # Tool implementations (HF, GitHub, sandbox, etc.)
152
+ prompts/ # System prompts
153
+ main.py # CLI entry point
154
+ backend/
155
+ main.py # FastAPI app
156
+ routes/ # API endpoints
157
+ session_manager.py
158
+ frontend/
159
+ src/ # React components
160
+ configs/
161
+ frontend_agent_config.json
162
+ cli_agent_config.json
163
+ ```
164
+
165
+ ## Original
166
+
167
+ Based on [smolagents/ml-intern](https://hf.co/spaces/smolagents/ml-intern) by Hugging Face.