# OllamaResource

- Module: [CommunityToolkit.Aspire.Hosting.Ollama](/reference/api/typescript/communitytoolkit.aspire.hosting.ollama.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

A resource that represents an Ollama container.

## Definition

```typescript
interface OllamaResource
  extends IComputeResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IOllamaResource,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly host: EndpointReferenceExpression;
  readonly models: string[];
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  readonly uriExpression: ReferenceExpression;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): OllamaResource;
  withGPUSupport(vendor?: OllamaGpuVendor): OllamaResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the connection string expression for the Ollama server.
- `host`: `EndpointReferenceExpression` `get` -- Gets the Host property
- `models`: `string[]` `get` -- Gets the Models property
- `port`: `EndpointReferenceExpression` `get` -- Gets the Port property
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the PrimaryEndpoint property
- `uriExpression`: `ReferenceExpression` `get` -- Gets the UriExpression property

## Methods

- [withDataVolume](/reference/api/typescript/communitytoolkit.aspire.hosting.ollama/ollamaresource/withdatavolume.md) -- `method` -- Adds a data volume to the Ollama container.
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): OllamaResource
  ```
- [withGPUSupport](/reference/api/typescript/communitytoolkit.aspire.hosting.ollama/ollamaresource/withgpusupport.md) -- `method` -- Adds GPU support to the Ollama container.
    ```typescript
  withGPUSupport(vendor?: OllamaGpuVendor): OllamaResource
  ```
