How to use OpenCode with a self-hosted model on a cloud GPU
Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Install OpenCode with the command the official README prints, serve a model on that machine, and point opencode.jsonc at the OpenAI-compatible baseURL or the Ollama URL those docs print. Copy the project directory, including opencode.json or opencode.jsonc, before you destroy the instance, because destroying the instance deletes its disk.
An agent can rent the GPU and run this program on it. The agent pages are GPU compute for AI agents and the agent integration guide. Those pages are how an agent discovers a GPU and runs work on it. This page is the OpenCode install. A workflow editor whose Docker install publishes port 5678, and whose Ollama credentials default the Base URL to http://localhost:11434, is How to run n8n AI agents with a self-hosted model on a cloud GPU. A CLI whose providers page sets OLLAMA_HOST to http://localhost:11434 is How to run the goose agent with a self-hosted model on a cloud GPU. A terminal coding agent whose install page runs aider-install is How to use Aider with a self-hosted model on a cloud GPU. An editor client whose install page is the VS Code extension, and whose OpenAI Compatible setting takes the forwarded Base URL, is How to use Cline with a self-hosted model on a cloud GPU. An editor whose config.yaml sets an apiBase for chat, autocomplete, and embeddings is How to use Continue with a self-hosted model on a cloud GPU. An editor whose README says the extension was shut down on May 15th, and whose OpenAI Compatible page sets a Base URL, is How to use Roo Code with a self-hosted model on a cloud GPU. A canvas whose self-host page opens http://localhost/install is How to run Dify with a self-hosted model on a cloud GPU. A canvas whose ChatOllama page names a base URL is How to run Flowise with a self-hosted model on a cloud GPU. A flow editor whose Ollama component defaults the base URL to http://127.0.0.1:11434 is How to run Langflow with a self-hosted model on a cloud GPU. A CLI whose connect help sets --base-url to http://localhost:8000/v1 for openai-compatible is How to run Letta agents with a self-hosted model on a cloud GPU. A browser chat whose serve command listens on port 8080 is How to run Open WebUI on a cloud GPU. A Python agent library whose CodeAgent can take TransformersModel or an OpenAI-compatible server is How to run smolagents with a self-hosted model on a cloud GPU. A crew whose LLM class takes base_url for Ollama or an OpenAI-compatible server is How to run CrewAI with a self-hosted model on a cloud GPU. A graph runtime whose overview example does not name a model is How to run LangGraph agents with a self-hosted model on a cloud GPU. An AgentChat library whose Ollama example sets model to llama3.2 is How to run AutoGen agents with a self-hosted model on a cloud GPU. A typed agent whose vLLM example sets base_url to http://localhost:8000/v1 is How to run Pydantic AI agents with a self-hosted model on a cloud GPU. A framework whose README sets Ollama and HuggingFaceEmbedding is How to build LlamaIndex agents with a self-hosted model on a cloud GPU. A browser agent whose models page sets base_url to http://localhost:11434/v1 is How to run browser-use with a self-hosted model on a cloud GPU. A pipeline whose OllamaChatGenerator sets url to http://localhost:11434 is How to run Haystack agents with a self-hosted model on a cloud GPU. A program whose language-models page sets dspy.LM to ollama_chat/llama3.2:1b is How to run DSPy with a self-hosted model on a cloud GPU. An agent whose Ollama example sets id to llama3.1:8b is How to run Agno agents with a self-hosted model on a cloud GPU. A TypeScript agent whose local-models section sets url on the model object is How to run Mastra agents with a self-hosted model on a cloud GPU. A ChatAgent whose vLLM example sets ModelPlatformType.VLLM is How to run CAMEL-AI agents with a self-hosted model on a cloud GPU. A local agent UI whose Docker command publishes port 3000 is How to run OpenHands with a self-hosted model on a cloud GPU. A general vLLM install is How to serve an OpenAI-compatible API with vLLM on a cloud GPU. A general SGLang install is How to run SGLang on a cloud GPU. Ollama’s install and port 11434 are How to run Ollama on a cloud GPU. CloudGPU’s hosted gateway is a different base URL: How do I use an OpenAI-compatible API for open models?. How published weight sizes are read: How much VRAM do I need to run an LLM?. The tunnel is How to use SSH port forwarding on a cloud GPU. If the process runs out of memory: How to fix CUDA out of memory on a cloud GPU. If the process raises no kernel image on an RTX 5090: How to fix CUDA no kernel image on an RTX 5090.
The LICENSE file begins with MIT License, and the copyright line is Copyright © 2025 opencode.
The commands below are copied from the upstream files named in each step, at the commit in Sources. They were not run on a CloudGPU instance for this page. Anything this page adds around them is marked. The providers page lists other package names. This page does not copy those names.
What the docs print about memory
The README and the providers page print no GPU GB figure. The providers page says HTTP requests wait up to five minutes for response headers and up to fifteen minutes between streamed response chunks. Those lines are request timeouts. They are not vram_gb. The model information table on unsloth/Llama-3.1-8B-Instruct prints parameter counts 8B, 70B, and 405B, and a context length of 128k. This page does not treat those parameter counts as vram_gb. A later section of that card names training hardware. This page does not copy that section and does not use it as an inference memory figure. This page does not mark a catalog row as enough.
GET /v1/public/compute-capabilities does not list GPUs. It returns feature flags. The memory column is vram_gb from GET /v1/public/gpu-catalog (generated_at 2026-11-14T10:04:57.194Z). The catalog response also includes an availability field. This page does not copy it. Every catalog row below has min_gpu_count 1. Rows are sorted by vram_gb, then by name. Which listing you can start is on Deploy.
The catalog template list had no OpenCode template. It did have Ollama templates (jupyterlab-ollama, ollama-qwen3, ollama). Those templates are a different install. This page does not treat them as OpenCode.
| Catalog name | vram_gb |
|---|---|
| RTX 2080 | 8 |
| RTX 3080 | 10 |
| RTX 2080 Ti | 11 |
| RTX 3080 Ti | 12 |
| V100 16G | 16 |
| A30 | 24 |
| RTX 3090 | 24 |
| RTX 4090 | 24 |
| RTX 4090D | 24 |
| RTX 4080 SUPER 32G | 32 |
| RTX 5090 | 32 |
| RTX 5090D | 32 |
| V100 32G | 32 |
| A100 40G | 40 |
| A800 40G | 40 |
| A40 | 48 |
| RTX 4090 48G | 48 |
| RTX 4090D 48G | 48 |
| RTX A6000 | 48 |
| Ascend 910B | 64 |
| NVIDIA RTX PRO 5000 72G | 72 |
| RTX PRO 5000 72G | 72 |
| A100 80G | 80 |
| A800 80G | 80 |
| H800 | 80 |
| RTX 6000D | 83 |
| H20 96G | 96 |
| RTX PRO 6000 96G | 96 |
| RTX PRO 6000 Max-Q | 96 |
| H20-3e 141G | 141 |
Install
https://github.com/sst/opencode returned HTTP 301 to https://github.com/anomalyco/opencode on 2026-11-14. The default branch is dev. That branch on 2026-11-14 was commit 024a1462f55aa64243b859729b2d0816b42b17e3, committed 2026-11-14T09:23:29Z. pushed_at the same day was 2026-11-14T09:26:50Z. The GitHub license field was MIT. The README and the docs files quoted here are from that commit.
The README install block prints these lines. It also prints package-manager lines for brew, pacman, paru, mise, and nix. This page copies the curl line and the npm line.
curl -fsSL https://opencode.ai/v2/install | bash
npm i -g @opencode/cli@latest
The README says the install script installs OpenCode under the home directory at .opencode/bin, and to remove versions older than 0.1.x before installing. The npm line uses @latest. It is not a pin. On 2026-11-14, https://registry.npmjs.org/@opencode/cli reported dist-tag latest as 2.3.0, and the registry time for 2.3.0 was 2026-11-13T08:54:17.847Z. This page did not run the install and did not install that package.
Config
services/site/src/docs/content/config.mdx says to create opencode.jsonc in the project. The locations section also names opencode.json. The Linux global path it prints is ~/.config/opencode/opencode.json(c). A project file can be opencode.json(c) in the project directory or under .opencode/. The example model value on that page is not copied.
services/site/src/docs/content/providers.mdx says to add a provider when its API is not already in the catalog. The custom example is titled opencode.jsonc. The fence below is that example. The baseURL in it is https://llm.acme.example/v1. That host is not a localhost URL. This page does not replace it with a host the example does not print.
{
"$schema": "https://opencode.ai/config.json",
"providers": {
"acme": {
"name": "Acme",
"env": ["ACME_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": {
"baseURL": "https://llm.acme.example/v1",
},
"models": {
"qwen3-coder": {
"name": "Qwen 3 Coder",
},
},
},
},
}
That page says the providers object is keyed by the provider ID used in model references, such as acme/qwen3-coder. A second block on the same page sets only the package and the same baseURL, with model qwen3-coder and an empty object. The package string is @opencode/ai/providers/openai-compatible.
The Ollama section says OpenCode probes http://127.0.0.1:11434, discovers completion models, and adds them to /models without an account connection. It prints:
ollama serve
ollama pull qwen3:8b
It says a remote or proxied Ollama server uses settings.baseURL, and that the value must include /v1. The example baseURL in that block is https://ollama.example.com/v1. That host is not http://127.0.0.1:11434. The probe URL and the example baseURL are not the same.
The Runtimes section says LM Studio and vLLM have built-in local discovery. Their default endpoints are http://127.0.0.1:1234/v1 and http://127.0.0.1:8000/v1. The block it prints sets both:
{
"$schema": "https://opencode.ai/config.json",
"providers": {
"lmstudio": {
"settings": { "baseURL": "http://gpu-host:1234/v1" },
},
"vllm": {
"settings": { "baseURL": "http://gpu-host:8000/v1" },
},
},
}
The same paragraph says vLLM checks /health before reading /v1/models, and that discovered vLLM models start with tools disabled. It says that for another OpenAI-compatible runtime, use the custom provider recipe and list its models explicitly. The gpu-host token is the page’s example. This page does not replace it.
The files this page read do not print an SSH command. When OpenCode and the model server are on the same machine, the vLLM default the page prints is http://127.0.0.1:8000/v1, and the Ollama probe is http://127.0.0.1:11434. If OpenCode runs on your computer and the server runs on the instance, the tunnel is How to use SSH port forwarding on a cloud GPU. How to serve an OpenAI-compatible API with vLLM on a cloud GPU is the general server install. How to run Ollama on a cloud GPU is the Ollama install.
The OpenCode files this page read do not print hf download. The block below is added on this page. How to download a Hugging Face model prints pip install -U "huggingface_hub" and hf download. This page did not download the repository. The OpenCode files this page read do not print this repository id.
pip install -U "huggingface_hub"
hf download unsloth/Llama-3.1-8B-Instruct
On 2026-11-14, GET https://huggingface.co/api/models/unsloth/Llama-3.1-8B-Instruct reported gated false, cardData.license llama3.1, pipeline_tag text-generation, lastModified 2025-05-09T19:32:57.000Z, and sha 4699cc75b550f9c6f3173fb80f4703b62d946aa5. The card YAML also includes extra_gated_prompt. Those two fields are not the same fact. The card’s base_model field names a repository this page does not copy. This page did not run hf download.
When it fails
CUDA out of memory. The OpenCode files this page read print no GPU GB figure. If the model server raises CUDA out of memory, use how to fix CUDA out of memory on a cloud GPU. This page does not pick a smaller model id for you.
“CUDA error: no kernel image is available for execution on the device” on an RTX 5090. The OpenCode README and the docs files this page read do not name compute capability 12.0. The RTX 5090 guide says that card is compute capability 12.0 (sm_120) and that PyTorch 2.7 and later, on a build for CUDA 12.8 or newer, is the line that announced support. This page did not install a torch wheel and did not re-test this program on an RTX 5090. Catalog RTX 5090 and RTX 5090D are 32. That is the catalog number only.
Discovered vLLM models have tools disabled. The providers page says discovery cannot infer tool support, so discovered vLLM models start with tools disabled. This page does not invent a setting that turns tools on.
What to copy off, then destroy
The config page says project settings live in opencode.json(c) in the project directory or under .opencode/. Copy that file and the project OpenCode edited before you destroy the instance. Save your work before you destroy a cloud GPU is the checklist. The terms say data on local instance storage is permanently deleted when the instance is destroyed.
The billing page states the billing rule in these words:
Per-minute options have a 1-minute minimum; unused prepaid minutes are refunded when you destroy the instance. Some configurations use whole-hour billing with a 1-hour minimum; unused time within a charged hour is not refunded on voluntary stop. The billing period, minimum charge and initial prepayment are shown before confirmation. No subscription.
Amounts are not copied here.
Frequently asked questions
What memory figure do the OpenCode docs print?
The README and the providers page print no GPU GB figure. The providers page prints request timeouts of five minutes for response headers and fifteen minutes between streamed chunks. This page does not treat those timeouts as vram_gb. The unsloth/Llama-3.1-8B-Instruct model information table prints parameter counts 8B, 70B, and 405B, and context length 128k. This page does not treat those figures as vram_gb. This page does not mark a catalog row as enough. Which listing you can start is on https://cloudgpu.app/deploy.
Which install lines do the README print?
The README install block prints curl -fsSL https://opencode.ai/v2/install | bash and npm i -g @opencode/cli@latest. It says the install script installs OpenCode under the home directory at .opencode/bin. npm latest on 2026-11-14 was 2.3.0, published 2026-11-13. The dev branch commit is 024a1462f55aa64243b859729b2d0816b42b17e3, committed 2026-11-14. https://github.com/sst/opencode returned 301 to https://github.com/anomalyco/opencode. This page did not run the install.
How do the docs point OpenCode at a local or OpenAI-compatible server?
The providers page custom example sets package to @opencode/ai/providers/openai-compatible and baseURL to https://llm.acme.example/v1, with model id qwen3-coder, in a file titled opencode.jsonc. The config page says to create opencode.jsonc, and the locations section also names opencode.json. The Ollama section probes http://127.0.0.1:11434 and prints ollama pull qwen3:8b. The vLLM default endpoint is http://127.0.0.1:8000/v1. That section says discovered vLLM models start with tools disabled. The files do not print an SSH command.
What license does the file print?
The LICENSE file begins with MIT License. The copyright line is Copyright © 2025 opencode. The GitHub license field on 2026-11-14 was MIT. That license text is not a CloudGPU rate.
Sources (read 2026-11-14, Asia/Shanghai)
https://github.com/sst/opencodereturned HTTP 301 tohttps://github.com/anomalyco/opencodeon 2026-11-14. Default branchdev- anomalyco/opencode README,
services/site/src/docs/content/config.mdx, andservices/site/src/docs/content/providers.mdxat commit024a1462f55aa64243b859729b2d0816b42b17e3, committed 2026-11-14T09:23:29Z. GitHub license field MIT.pushed_at2026-11-14T09:26:50Z - README install:
curl -fsSL https://opencode.ai/v2/install | bashandnpm i -g @opencode/cli@latest. Install directory is the home directory path ending in.opencode/bin. npm dist-taglatestwas2.3.0at2026-11-13T08:54:17.847Z. This page did not install it - Config page: create
opencode.jsonc. Locations also nameopencode.json. Linux global path~/.config/opencode/opencode.json(c). The example model value on that page is not copied - Providers page, Custom: package
@opencode/ai/providers/openai-compatible,baseURLhttps://llm.acme.example/v1, model idqwen3-coder. Other package names on that page are not copied - Providers page, Ollama: probe
http://127.0.0.1:11434.ollama serve.ollama pull qwen3:8b. Remote examplebaseURLhttps://ollama.example.com/v1, which must include/v1 - Providers page, Runtimes: vLLM default
http://127.0.0.1:8000/v1. ExamplebaseURLhttp://gpu-host:8000/v1. Discovered vLLM models start with tools disabled. Request timeouts: five minutes for headers, fifteen minutes between streamed chunks - LICENSE at that commit begins with MIT License. Copyright line Copyright © 2025 opencode
- Hugging Face model API
unsloth/Llama-3.1-8B-Instruct:gatedfalse,cardData.licensellama3.1,pipeline_tagtext-generation,lastModified2025-05-09T19:32:57.000Z,sha4699cc75b550f9c6f3173fb80f4703b62d946aa5. The card YAML includesextra_gated_prompt. The model information table prints 8B, 70B, 405B, and 128k.base_modelnames a repository this page does not copy.hf downloadis added on this page and was not run. The training-hardware section is not copied - Public GPU memory: https://cloudgpu.app/v1/public/gpu-catalog (
generated_at2026-11-14T10:04:57.194Z).GET /v1/public/compute-capabilitiesreturned feature flags and no GPU list. The catalog had no OpenCode template
Cards you can start are on the Deploy page. Amounts are not copied here.
Last updated: 2026-11-14 (Asia/Shanghai).