How to run SWE-agent with a self-hosted model on a cloud GPU

Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Install SWE-agent with the source commands the official install page prints, serve a model on that machine, and set api_base in the local-model config those docs print. Copy the trajectories/ directory before you destroy the instance, because destroying the instance deletes its disk, and that directory is where the run writes the .traj files.

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 SWE-agent install. A terminal agent whose install page runs curl -fsSL https://www.openinterpreter.com/install | sh, and whose models page sets the Ollama base URL to http://localhost:11434/v1, is How to run Open Interpreter with a self-hosted model on a cloud GPU. A workspace app whose Docker quickstart publishes port 3001, and whose Ollama page sets the URL to http://127.0.0.1:11434, is How to run AnythingLLM agents 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 coding agent whose providers page sets package to the OpenAI-compatible provider is How to use OpenCode with a self-hosted model on a cloud GPU. A coding-agent server whose card prints --tool-call-parser qwen3_coder is How to serve Qwen3-Coder for coding agents on a cloud GPU. 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 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 README license line is MIT.

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 README names closed models in its opening sentence. Those names are not copied. The README has a section this page does not copy. News lines on the README print benchmark figures this page does not copy.

What the docs print about memory

The installation page, the models page, and the local-models section, read 2026-11-14, do not print a GPU GB figure. The local-model yaml sets max_input_tokens to 0, and footnote 3 says that disables the max input tokens check. A later warning on the same page says to set max_input_tokens to a non-None value to avoid other warnings. This page does not choose between those two lines. Neither line is 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-14T11:11:10.599Z). 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 SWE-agent template. It did have Ollama templates (jupyterlab-ollama, ollama-qwen3, ollama). Those templates are a different install. This page does not treat them as SWE-agent.

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

Main of SWE-agent/SWE-agent on 2026-11-14 was commit 3ea751c087f32b16e039a2233dd6eefecef325d5, committed 2026-07-16T15:21:18Z. pushed_at was 2026-11-09T22:24:38Z. The GitHub license field was MIT. pyproject.toml at that commit requires Python >=3.11. The script entry is sweagent.

The README says most current development is on mini-swe-agent, and that the general recommendation is to use mini-SWE-agent instead of SWE-agent. This page documents the SWE-agent install the installation page prints. It does not copy a mini-swe-agent install.

docs/installation/source.md prints:

git clone https://github.com/SWE-agent/SWE-agent.git

Then, at the repository root:

python -m pip install --upgrade pip && pip install --editable .

The check it prints is:

sweagent --help

It says that if the command is not found, try python -m sweagent. It says the default backend is Docker, and that you can still run SWE-agent without Docker by using code evaluation in the cloud. This page does not copy the cloud-execution command. It says to run git pull later, and that there is no need to redo the pip install after that pull.

The files this page read do not print an SSH command. The local-model api_base below is http://localhost:11434. The tunnel for a port you choose to publish is How to use SSH port forwarding on a cloud GPU.

Local model

docs/installation/keys.md says SWE-agent supports models that serve an endpoint with an OpenAI-compatible API. The local-model example it prints is:

agent:
  model:
    name: ollama/llama2
    api_base: http://localhost:11434
    per_instance_cost_limit: 0
    total_cost_limit: 0
    per_instance_call_limit: 100
    max_input_tokens: 0
  tools:
    parse_function:
      type: "thought_action"
  history_processors: []

Footnote 1 says the model name must include a provider, in the form provider/model_name, and that the provider string can be chosen for a local model. Footnote 2 says costs cannot be tracked, so those limits must be disabled. Footnote 3 says max_input_tokens: 0 disables the max input tokens check. The warning later on the same page says to set max_input_tokens to a non-None value. This page does not choose between footnote 3 and that warning. The zeros disable the cost calculator. They are not a rental rate.

The keys page titles that block config/your_config.yaml and says to put it in the config file. It says that if you have not passed --config, SWE-agent loads a default config, and that the default uses function calling. That default does not set this api_base. The FAQ says the default parser is function_calling, and that a model without function calling can use thought_action. The yaml above sets thought_action. The FAQ says thought_action extracts the last triple-backticks block from the model response, and that the tools then have to be documented in the prompt because the model will not see the function signature.

