You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(config): streamline environment variable handling in AppConfigModel
- Simplified the logic for setting API key and host from environment variables and Colab userdata.
Alternatively, use [Context7](https://github.com/upstash/context7) to provide up-to-date nnsight documentation directly to your LLM. Add `use context7` to your prompts or configure it in your MCP client:
74
+
75
+
```json
76
+
{
77
+
"mcpServers": {
78
+
"context7": {
79
+
"url": "https://mcp.context7.com/mcp"
80
+
}
81
+
}
82
+
}
83
+
```
84
+
85
+
See the [Context7 README](https://github.com/upstash/context7/blob/master/README.md) for full installation instructions across different IDEs.
86
+
87
+
### Documentation Files
88
+
89
+
You can also add our documentation files directly to your agent's context:
90
+
91
+
-**[llms.md](./llms.md)** — Comprehensive guide for AI agents working with nnsight
92
+
-**[NNsight.md](./NNsight.md)** — Deep technical documentation on nnsight's internals
> **💡 Tip:** Always call `.save()` on values you want to access after the trace exits. Without `.save()`, values are garbage collected. You can also use `nnsight.save(value)` as an alternative.
55
117
56
-
---
57
-
58
118
## Accessing Activations
59
119
60
120
```python
@@ -74,8 +134,6 @@ with model.trace("The Eiffel Tower is in the city of"):
74
134
75
135
**Note:** GPT-2 transformer layers return tuples where index 0 contains the hidden states.
76
136
77
-
---
78
-
79
137
## Modifying Activations
80
138
81
139
### In-Place Modification
@@ -101,8 +159,6 @@ with model.trace("Hello"):
101
159
result = model.transformer.h[-1].mlp.output.save()
102
160
```
103
161
104
-
---
105
-
106
162
## Batching with Invokers
107
163
108
164
Process multiple inputs in one forward pass. Each invoke runs its code in a **separate worker thread**:
Copy file name to clipboardExpand all lines: llms.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# CLAUDE.md - NNsight AI Agent Guide
1
+
# llms.md - NNsight AI Agent Guide
2
2
3
3
This document provides comprehensive guidance for AI agents working with the `nnsight` library. NNsight enables interpreting and manipulating the internals states of deep learning models through a deferred execution tracing system.
0 commit comments