# How to set tolerance attributes of Gurobi inside Google Colab’s Julia environment

**URL:** https://discourse.julialang.org/t/how-to-set-tolerance-attributes-of-gurobi-inside-google-colab-s-julia-environment/128678
**Category:** Optimization (Mathematical)
**Tags:** question, gurobi
**Created:** [May 4, 2025, 3:41am UTC](https://discourse.julialang.org/t/how-to-set-tolerance-attributes-of-gurobi-inside-google-colab-s-julia-environment/128678 "2025-05-04T03:41:44Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [May 4, 2025, 4:51am UTC](https://discourse.julialang.org/t/how-to-set-tolerance-attributes-of-gurobi-inside-google-colab-s-julia-environment/128678/2 "2025-05-04T04:51:53Z")

</div>

You probably shouldn’t change the default tolerances. Please read [Tolerances and numerical issues · JuMP](https://jump.dev/JuMP.jl/stable/tutorials/getting_started/tolerances/) and change the tolerances only if you understand the implications.

Setting options in SDDP.jl can be done like any JuMP model. See the JuMP documentation: [Models · JuMP](https://jump.dev/JuMP.jl/stable/manual/models/#solver_options)

For example:

```Julia
using SDDP, Gurobi
GRB_ENV = Gurpbi.Env()
model = SDDP.LinearPolicyGraph(;
    optimizer = optimizer_with_attributes(
        () -> Gurobi.Optimizer(GRB_ENV),
        "TimeLimit" => 60.0,
    )
) do sp, t
end

```

or

```Julia
using SDDP, Gurobi
GRB_ENV = Gurpbi.Env()
model = SDDP.LinearPolicyGraph(;
    optimizer = () -> Gurobi.Optimizer(GRB_ENV),
) do sp, t
    set_attribute(sp, "TimeLimit", 60.0)
end

```

The Gurobi options can be found here [jump-dev/Gurobi.jl · JuMP](https://jump.dev/JuMP.jl/stable/packages/Gurobi/#Options)

p.s., I assume this is what you meant by your other question: [How to license Gurobi inside Google Colab's Julia environment - #7 by Engr\_Moiz\_Ahmad](https://discourse.julialang.org/t/how-to-license-gurobi-inside-google-colabs-julia-environment/128407/7). Setting parameters in a gurobi _environment_ (the `Env()`) object) is subtly different to settings parameters in a model. In general, you should prefer to set them in the model object. Use parameters in the `Env` only if needed by that particular parameter.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-set-tolerance-attributes-of-gurobi-inside-google-colab-s-julia-environment/128678)._