Save that block as config/your_config.yaml inside the SWE-agent clone. The config/ directory is already in that clone. The command-line tutorial loads a config with sweagent run --config my_run.yaml. That filename is not config/your_config.yaml. This page does not merge the two names. The run commands below add --config config/your_config.yaml, and they are written from the SWE-agent repository root. That flag is added on this page. The hello-world and local-repository blocks do not print it.

The keys page says a proxy setup should set agent.model.name to a provider prefix this page does not copy, and that agent.model.api_key cannot be empty. The models page’s custom registry example prints per-token fields this page does not copy. The model id in that example is ollama/llama2, with max_tokens 8192 and litellm_provider ollama. This page does not copy the second registry entry.

The SWE-agent 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 SWE-agent files this page read do not print this repository id. ollama/llama2 is the name the local-model yaml prints. This page does not treat it as 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.

How to run Ollama on a cloud GPU is the Ollama install. How to serve an OpenAI-compatible API with vLLM on a cloud GPU is the general server install. The keys page’s api_base value is http://localhost:11434, without a /v1 suffix. This page does not add one.

A run

The hello-world page runs SWE-agent on https://github.com/SWE-agent/test-repo/issues/1. The flags it prints for the repository and the issue are below. --config config/your_config.yaml is added on this page so the run loads the local-model file from the previous section. The command on the hello-world page also sets --agent.model.name and --agent.model.per_instance_cost_limit. The model id and the limit number are not copied here. Those settings are the ones in config/your_config.yaml.

sweagent run \
  --config config/your_config.yaml \
  --env.repo.github_url=https://github.com/SWE-agent/test-repo \
  --problem_statement.github_url=https://github.com/SWE-agent/test-repo/issues/1

The command-line tutorial’s local-repository example clones the same test repo. --config config/your_config.yaml is added on this page, the same way as the command above. The command on that page also sets --agent.model.name to a model id this page does not copy.

git clone https://github.com/SWE-agent/test-repo.git
sweagent run \
  --config config/your_config.yaml \
  --env.repo.path=test-repo \
  --problem_statement.path=test-repo/problem_statements/1.md \
  --env.deployment.image=python:3.12

LocalRepoConfig copies a repository from the local filesystem into the Docker container. The hello-world page says the default deployment is a Docker container. It says running directly on the computer is not recommended. Run both commands from the SWE-agent repository root, so config/your_config.yaml is the file saved above and test-repo is the clone in that directory.

The trajectories page says the default output folder is trajectories/. The main file for an instance ends in .traj. It says the experiment directory uses the system user name and a name inferred from the model and the other run settings.

When it fails

CUDA out of memory. The SWE-agent 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 SWE-agent README and the docs pages 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.

Cost calculator. The keys page says that if the default cost limits stay on, the cost calculator errors because it cannot find the model in the litellm model cost dictionary. The local yaml sets per_instance_cost_limit and total_cost_limit to 0 and sets per_instance_call_limit to 100.

Function calling. The FAQ says that if the model does not support function calling, set agent.tools.parse_function.type to thought_action. The local yaml already sets that type. The default config does not.

Error code: 404. The keys page says to check the configured keys and a base-URL environment variable. The variable name on that page is not copied here. The yaml field the local-models section prints is api_base.

What to copy off, then destroy

The trajectories page says experiment results, including sweagent run, are written under trajectories/. Copy that directory, including the .traj files, before you destroy the instance. The hello-world page also says the run can be turned into demonstrations together with other log and output files. Copy those files from the working directory if the run wrote them there.

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 SWE-agent docs print?

The installation page, the models page, and the local-models section do not print a GPU GB figure. The local-model yaml sets max_input_tokens to 0 and the footnote says that disables the max input tokens check. A later warning on the same page says to set max_input_tokens to a non-None value. This page does not choose between those two lines and does not treat either 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 docs print?

The source install page prints git clone https://github.com/SWE-agent/SWE-agent.git and then python -m pip install --upgrade pip && pip install --editable . at the repository root. pyproject.toml requires Python >=3.11. The check command is sweagent --help. Main is commit 3ea751c087f32b16e039a2233dd6eefecef325d5, committed 2026-07-16. The README says current development is on mini-swe-agent and recommends that project instead. This page did not run the commands and did not copy a mini-swe-agent install.

