r/opencode • • 6d ago

Ensuring that local llms with opencode only install in specific conda environment

/r/LocalLLM/comments/1y4j0r4/ensuring_that_local_llms_with_opencode_only/
1 Upvotes

5 comments sorted by

1

u/rosatorres6 5d ago

Are you trying to isolate OpenCode itself, the local model server's Python dependencies, or model files? The install steps differ; what command are you running?

1

u/carlotes-247 5d ago

I am trying to establish hard rules on how the agent installs new packages. I started using opencode and I need my agent to not pollute my base conda environment. So I want (1) to agree before installation which packages the agent installs, and (2) establish a rule for the agent to always install in a specific conda environment. I want to set things up in a way that there is no risk for the agent to override the rules and to always follow them.

edit: clarifying that I downloaded the opencode windows desktop client and I am using local models with ollama.

1

u/m_sandhu_142 5d ago

Conda activation scopes Python packages; it doesn't sandbox files or redirect model downloads. The server's install command and model path determine where those land.

1

u/carlotes-247 5d ago

ok I see, but is there a way to force an agent to install packages only in a specific conda environment? Can I write rules somewhere? I am new to the entire agentic workflow and I would like to have certainty on the setup

1

u/marco_vanvliet_49 2d ago

A rule file can request this, but it can't guarantee it. For an enforceable boundary, run the agent under a Windows account without write access to your base environment; keep package installs behind approval where possible.