--- sidebar_position: 5 description: Copy model and other functions to work with Ollama in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Ollama] --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; # Copy model Copies an existing model `Function CopyModel(Val URL, Val Model, Val Name, Val AdditionalHeaders = "") Export` | Parameter | CLI option | Type | Required | Description | |-|-|-|-|-| | URL | --url | String | ✔ | Ollama server URL | | Model | --model | String | ✔ | Name of existing model | | Name | --name | String | ✔ | The name of the new model | | AdditionalHeaders | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary | Returns: Map Of KeyAndValue - Processing result
:::tip Method at API documentation: [Copy a Model](https://github.com/ollama/ollama/blob/main/docs/api.md#copy-a-model) :::
```bsl title="1C:Enterprise/OneScript code example" URL = "https://hut.openintegrations.dev/ollama"; Token = "12We34..."; // Authorization - not part API Ollama Model = "mario"; Name = "mario2"; AdditionalHeaders = New Map; AdditionalHeaders.Insert("Authorization", StrTemplate("Bearer %1", Token)); Result = OPI_Ollama.CopyModel(URL, Model, Name, AdditionalHeaders); ``` ```bash # JSON data can also be passed as a path to a .json file oint ollama CopyModel \ --url "https://hut.openintegrations.dev/ollama" \ --model "mario" \ --name "mario2" \ --headers "{'Authorization':'***'}" ``` ```batch :: JSON data can also be passed as a path to a .json file oint ollama CopyModel ^ --url "https://hut.openintegrations.dev/ollama" ^ --model "mario" ^ --name "mario2" ^ --headers "{'Authorization':'***'}" ``` ```json title="Result" { "status_code": 200 } ```