How do the docs point SWE-agent at a server on the same machine?

The local-models yaml sets name to ollama/llama2 and api_base to http://localhost:11434. It also sets per_instance_cost_limit and total_cost_limit to 0, and per_instance_call_limit to 100. Those zeros disable the cost calculator. They are not a rental rate. The keys page titles that block config/your_config.yaml. The command-line tutorial loads a config with sweagent run --config my_run.yaml. That filename is not config/your_config.yaml. If you do not pass --config, SWE-agent loads a default config that uses function calling and does not set this api_base. This page adds --config config/your_config.yaml to both run examples. The hello-world flags are the test-repo GitHub URL and issue URL. The local-repository example sets --env.repo.path to test-repo and --problem_statement.path to test-repo/problem_statements/1.md. The model name and the cost-limit number on those upstream commands are not copied here. If the model does not support function calling, the same yaml sets parse_function type to thought_action. The files do not print an SSH command.

What license sentence does the README print?

The README license line is MIT. 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)

  • SWE-agent/SWE-agent README at commit 3ea751c087f32b16e039a2233dd6eefecef325d5, committed 2026-07-16T15:21:18Z. GitHub license field MIT. pushed_at 2026-11-09T22:24:38Z. License line: MIT. Check LICENSE. The README recommends https://github.com/SWE-agent/mini-swe-agent/. Closed-model names, benchmark figures, and one section of the README are not copied
  • pyproject.toml at that commit. requires-python >=3.11. Script sweagent = sweagent.run.run:main
  • docs/installation/source.md at that commit. git clone https://github.com/SWE-agent/SWE-agent.git. python -m pip install --upgrade pip && pip install --editable .. sweagent --help. Default backend Docker
  • docs/installation/keys.md at that commit. Local yaml title config/your_config.yaml. name: ollama/llama2, api_base: http://localhost:11434, cost limits 0, per_instance_call_limit: 100, max_input_tokens: 0, parse_function.type thought_action. Without --config, the default config loads. Footnote 3 and the later non-None warning disagree. A proxy prefix and a base-URL environment variable name are not copied. Error code: 404 is the error that section names
  • docs/config/models.md at that commit. Local models should unset spending limits and set the action parser when function calling is unavailable. Registry example ollama/llama2 with max_tokens 8192. Per-token fields are not copied
  • docs/usage/hello_world.md at that commit. sweagent run with --env.repo.github_url=https://github.com/SWE-agent/test-repo and --problem_statement.github_url=https://github.com/SWE-agent/test-repo/issues/1. That block does not print --config. This page adds --config config/your_config.yaml. The model id and the cost-limit number on that command are not copied. Default deployment is Docker
  • docs/usage/cl_tutorial.md at that commit. Local path --env.repo.path=test-repo, --problem_statement.path=test-repo/problem_statements/1.md, --env.deployment.image=python:3.12. sweagent run --config my_run.yaml. That filename is not config/your_config.yaml. The model id on the local-path command is not copied. This page adds --config config/your_config.yaml to that run
  • docs/faq.md at that commit. Local models are supported. Default parser function_calling. Alternative thought_action. A multimodal example names models this page does not copy
  • docs/usage/trajectories.md at that commit. Default folder trajectories/. Main file ends in .traj
  • Hugging Face model API unsloth/Llama-3.1-8B-Instruct: gated false, cardData.license llama3.1, pipeline_tag text-generation, lastModified 2025-05-09T19:32:57.000Z, sha 4699cc75b550f9c6f3173fb80f4703b62d946aa5. The card YAML includes extra_gated_prompt. The model information table prints 8B, 70B, 405B, and 128k. base_model names a repository this page does not copy. hf download is 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_at 2026-11-14T11:11:10.599Z). GET /v1/public/compute-capabilities returned feature flags and no GPU list. The catalog had no SWE-agent template

Cards you can start are on the Deploy page. Amounts are not copied here.

Last updated: 2026-11-14 (Asia/Shanghai).