> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.models.stub model

<a id="camel.models.stub_model" />

<a id="camel.models.stub_model.StubTokenCounter" />

## StubTokenCounter

```python theme={"system"}
class StubTokenCounter(BaseTokenCounter):
```

<a id="camel.models.stub_model.StubTokenCounter.count_tokens_from_messages" />

### count\_tokens\_from\_messages

```python theme={"system"}
def count_tokens_from_messages(self, messages: List[OpenAIMessage]):
```

Token counting for STUB models, directly returning a constant.

**Parameters:**

* **messages** (List\[OpenAIMessage]): Message list with the chat history in OpenAI API format.

**Returns:**

int: A constant to act as the number of the tokens in the
messages.

<a id="camel.models.stub_model.StubTokenCounter.encode" />

### encode

```python theme={"system"}
def encode(self, text: str):
```

Encode text into token IDs for STUB models.

**Parameters:**

* **text** (str): The text to encode.

**Returns:**

List\[int]: List of token IDs.

<a id="camel.models.stub_model.StubTokenCounter.decode" />

### decode

```python theme={"system"}
def decode(self, token_ids: List[int]):
```

Decode token IDs back to text for STUB models.

**Parameters:**

* **token\_ids** (List\[int]): List of token IDs to decode.

**Returns:**

str: Decoded text.

<a id="camel.models.stub_model.StubModel" />

## StubModel

```python theme={"system"}
class StubModel(BaseModelBackend):
```

A dummy model used for unit tests.

<a id="camel.models.stub_model.StubModel.__init__" />

### **init**

```python theme={"system"}
def __init__(
    self,
    model_type: Union[ModelType, str],
    model_config_dict: Optional[Dict[str, Any]] = None,
    api_key: Optional[str] = None,
    url: Optional[str] = None,
    token_counter: Optional[BaseTokenCounter] = None,
    timeout: Optional[float] = None,
    max_retries: int = 3
):
```

All arguments are unused for the dummy model.

<a id="camel.models.stub_model.StubModel.token_counter" />

### token\_counter

```python theme={"system"}
def token_counter(self):
```

**Returns:**

BaseTokenCounter: The token counter following the model's
tokenization style.

<a id="camel.models.stub_model.StubModel._run" />

### \_run

```python theme={"system"}
def _run(
    self,
    messages: List[OpenAIMessage],
    response_format: Optional[Type[BaseModel]] = None,
    tools: Optional[List[Dict[str, Any]]] = None
):
```

**Returns:**

Dict\[str, Any]: Response in the OpenAI API format.
